aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/acl.c
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2016-09-23 09:30:09 -0400
committerJaegeuk Kim <jaegeuk@kernel.org>2016-09-30 20:34:31 -0400
commit1ecc0c5c50ce8834f7e35b63be7480bf1aaa4155 (patch)
treeab29e8f69b8e2a40064fe7f8f81bea86d7f4a3a7 /fs/f2fs/acl.c
parentd32853de5080e7f0c2962de0058ea71d1e244f76 (diff)
f2fs: support configuring fault injection per superblock
Previously, we only support global fault injection configuration, so that when we configure type/rate of fault injection through sysfs, mount option, it will influence all f2fs partition which is being used. It is not make sence, since it will be not convenient if developer want to test separated partitions with different fault injection rate/type simultaneously, also it's not possible to enable fault injection in one partition and disable fault injection in other one. >From now on, we move global configuration of fault injection in module into per-superblock, hence injection testing can be more flexible. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/acl.c')
-rw-r--r--fs/f2fs/acl.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/f2fs/acl.c b/fs/f2fs/acl.c
index 4dcc9e28dc5c..1e29630f49c1 100644
--- a/fs/f2fs/acl.c
+++ b/fs/f2fs/acl.c
@@ -109,14 +109,16 @@ fail:
109 return ERR_PTR(-EINVAL); 109 return ERR_PTR(-EINVAL);
110} 110}
111 111
112static void *f2fs_acl_to_disk(const struct posix_acl *acl, size_t *size) 112static void *f2fs_acl_to_disk(struct f2fs_sb_info *sbi,
113 const struct posix_acl *acl, size_t *size)
113{ 114{
114 struct f2fs_acl_header *f2fs_acl; 115 struct f2fs_acl_header *f2fs_acl;
115 struct f2fs_acl_entry *entry; 116 struct f2fs_acl_entry *entry;
116 int i; 117 int i;
117 118
118 f2fs_acl = f2fs_kmalloc(sizeof(struct f2fs_acl_header) + acl->a_count * 119 f2fs_acl = f2fs_kmalloc(sbi, sizeof(struct f2fs_acl_header) +
119 sizeof(struct f2fs_acl_entry), GFP_NOFS); 120 acl->a_count * sizeof(struct f2fs_acl_entry),
121 GFP_NOFS);
120 if (!f2fs_acl) 122 if (!f2fs_acl)
121 return ERR_PTR(-ENOMEM); 123 return ERR_PTR(-ENOMEM);
122 124
@@ -175,7 +177,7 @@ static struct posix_acl *__f2fs_get_acl(struct inode *inode, int type,
175 177
176 retval = f2fs_getxattr(inode, name_index, "", NULL, 0, dpage); 178 retval = f2fs_getxattr(inode, name_index, "", NULL, 0, dpage);
177 if (retval > 0) { 179 if (retval > 0) {
178 value = f2fs_kmalloc(retval, GFP_F2FS_ZERO); 180 value = f2fs_kmalloc(F2FS_I_SB(inode), retval, GFP_F2FS_ZERO);
179 if (!value) 181 if (!value)
180 return ERR_PTR(-ENOMEM); 182 return ERR_PTR(-ENOMEM);
181 retval = f2fs_getxattr(inode, name_index, "", value, 183 retval = f2fs_getxattr(inode, name_index, "", value,
@@ -230,7 +232,7 @@ static int __f2fs_set_acl(struct inode *inode, int type,
230 } 232 }
231 233
232 if (acl) { 234 if (acl) {
233 value = f2fs_acl_to_disk(acl, &size); 235 value = f2fs_acl_to_disk(F2FS_I_SB(inode), acl, &size);
234 if (IS_ERR(value)) { 236 if (IS_ERR(value)) {
235 clear_inode_flag(inode, FI_ACL_MODE); 237 clear_inode_flag(inode, FI_ACL_MODE);
236 return (int)PTR_ERR(value); 238 return (int)PTR_ERR(value);