diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-05-20 09:43:20 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-06-02 18:05:10 -0700 |
commit | a1961246c392dbf7dabdc81b4e074c32053fbf61 (patch) | |
tree | 452d915dba0d3dffdaeeb207c59edea09228d922 /fs/f2fs/dir.c | |
parent | 8edd03c870e4eb8d635d507a7d83fe35d76117c2 (diff) | |
download | linux-stable-a1961246c392dbf7dabdc81b4e074c32053fbf61.tar.gz linux-stable-a1961246c392dbf7dabdc81b4e074c32053fbf61.tar.bz2 linux-stable-a1961246c392dbf7dabdc81b4e074c32053fbf61.zip |
f2fs: introduce f2fs_i_links_write with mark_inode_dirty_sync
This patch introduces f2fs_i_links_write() to call mark_inode_dirty_sync() when
changing inode->i_links.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/dir.c')
-rw-r--r-- | fs/f2fs/dir.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index dc4beae14c92..f8ca0f31271f 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c @@ -437,7 +437,7 @@ struct page *init_inode_metadata(struct inode *inode, struct inode *dir, */ if (inode->i_nlink == 0) remove_orphan_inode(F2FS_I_SB(dir), inode->i_ino); - inc_nlink(inode); + f2fs_i_links_write(inode, true); } return page; @@ -456,7 +456,7 @@ void update_parent_metadata(struct inode *dir, struct inode *inode, { if (inode && is_inode_flag_set(inode, FI_NEW_INODE)) { if (S_ISDIR(inode->i_mode)) { - inc_nlink(dir); + f2fs_i_links_write(dir, true); set_inode_flag(dir, FI_UPDATE_DIR); } clear_inode_flag(inode, FI_NEW_INODE); @@ -675,7 +675,7 @@ void f2fs_drop_nlink(struct inode *dir, struct inode *inode, struct page *page) down_write(&F2FS_I(inode)->i_sem); if (S_ISDIR(inode->i_mode)) { - drop_nlink(dir); + f2fs_i_links_write(dir, false); if (page) update_inode(dir, page); else @@ -683,9 +683,9 @@ void f2fs_drop_nlink(struct inode *dir, struct inode *inode, struct page *page) } inode->i_ctime = CURRENT_TIME; - drop_nlink(inode); + f2fs_i_links_write(inode, false); if (S_ISDIR(inode->i_mode)) { - drop_nlink(inode); + f2fs_i_links_write(inode, false); f2fs_i_size_write(inode, 0); } up_write(&F2FS_I(inode)->i_sem); |