f2fs: move i_size_write in f2fs_write_end
[deliverable/linux.git] / fs / f2fs / acl.c
index 6f1fdda977b396839d7804fc4fcdb4a948895b53..6a414e75e705b9c5b597a8bc4035cd22b62a71fd 100644 (file)
@@ -115,7 +115,7 @@ static void *f2fs_acl_to_disk(const struct posix_acl *acl, size_t *size)
        struct f2fs_acl_entry *entry;
        int i;
 
-       f2fs_acl = kmalloc(sizeof(struct f2fs_acl_header) + acl->a_count *
+       f2fs_acl = f2fs_kmalloc(sizeof(struct f2fs_acl_header) + acl->a_count *
                        sizeof(struct f2fs_acl_entry), GFP_NOFS);
        if (!f2fs_acl)
                return ERR_PTR(-ENOMEM);
@@ -175,7 +175,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 = kmalloc(retval, GFP_F2FS_ZERO);
+               value = f2fs_kmalloc(retval, GFP_F2FS_ZERO);
                if (!value)
                        return ERR_PTR(-ENOMEM);
                retval = f2fs_getxattr(inode, name_index, "", value,
@@ -201,7 +201,6 @@ struct posix_acl *f2fs_get_acl(struct inode *inode, int type)
 static int __f2fs_set_acl(struct inode *inode, int type,
                        struct posix_acl *acl, struct page *ipage)
 {
-       struct f2fs_inode_info *fi = F2FS_I(inode);
        int name_index;
        void *value = NULL;
        size_t size = 0;
@@ -214,7 +213,7 @@ static int __f2fs_set_acl(struct inode *inode, int type,
                        error = posix_acl_equiv_mode(acl, &inode->i_mode);
                        if (error < 0)
                                return error;
-                       set_acl_inode(fi, inode->i_mode);
+                       set_acl_inode(inode, inode->i_mode);
                        if (error == 0)
                                acl = NULL;
                }
@@ -233,7 +232,7 @@ static int __f2fs_set_acl(struct inode *inode, int type,
        if (acl) {
                value = f2fs_acl_to_disk(acl, &size);
                if (IS_ERR(value)) {
-                       clear_inode_flag(fi, FI_ACL_MODE);
+                       clear_inode_flag(inode, FI_ACL_MODE);
                        return (int)PTR_ERR(value);
                }
        }
@@ -244,7 +243,7 @@ static int __f2fs_set_acl(struct inode *inode, int type,
        if (!error)
                set_cached_acl(inode, type, acl);
 
-       clear_inode_flag(fi, FI_ACL_MODE);
+       clear_inode_flag(inode, FI_ACL_MODE);
        return error;
 }
 
@@ -385,6 +384,8 @@ int f2fs_init_acl(struct inode *inode, struct inode *dir, struct page *ipage,
        if (error)
                return error;
 
+       mark_inode_dirty_sync(inode);
+
        if (default_acl) {
                error = __f2fs_set_acl(inode, ACL_TYPE_DEFAULT, default_acl,
                                       ipage);
This page took 0.026846 seconds and 5 git commands to generate.