All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: David Sterba <dsterba@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/4] btrfs: sink wait_for_unblock parameter to async commit
Date: Fri, 4 Jun 2021 20:35:46 +0800	[thread overview]
Message-ID: <b74f45ea-7f5a-04ec-fc41-257fe20e4ca0@oracle.com> (raw)
In-Reply-To: <c3c791a112de00b3d915184da8cce7b634570b2a.1622733245.git.dsterba@suse.com>

On 3/6/21 11:20 pm, David Sterba wrote:
> There's only one caller left btrfs_ioctl_start_sync that passes 0, so we
> can remove the switch in btrfs_commit_transaction_async.
> 
> A cleanup 9babda9f33fd ("btrfs: Remove async_transid from
> btrfs_mksubvol/create_subvol/create_snapshot") removed calls that passed
> 1, so this is a followup.
> 
> As this removes last call of wait_current_trans_commit_start_and_unblock,
> remove the function as well.
> 
> Signed-off-by: David Sterba <dsterba@suse.com>

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

Thanks, Anand

> ---
>   fs/btrfs/ioctl.c       |  2 +-
>   fs/btrfs/transaction.c | 24 ++----------------------
>   fs/btrfs/transaction.h |  3 +--
>   3 files changed, 4 insertions(+), 25 deletions(-)
> 
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index 2bdaf2018197..f83eb4a225cc 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -3643,7 +3643,7 @@ static noinline long btrfs_ioctl_start_sync(struct btrfs_root *root,
>   		goto out;
>   	}
>   	transid = trans->transid;
> -	ret = btrfs_commit_transaction_async(trans, 0);
> +	ret = btrfs_commit_transaction_async(trans);
>   	if (ret) {
>   		btrfs_end_transaction(trans);
>   		return ret;
> diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
> index 22951621363f..30347e660027 100644
> --- a/fs/btrfs/transaction.c
> +++ b/fs/btrfs/transaction.c
> @@ -1882,19 +1882,6 @@ static void wait_current_trans_commit_start(struct btrfs_fs_info *fs_info,
>   		   TRANS_ABORTED(trans));
>   }
>   
> -/*
> - * wait for the current transaction to start and then become unblocked.
> - * caller holds ref.
> - */
> -static void wait_current_trans_commit_start_and_unblock(
> -					struct btrfs_fs_info *fs_info,
> -					struct btrfs_transaction *trans)
> -{
> -	wait_event(fs_info->transaction_wait,
> -		   trans->state >= TRANS_STATE_UNBLOCKED ||
> -		   TRANS_ABORTED(trans));
> -}
> -
>   /*
>    * commit transactions asynchronously. once btrfs_commit_transaction_async
>    * returns, any subsequent transaction will not be allowed to join.
> @@ -1922,8 +1909,7 @@ static void do_async_commit(struct work_struct *work)
>   	kfree(ac);
>   }
>   
> -int btrfs_commit_transaction_async(struct btrfs_trans_handle *trans,
> -				   int wait_for_unblock)
> +int btrfs_commit_transaction_async(struct btrfs_trans_handle *trans)
>   {
>   	struct btrfs_fs_info *fs_info = trans->fs_info;
>   	struct btrfs_async_commit *ac;
> @@ -1955,13 +1941,7 @@ int btrfs_commit_transaction_async(struct btrfs_trans_handle *trans,
>   		__sb_writers_release(fs_info->sb, SB_FREEZE_FS);
>   
>   	schedule_work(&ac->work);
> -
> -	/* wait for transaction to start and unblock */
> -	if (wait_for_unblock)
> -		wait_current_trans_commit_start_and_unblock(fs_info, cur_trans);
> -	else
> -		wait_current_trans_commit_start(fs_info, cur_trans);
> -
> +	wait_current_trans_commit_start(fs_info, cur_trans);
>   	if (current->journal_info == trans)
>   		current->journal_info = NULL;
>   
> diff --git a/fs/btrfs/transaction.h b/fs/btrfs/transaction.h
> index c49e2266b28b..0702e8d9b30e 100644
> --- a/fs/btrfs/transaction.h
> +++ b/fs/btrfs/transaction.h
> @@ -226,8 +226,7 @@ void btrfs_add_dead_root(struct btrfs_root *root);
>   int btrfs_defrag_root(struct btrfs_root *root);
>   int btrfs_clean_one_deleted_snapshot(struct btrfs_root *root);
>   int btrfs_commit_transaction(struct btrfs_trans_handle *trans);
> -int btrfs_commit_transaction_async(struct btrfs_trans_handle *trans,
> -				   int wait_for_unblock);
> +int btrfs_commit_transaction_async(struct btrfs_trans_handle *trans);
>   int btrfs_end_transaction_throttle(struct btrfs_trans_handle *trans);
>   bool btrfs_should_end_transaction(struct btrfs_trans_handle *trans);
>   void btrfs_throttle(struct btrfs_fs_info *fs_info);
> 


  reply	other threads:[~2021-06-04 12:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-03 15:20 [PATCH 0/4] Slightly how START_SYNC and WAIT_SYNC work David Sterba
2021-06-03 15:20 ` [PATCH 1/4] btrfs: sink wait_for_unblock parameter to async commit David Sterba
2021-06-04 12:35   ` Anand Jain [this message]
2021-06-03 15:20 ` [PATCH 2/4] btrfs: inline wait_current_trans_commit_start in its caller David Sterba
2021-06-04 12:37   ` Anand Jain
2021-06-03 15:20 ` [PATCH 3/4] btrfs: replace async commit by pending actions David Sterba
2021-06-03 15:20 ` [PATCH 4/4] btrfs: remove fs_info::transaction_blocked_wait David Sterba
2021-06-04 10:59 ` [PATCH 0/4] Slightly how START_SYNC and WAIT_SYNC work 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=b74f45ea-7f5a-04ec-fc41-257fe20e4ca0@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=dsterba@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.