diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2014-03-20 06:10:08 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2014-03-20 09:10:11 -0400 |
commit | d928bfbfe77aa457b765c19e9db8cd4cc72b3c89 (patch) | |
tree | f56763175e0fbee1e2079c9a330f3d73f971bc5c /fs/f2fs/xattr.c | |
parent | 58c410351eba3d24f741c85a0eb9eaf15c94047d (diff) |
f2fs: introduce fi->i_sem to protect fi's info
This patch introduces fi->i_sem to protect fi's info that includes xattr_ver,
pino, i_nlink.
This enables to remove i_mutex during f2fs_sync_file, resulting in performance
improvement when a number of fsync calls are triggered from many concurrent
threads.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/xattr.c')
-rw-r--r-- | fs/f2fs/xattr.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c index 89d0422a91a8..84191307a670 100644 --- a/fs/f2fs/xattr.c +++ b/fs/f2fs/xattr.c | |||
@@ -590,7 +590,10 @@ int f2fs_setxattr(struct inode *inode, int name_index, const char *name, | |||
590 | f2fs_balance_fs(sbi); | 590 | f2fs_balance_fs(sbi); |
591 | 591 | ||
592 | f2fs_lock_op(sbi); | 592 | f2fs_lock_op(sbi); |
593 | /* protect xattr_ver */ | ||
594 | down_write(&F2FS_I(inode)->i_sem); | ||
593 | err = __f2fs_setxattr(inode, name_index, name, value, value_len, ipage); | 595 | err = __f2fs_setxattr(inode, name_index, name, value, value_len, ipage); |
596 | up_write(&F2FS_I(inode)->i_sem); | ||
594 | f2fs_unlock_op(sbi); | 597 | f2fs_unlock_op(sbi); |
595 | 598 | ||
596 | return err; | 599 | return err; |