diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-05-20 10:13:22 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-06-02 18:05:07 -0700 |
commit | 91942321e4c9f8460f260cdfcf0a7a48a73a84a4 (patch) | |
tree | 1a5adcd1fd8fc1e236c0e8aa9fb3dc0eb552fbd7 /fs/f2fs/inline.c | |
parent | 1c4bf763039ccdc6dab9e1c3cf84a1cb14c6ff13 (diff) | |
download | linux-91942321e4c9f8460f260cdfcf0a7a48a73a84a4.tar.gz linux-91942321e4c9f8460f260cdfcf0a7a48a73a84a4.tar.bz2 linux-91942321e4c9f8460f260cdfcf0a7a48a73a84a4.zip |
f2fs: use inode pointer for {set, clear}_inode_flag
This patch refactors to use inode pointer for set_inode_flag and
clear_inode_flag.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/inline.c')
-rw-r--r-- | fs/f2fs/inline.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c index a4bb155dd00a..c50dee937c1b 100644 --- a/fs/f2fs/inline.c +++ b/fs/f2fs/inline.c @@ -138,7 +138,7 @@ int f2fs_convert_inline_page(struct dnode_of_data *dn, struct page *page) inode_dec_dirty_pages(dn->inode); /* this converted inline_data should be recovered. */ - set_inode_flag(F2FS_I(dn->inode), FI_APPEND_WRITE); + set_inode_flag(dn->inode, FI_APPEND_WRITE); /* clear inline data and flag after data writeback */ truncate_inline_inode(dn->inode_page, 0); @@ -213,8 +213,8 @@ int f2fs_write_inline_data(struct inode *inode, struct page *page) memcpy(dst_addr, src_addr, MAX_INLINE_DATA); kunmap_atomic(src_addr); - set_inode_flag(F2FS_I(inode), FI_APPEND_WRITE); - set_inode_flag(F2FS_I(inode), FI_DATA_EXIST); + set_inode_flag(inode, FI_APPEND_WRITE); + set_inode_flag(inode, FI_DATA_EXIST); sync_inode_page(&dn); clear_inline_node(dn.inode_page); @@ -252,8 +252,8 @@ process_inline: dst_addr = inline_data_addr(ipage); memcpy(dst_addr, src_addr, MAX_INLINE_DATA); - set_inode_flag(F2FS_I(inode), FI_INLINE_DATA); - set_inode_flag(F2FS_I(inode), FI_DATA_EXIST); + set_inode_flag(inode, FI_INLINE_DATA); + set_inode_flag(inode, FI_DATA_EXIST); update_inode(inode, ipage); f2fs_put_page(ipage, 1); @@ -341,7 +341,7 @@ int make_empty_inline_dir(struct inode *inode, struct inode *parent, /* update i_size to MAX_INLINE_DATA */ if (i_size_read(inode) < MAX_INLINE_DATA) { i_size_write(inode, MAX_INLINE_DATA); - set_inode_flag(F2FS_I(inode), FI_UPDATE_DIR); + set_inode_flag(inode, FI_UPDATE_DIR); } return 0; } @@ -398,12 +398,12 @@ static int f2fs_move_inline_dirents(struct inode *dir, struct page *ipage, truncate_inline_inode(ipage, 0); stat_dec_inline_dir(dir); - clear_inode_flag(F2FS_I(dir), FI_INLINE_DENTRY); + clear_inode_flag(dir, FI_INLINE_DENTRY); F2FS_I(dir)->i_current_depth = 1; if (i_size_read(dir) < PAGE_SIZE) { i_size_write(dir, PAGE_SIZE); - set_inode_flag(F2FS_I(dir), FI_UPDATE_DIR); + set_inode_flag(dir, FI_UPDATE_DIR); } sync_inode_page(&dn); @@ -464,7 +464,6 @@ static int f2fs_move_rehashed_dirents(struct inode *dir, struct page *ipage, struct f2fs_inline_dentry *inline_dentry) { struct f2fs_inline_dentry *backup_dentry; - struct f2fs_inode_info *fi = F2FS_I(dir); int err; backup_dentry = f2fs_kmalloc(sizeof(struct f2fs_inline_dentry), @@ -486,14 +485,14 @@ static int f2fs_move_rehashed_dirents(struct inode *dir, struct page *ipage, lock_page(ipage); stat_dec_inline_dir(dir); - clear_inode_flag(fi, FI_INLINE_DENTRY); + clear_inode_flag(dir, FI_INLINE_DENTRY); update_inode(dir, ipage); kfree(backup_dentry); return 0; recover: lock_page(ipage); memcpy(inline_dentry, backup_dentry, MAX_INLINE_DATA); - fi->i_current_depth = 0; + F2FS_I(dir)->i_current_depth = 0; i_size_write(dir, MAX_INLINE_DATA); update_inode(dir, ipage); f2fs_put_page(ipage, 1); @@ -569,9 +568,9 @@ fail: if (inode) up_write(&F2FS_I(inode)->i_sem); - if (is_inode_flag_set(F2FS_I(dir), FI_UPDATE_DIR)) { + if (is_inode_flag_set(dir, FI_UPDATE_DIR)) { update_inode(dir, ipage); - clear_inode_flag(F2FS_I(dir), FI_UPDATE_DIR); + clear_inode_flag(dir, FI_UPDATE_DIR); } out: f2fs_put_page(ipage, 1); |