mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-28 22:54:05 +08:00
vfs: move __sb_{start,end}_write* to fs.h
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> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jan Kara <jack@suse.cz>
This commit is contained in:
parent
8a3c84b649
commit
9b8523423b
30
fs/super.c
30
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
|
||||
|
@ -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_)
|
||||
|
Loading…
Reference in New Issue
Block a user