mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-03-18 04:54:52 +00:00
fs: add a lockdep check function for sb_start_write()
Add a function sb_write_started() to allow callers to verify if sb_start_write() is properly called. It will be used for assertion in btrfs. Reviewed-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
d864546231
commit
7f8d12ea96
1 changed files with 5 additions and 0 deletions
|
@ -1708,6 +1708,11 @@ static inline bool __sb_start_write_trylock(struct super_block *sb, int level)
|
|||
#define __sb_writers_release(sb, lev) \
|
||||
percpu_rwsem_release(&(sb)->s_writers.rw_sem[(lev)-1], 1, _THIS_IP_)
|
||||
|
||||
static inline bool sb_write_started(const struct super_block *sb)
|
||||
{
|
||||
return lockdep_is_held_type(sb->s_writers.rw_sem + SB_FREEZE_WRITE - 1, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* sb_end_write - drop write access to a superblock
|
||||
* @sb: the super we wrote to
|
||||
|
|
Loading…
Add table
Reference in a new issue