summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/file.c
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2015-12-15 17:19:26 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2015-12-16 08:58:06 -0800
commite8240f656d4d5d718ce8cf6b4ea266d6719ef547 (patch)
tree549a1fef4054135862d7ee7dd26ef74af0f173f7 /fs/f2fs/file.c
parentb39f0de23d8f22253d441b3b68414e9a1d027cf6 (diff)
downloadlinux-e8240f656d4d5d718ce8cf6b4ea266d6719ef547.tar.gz
linux-e8240f656d4d5d718ce8cf6b4ea266d6719ef547.tar.bz2
linux-e8240f656d4d5d718ce8cf6b4ea266d6719ef547.zip
f2fs: don't grab super block buffer header all the time
We have already got one copy of valid super block in memory, do not grab buffer header of super block all the time. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r--fs/f2fs/file.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 1f5892f38018..7f8ca47be0af 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -1591,20 +1591,16 @@ static int f2fs_ioc_get_encryption_pwsalt(struct file *filp, unsigned long arg)
return err;
/* update superblock with uuid */
- lock_buffer(sbi->raw_super_buf);
generate_random_uuid(sbi->raw_super->encrypt_pw_salt);
- unlock_buffer(sbi->raw_super_buf);
err = f2fs_commit_super(sbi, false);
-
- mnt_drop_write_file(filp);
if (err) {
/* undo new data */
- lock_buffer(sbi->raw_super_buf);
memset(sbi->raw_super->encrypt_pw_salt, 0, 16);
- unlock_buffer(sbi->raw_super_buf);
+ mnt_drop_write_file(filp);
return err;
}
+ mnt_drop_write_file(filp);
got_it:
if (copy_to_user((__u8 __user *)arg, sbi->raw_super->encrypt_pw_salt,
16))