linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: Josef Bacik <josef@toxicpanda.com>,
	linux-btrfs@vger.kernel.org, kernel-team@fb.com
Cc: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Subject: Re: [PATCH v3 09/15] btrfs: add a BTRFS_FS_NEED_TRANS_COMMIT flag
Date: Fri, 21 Oct 2022 14:03:24 +0800	[thread overview]
Message-ID: <2a07e1a8-8015-ff19-ba55-61fa2da16bdb@oracle.com> (raw)
In-Reply-To: <9c3c50c6a36b7d56e3bc9bb883f5f0209d0dbcd8.1666190849.git.josef@toxicpanda.com>

On 19/10/2022 22:50, Josef Bacik wrote:
> Currently we are only using fs_info->pending_changes to indicate that we
> need a transaction commit.  The original users for this were removed
> years ago, so this is the only remaining reason to have this field.  Add
> a flag so we can remove this code.
> 
> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

Why did we miss my rb though some of the patches have no code-change, 
for example this patch.

Hm. Let's move on. Copying RB from v1.

Reviewed-by: Anand Jain <anand.jain@oracle.com>


> ---
>   fs/btrfs/fs.h          | 3 +++
>   fs/btrfs/super.c       | 3 ++-
>   fs/btrfs/sysfs.c       | 4 ++--
>   fs/btrfs/transaction.c | 2 ++
>   4 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/btrfs/fs.h b/fs/btrfs/fs.h
> index 2d06add70695..7b221d37ad0e 100644
> --- a/fs/btrfs/fs.h
> +++ b/fs/btrfs/fs.h
> @@ -90,6 +90,9 @@ enum {
>   	/* Indicate we have to finish a zone to do next allocation. */
>   	BTRFS_FS_NEED_ZONE_FINISH,
>   
> +	/* Indicate that we want to commit the transaction. */
> +	BTRFS_FS_NEED_TRANS_COMMIT,
> +
>   #if BITS_PER_LONG == 32
>   	/* Indicate if we have error/warn message printed on 32bit systems */
>   	BTRFS_FS_32BIT_ERROR,
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index daab56b6a582..7e9c1bff2fd6 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -1534,7 +1534,8 @@ int btrfs_sync_fs(struct super_block *sb, int wait)
>   			 * Exit unless we have some pending changes
>   			 * that need to go through commit
>   			 */
> -			if (fs_info->pending_changes == 0)
> +			if (!test_bit(BTRFS_FS_NEED_TRANS_COMMIT,
> +				      &fs_info->flags))
>   				return 0;
>   			/*
>   			 * A non-blocking test if the fs is frozen. We must not
> diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
> index 0d98984af0e9..eb1a98991ec3 100644
> --- a/fs/btrfs/sysfs.c
> +++ b/fs/btrfs/sysfs.c
> @@ -250,7 +250,7 @@ static ssize_t btrfs_feature_attr_store(struct kobject *kobj,
>   	/*
>   	 * We don't want to do full transaction commit from inside sysfs
>   	 */
> -	btrfs_set_pending(fs_info, COMMIT);
> +	set_bit(BTRFS_FS_NEED_TRANS_COMMIT, &fs_info->flags);
>   	wake_up_process(fs_info->transaction_kthread);
>   
>   	return count;
> @@ -961,7 +961,7 @@ static ssize_t btrfs_label_store(struct kobject *kobj,
>   	/*
>   	 * We don't want to do full transaction commit from inside sysfs
>   	 */
> -	btrfs_set_pending(fs_info, COMMIT);
> +	set_bit(BTRFS_FS_NEED_TRANS_COMMIT, &fs_info->flags);
>   	wake_up_process(fs_info->transaction_kthread);
>   
>   	return len;
> diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
> index bae77fb05e2b..7b6b68ab089a 100644
> --- a/fs/btrfs/transaction.c
> +++ b/fs/btrfs/transaction.c
> @@ -2104,6 +2104,8 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
>   	ASSERT(refcount_read(&trans->use_count) == 1);
>   	btrfs_trans_state_lockdep_acquire(fs_info, BTRFS_LOCKDEP_TRANS_COMMIT_START);
>   
> +	clear_bit(BTRFS_FS_NEED_TRANS_COMMIT, &fs_info->flags);
> +
>   	/* Stop the commit early if ->aborted is set */
>   	if (TRANS_ABORTED(cur_trans)) {
>   		ret = cur_trans->aborted;


  reply	other threads:[~2022-10-21  6:03 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19 14:50 [PATCH v3 00/15] btrfs: split out larger chunks of ctree.h Josef Bacik
2022-10-19 14:50 ` [PATCH v3 01/15] btrfs: move fs wide helpers out " Josef Bacik
2022-10-20  6:08   ` Johannes Thumshirn
2022-10-21  6:11   ` Anand Jain
2022-10-19 14:50 ` [PATCH v3 02/15] btrfs: move assert " Josef Bacik
2022-10-20  6:09   ` Johannes Thumshirn
2022-10-20 15:49   ` David Sterba
2022-10-20 15:52     ` David Sterba
2022-10-19 14:50 ` [PATCH v3 03/15] btrfs: move the printk " Josef Bacik
2022-10-20  6:16   ` Johannes Thumshirn
2022-10-19 14:50 ` [PATCH v3 04/15] btrfs: push printk index code into their respective helpers Josef Bacik
2022-10-19 14:50 ` [PATCH v3 05/15] btrfs: move BTRFS_FS_STATE* defs and helpers to fs.h Josef Bacik
2022-10-19 14:50 ` [PATCH v3 06/15] btrfs: convert incompat and compat flag test helpers to defines Josef Bacik
2022-10-19 14:50 ` [PATCH v3 07/15] btrfs: move mount option definitions to fs.h Josef Bacik
2022-10-21  7:13   ` Anand Jain
2022-10-19 14:50 ` [PATCH v3 08/15] btrfs: move fs_info->flags enum " Josef Bacik
2022-10-21  6:57   ` Anand Jain
2022-10-19 14:50 ` [PATCH v3 09/15] btrfs: add a BTRFS_FS_NEED_TRANS_COMMIT flag Josef Bacik
2022-10-21  6:03   ` Anand Jain [this message]
2022-10-21  7:14     ` David Sterba
2022-10-19 14:50 ` [PATCH v3 10/15] btrfs: remove fs_info::pending_changes and related code Josef Bacik
2022-10-21  7:24   ` Anand Jain
2022-10-19 14:50 ` [PATCH v3 11/15] btrfs: move the compat/incompat flag masks to fs.h Josef Bacik
2022-10-21  7:16   ` Anand Jain
2022-10-19 14:50 ` [PATCH v3 12/15] btrfs: rename struct-funcs.c -> accessors.c Josef Bacik
2022-10-21  7:29   ` Anand Jain
2022-10-19 14:50 ` [PATCH v3 13/15] btrfs: move btrfs_map_token to accessors Josef Bacik
2022-10-20  6:22   ` Johannes Thumshirn
2022-10-19 14:51 ` [PATCH v3 14/15] btrfs: move accessor helpers into accessors.h Josef Bacik
2022-10-19 14:51 ` [PATCH v3 15/15] btrfs: remove temporary btrfs_map_token declaration in ctree.h Josef Bacik
2022-10-20  6:23   ` Johannes Thumshirn
2022-10-21  7:25   ` Anand Jain
2022-10-20 16:29 ` [PATCH v3 00/15] btrfs: split out larger chunks of ctree.h David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2a07e1a8-8015-ff19-ba55-61fa2da16bdb@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=johannes.thumshirn@wdc.com \
    --cc=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).