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>
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 9536e9e..d98aaf3 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1557,6 +1557,15 @@
set_inode_flag(inode, FI_ACL_MODE);
}
+static inline void f2fs_i_links_write(struct inode *inode, bool inc)
+{
+ if (inc)
+ inc_nlink(inode);
+ else
+ drop_nlink(inode);
+ mark_inode_dirty_sync(inode);
+}
+
static inline void f2fs_i_blocks_write(struct inode *inode,
blkcnt_t diff, bool add)
{