xfs: improve __xfs_set_acl
authorYang Xu <xuyang2018.jy@fujitsu.com>
Tue, 26 Apr 2022 03:34:42 +0000 (13:34 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 26 Apr 2022 03:34:42 +0000 (13:34 +1000)
Provide a proper stub for the !CONFIG_XFS_POSIX_ACL case.

Also use a easy way for xfs_get_acl stub.

Suggested-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/xfs_acl.h
fs/xfs/xfs_iops.c

index bb6abdc..263404d 100644 (file)
@@ -16,11 +16,13 @@ extern int xfs_set_acl(struct user_namespace *mnt_userns, struct inode *inode,
 extern int __xfs_set_acl(struct inode *inode, struct posix_acl *acl, int type);
 void xfs_forget_acl(struct inode *inode, const char *name);
 #else
-static inline struct posix_acl *xfs_get_acl(struct inode *inode, int type, bool rcu)
+#define xfs_get_acl NULL
+#define xfs_set_acl NULL
+static inline int __xfs_set_acl(struct inode *inode, struct posix_acl *acl,
+                               int type)
 {
-       return NULL;
+       return 0;
 }
-# define xfs_set_acl                                   NULL
 static inline void xfs_forget_acl(struct inode *inode, const char *name)
 {
 }
index b34e8e4..94313b7 100644 (file)
@@ -209,7 +209,6 @@ xfs_generic_create(
        if (unlikely(error))
                goto out_cleanup_inode;
 
-#ifdef CONFIG_XFS_POSIX_ACL
        if (default_acl) {
                error = __xfs_set_acl(inode, default_acl, ACL_TYPE_DEFAULT);
                if (error)
@@ -220,7 +219,6 @@ xfs_generic_create(
                if (error)
                        goto out_cleanup_inode;
        }
-#endif
 
        xfs_setup_iops(ip);