f2fs: expose extension_list sysfs entry

This patch adds a sysfs entry 'extension_list' to support
query/add/del item in extension list.

Query:
cat /sys/fs/f2fs/<device>/extension_list

Add:
echo 'extension' > /sys/fs/f2fs/<device>/extension_list

Del:
echo '!extension' > /sys/fs/f2fs/<device>/extension_list

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
Chao Yu
2018-02-26 22:04:13 +08:00
committed by Jaegeuk Kim
parent 17cd07ae95
commit 846ae671ad
7 changed files with 96 additions and 8 deletions

View File

@@ -1970,7 +1970,7 @@ static int f2fs_ioc_get_encryption_pwsalt(struct file *filp, unsigned long arg)
if (err)
return err;
mutex_lock(&sbi->sb_lock);
down_write(&sbi->sb_lock);
if (uuid_is_nonzero(sbi->raw_super->encrypt_pw_salt))
goto got_it;
@@ -1989,7 +1989,7 @@ got_it:
16))
err = -EFAULT;
out_err:
mutex_unlock(&sbi->sb_lock);
up_write(&sbi->sb_lock);
mnt_drop_write_file(filp);
return err;
}