mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 22:51:42 +00:00
f2fs: introduce get_dirty_dents for readability
The get_dirty_dents gives us the number of dirty dentry pages. Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
This commit is contained in:
parent
04c0938844
commit
f8b2c1f940
@ -619,7 +619,7 @@ void remove_dirty_dir_inode(struct inode *inode)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
spin_lock(&sbi->dir_inode_lock);
|
spin_lock(&sbi->dir_inode_lock);
|
||||||
if (atomic_read(&F2FS_I(inode)->dirty_dents)) {
|
if (get_dirty_dents(inode)) {
|
||||||
spin_unlock(&sbi->dir_inode_lock);
|
spin_unlock(&sbi->dir_inode_lock);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -704,6 +704,11 @@ static inline int get_pages(struct f2fs_sb_info *sbi, int count_type)
|
|||||||
return atomic_read(&sbi->nr_pages[count_type]);
|
return atomic_read(&sbi->nr_pages[count_type]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int get_dirty_dents(struct inode *inode)
|
||||||
|
{
|
||||||
|
return atomic_read(&F2FS_I(inode)->dirty_dents);
|
||||||
|
}
|
||||||
|
|
||||||
static inline int get_blocktype_secs(struct f2fs_sb_info *sbi, int block_type)
|
static inline int get_blocktype_secs(struct f2fs_sb_info *sbi, int block_type)
|
||||||
{
|
{
|
||||||
unsigned int pages_per_sec = sbi->segs_per_sec *
|
unsigned int pages_per_sec = sbi->segs_per_sec *
|
||||||
|
@ -273,7 +273,7 @@ void f2fs_evict_inode(struct inode *inode)
|
|||||||
inode->i_ino == F2FS_META_INO(sbi))
|
inode->i_ino == F2FS_META_INO(sbi))
|
||||||
goto no_delete;
|
goto no_delete;
|
||||||
|
|
||||||
f2fs_bug_on(atomic_read(&F2FS_I(inode)->dirty_dents));
|
f2fs_bug_on(get_dirty_dents(inode));
|
||||||
remove_dirty_dir_inode(inode);
|
remove_dirty_dir_inode(inode);
|
||||||
|
|
||||||
if (inode->i_nlink || is_bad_inode(inode))
|
if (inode->i_nlink || is_bad_inode(inode))
|
||||||
|
Loading…
Reference in New Issue
Block a user