Linux-Fsdevel Archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org, david@fromorbit.com, hch@lst.de,
	fdmanana@kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 3/3] vfs: move __sb_{start,end}_write* to fs.h
Date: Tue, 10 Nov 2020 12:36:26 +0100	[thread overview]
Message-ID: <20201110113626.GE20780@quack2.suse.cz> (raw)
In-Reply-To: <160494582399.772573.10836748188202532335.stgit@magnolia>

On Mon 09-11-20 10:17:04, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Now that we've straightened out the callers, move these three functions
> to fs.h since they're fairly trivial.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Looks good to me. You can add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/super.c         |   30 ------------------------------
>  include/linux/fs.h |   21 ++++++++++++++++++---
>  2 files changed, 18 insertions(+), 33 deletions(-)
> 
> 
> diff --git a/fs/super.c b/fs/super.c
> index 59aa59279133..98bb0629ee10 100644
> --- a/fs/super.c
> +++ b/fs/super.c
> @@ -1631,36 +1631,6 @@ int super_setup_bdi(struct super_block *sb)
>  }
>  EXPORT_SYMBOL(super_setup_bdi);
>  
> -/*
> - * This is an internal function, please use sb_end_{write,pagefault,intwrite}
> - * instead.
> - */
> -void __sb_end_write(struct super_block *sb, int level)
> -{
> -	percpu_up_read(sb->s_writers.rw_sem + level-1);
> -}
> -EXPORT_SYMBOL(__sb_end_write);
> -
> -/*
> - * This is an internal function, please use sb_start_{write,pagefault,intwrite}
> - * instead.
> - */
> -void __sb_start_write(struct super_block *sb, int level)
> -{
> -	percpu_down_read(sb->s_writers.rw_sem + level - 1);
> -}
> -EXPORT_SYMBOL(__sb_start_write);
> -
> -/*
> - * This is an internal function, please use sb_start_{write,pagefault,intwrite}
> - * instead.
> - */
> -bool __sb_start_write_trylock(struct super_block *sb, int level)
> -{
> -	return percpu_down_read_trylock(sb->s_writers.rw_sem + level - 1);
> -}
> -EXPORT_SYMBOL_GPL(__sb_start_write_trylock);
> -
>  /**
>   * sb_wait_write - wait until all writers to given file system finish
>   * @sb: the super for which we wait
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 305989afd49c..6dabd019cab0 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -1580,9 +1580,24 @@ extern struct timespec64 current_time(struct inode *inode);
>   * Snapshotting support.
>   */
>  
> -void __sb_end_write(struct super_block *sb, int level);
> -void __sb_start_write(struct super_block *sb, int level);
> -bool __sb_start_write_trylock(struct super_block *sb, int level);
> +/*
> + * These are internal functions, please use sb_start_{write,pagefault,intwrite}
> + * instead.
> + */
> +static inline void __sb_end_write(struct super_block *sb, int level)
> +{
> +	percpu_up_read(sb->s_writers.rw_sem + level-1);
> +}
> +
> +static inline void __sb_start_write(struct super_block *sb, int level)
> +{
> +	percpu_down_read(sb->s_writers.rw_sem + level - 1);
> +}
> +
> +static inline bool __sb_start_write_trylock(struct super_block *sb, int level)
> +{
> +	return percpu_down_read_trylock(sb->s_writers.rw_sem + level - 1);
> +}
>  
>  #define __sb_writers_acquired(sb, lev)	\
>  	percpu_rwsem_acquire(&(sb)->s_writers.rw_sem[(lev)-1], 1, _THIS_IP_)
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2020-11-10 11:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-09 18:16 [PATCH v3 0/3] vfs: remove lockdep fs freeze weirdness Darrick J. Wong
2020-11-09 18:16 ` [PATCH 1/3] vfs: remove lockdep bogosity in __sb_start_write Darrick J. Wong
2020-11-10 11:33   ` Jan Kara
2020-11-09 18:16 ` [PATCH 2/3] vfs: separate __sb_start_write into blocking and non-blocking helpers Darrick J. Wong
2020-11-10 11:35   ` Jan Kara
2020-11-10 18:32   ` Christoph Hellwig
2020-11-09 18:17 ` [PATCH 3/3] vfs: move __sb_{start,end}_write* to fs.h Darrick J. Wong
2020-11-10 11:36   ` Jan Kara [this message]
2020-11-10 18:32   ` Christoph Hellwig

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=20201110113626.GE20780@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=darrick.wong@oracle.com \
    --cc=david@fromorbit.com \
    --cc=fdmanana@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@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 read-only IMAP folder(s) and NNTP newsgroup(s).