Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[cascardo/linux.git] / fs / f2fs / acl.c
index 3134424..6fe23af 100644 (file)
@@ -109,14 +109,16 @@ fail:
        return ERR_PTR(-EINVAL);
 }
 
-static void *f2fs_acl_to_disk(const struct posix_acl *acl, size_t *size)
+static void *f2fs_acl_to_disk(struct f2fs_sb_info *sbi,
+                               const struct posix_acl *acl, size_t *size)
 {
        struct f2fs_acl_header *f2fs_acl;
        struct f2fs_acl_entry *entry;
        int i;
 
-       f2fs_acl = f2fs_kmalloc(sizeof(struct f2fs_acl_header) + acl->a_count *
-                       sizeof(struct f2fs_acl_entry), GFP_NOFS);
+       f2fs_acl = f2fs_kmalloc(sbi, sizeof(struct f2fs_acl_header) +
+                       acl->a_count * sizeof(struct f2fs_acl_entry),
+                       GFP_NOFS);
        if (!f2fs_acl)
                return ERR_PTR(-ENOMEM);
 
@@ -175,7 +177,7 @@ static struct posix_acl *__f2fs_get_acl(struct inode *inode, int type,
 
        retval = f2fs_getxattr(inode, name_index, "", NULL, 0, dpage);
        if (retval > 0) {
-               value = f2fs_kmalloc(retval, GFP_F2FS_ZERO);
+               value = f2fs_kmalloc(F2FS_I_SB(inode), retval, GFP_F2FS_ZERO);
                if (!value)
                        return ERR_PTR(-ENOMEM);
                retval = f2fs_getxattr(inode, name_index, "", value,
@@ -228,7 +230,7 @@ static int __f2fs_set_acl(struct inode *inode, int type,
        }
 
        if (acl) {
-               value = f2fs_acl_to_disk(acl, &size);
+               value = f2fs_acl_to_disk(F2FS_I_SB(inode), acl, &size);
                if (IS_ERR(value)) {
                        clear_inode_flag(inode, FI_ACL_MODE);
                        return (int)PTR_ERR(value);