acl.c (692d96552c9a86a919fe6b5b82288a6c77c015a5) | acl.c (3a8861e2715e3b985bfaac43bcdfcfebe9b423cb) |
---|---|
1/* 2 * fs/f2fs/acl.c 3 * 4 * Copyright (c) 2012 Samsung Electronics Co., Ltd. 5 * http://www.samsung.com/ 6 * 7 * Portions of this code from linux/fs/ext2/acl.c 8 * --- 160 unchanged lines hidden (view full) --- 169 struct posix_acl *acl; 170 int retval; 171 172 if (type == ACL_TYPE_ACCESS) 173 name_index = F2FS_XATTR_INDEX_POSIX_ACL_ACCESS; 174 175 retval = f2fs_getxattr(inode, name_index, "", NULL, 0); 176 if (retval > 0) { | 1/* 2 * fs/f2fs/acl.c 3 * 4 * Copyright (c) 2012 Samsung Electronics Co., Ltd. 5 * http://www.samsung.com/ 6 * 7 * Portions of this code from linux/fs/ext2/acl.c 8 * --- 160 unchanged lines hidden (view full) --- 169 struct posix_acl *acl; 170 int retval; 171 172 if (type == ACL_TYPE_ACCESS) 173 name_index = F2FS_XATTR_INDEX_POSIX_ACL_ACCESS; 174 175 retval = f2fs_getxattr(inode, name_index, "", NULL, 0); 176 if (retval > 0) { |
177 value = kmalloc(retval, GFP_KERNEL); | 177 value = kmalloc(retval, GFP_F2FS_ZERO); |
178 if (!value) 179 return ERR_PTR(-ENOMEM); 180 retval = f2fs_getxattr(inode, name_index, "", value, retval); 181 } 182 183 if (retval > 0) 184 acl = f2fs_acl_from_disk(value, retval); 185 else if (retval == -ENODATA) --- 12 unchanged lines hidden (view full) --- 198 struct posix_acl *acl, struct page *ipage) 199{ 200 struct f2fs_inode_info *fi = F2FS_I(inode); 201 int name_index; 202 void *value = NULL; 203 size_t size = 0; 204 int error; 205 | 178 if (!value) 179 return ERR_PTR(-ENOMEM); 180 retval = f2fs_getxattr(inode, name_index, "", value, retval); 181 } 182 183 if (retval > 0) 184 acl = f2fs_acl_from_disk(value, retval); 185 else if (retval == -ENODATA) --- 12 unchanged lines hidden (view full) --- 198 struct posix_acl *acl, struct page *ipage) 199{ 200 struct f2fs_inode_info *fi = F2FS_I(inode); 201 int name_index; 202 void *value = NULL; 203 size_t size = 0; 204 int error; 205 |
206 if (acl) { 207 error = posix_acl_valid(acl); 208 if (error < 0) 209 return error; 210 } 211 |
|
206 switch (type) { 207 case ACL_TYPE_ACCESS: 208 name_index = F2FS_XATTR_INDEX_POSIX_ACL_ACCESS; 209 if (acl) { 210 error = posix_acl_equiv_mode(acl, &inode->i_mode); 211 if (error < 0) 212 return error; 213 set_acl_inode(fi, inode->i_mode); --- 61 unchanged lines hidden --- | 212 switch (type) { 213 case ACL_TYPE_ACCESS: 214 name_index = F2FS_XATTR_INDEX_POSIX_ACL_ACCESS; 215 if (acl) { 216 error = posix_acl_equiv_mode(acl, &inode->i_mode); 217 if (error < 0) 218 return error; 219 set_acl_inode(fi, inode->i_mode); --- 61 unchanged lines hidden --- |