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 2/4] btrfs: inline wait_current_trans_commit_start in its caller
Date: Fri, 4 Jun 2021 20:37:54 +0800	[thread overview]
Message-ID: <c704ada7-53e5-49e4-d399-84ac4b7f7aff@oracle.com> (raw)
In-Reply-To: <21a09105f7c7cc9bed5c565b32d3b37964806b82.1622733245.git.dsterba@suse.com>

On 3/6/21 11:20 pm, David Sterba wrote:
> Function wait_current_trans_commit_start is now fairly trivial so it can
> be inlined in its only caller.
> 
> Signed-off-by: David Sterba <dsterba@suse.com>

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

Thanks, Anand

> ---
>   fs/btrfs/transaction.c | 20 +++++++-------------
>   1 file changed, 7 insertions(+), 13 deletions(-)
> 
> diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
> index 30347e660027..73df8b81496e 100644
> --- a/fs/btrfs/transaction.c
> +++ b/fs/btrfs/transaction.c
> @@ -1870,18 +1870,6 @@ int btrfs_transaction_blocked(struct btrfs_fs_info *info)
>   	return ret;
>   }
>   
> -/*
> - * wait for the current transaction commit to start and block subsequent
> - * transaction joins
> - */
> -static void wait_current_trans_commit_start(struct btrfs_fs_info *fs_info,
> -					    struct btrfs_transaction *trans)
> -{
> -	wait_event(fs_info->transaction_blocked_wait,
> -		   trans->state >= TRANS_STATE_COMMIT_START ||
> -		   TRANS_ABORTED(trans));
> -}
> -
>   /*
>    * commit transactions asynchronously. once btrfs_commit_transaction_async
>    * returns, any subsequent transaction will not be allowed to join.
> @@ -1941,7 +1929,13 @@ int btrfs_commit_transaction_async(struct btrfs_trans_handle *trans)
>   		__sb_writers_release(fs_info->sb, SB_FREEZE_FS);
>   
>   	schedule_work(&ac->work);
> -	wait_current_trans_commit_start(fs_info, cur_trans);
> +	/*
> +	 * Wait for the current transaction commit to start and block
> +	 * subsequent transaction joins
> +	 */
> +	wait_event(fs_info->transaction_blocked_wait,
> +		   cur_trans->state >= TRANS_STATE_COMMIT_START ||
> +		   TRANS_ABORTED(cur_trans));
>   	if (current->journal_info == trans)
>   		current->journal_info = NULL;
>   
> 


  reply	other threads:[~2021-06-04 12:38 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
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 [this message]
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=c704ada7-53e5-49e4-d399-84ac4b7f7aff@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.