Skip to content

Commit 1a33850

Browse files
xuyang0410dchinner
authored andcommitted
xfs: improve __xfs_set_acl
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>
1 parent ce522ba commit 1a33850

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

fs/xfs/xfs_acl.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ extern int xfs_set_acl(struct user_namespace *mnt_userns, struct inode *inode,
1616
extern int __xfs_set_acl(struct inode *inode, struct posix_acl *acl, int type);
1717
void xfs_forget_acl(struct inode *inode, const char *name);
1818
#else
19-
static inline struct posix_acl *xfs_get_acl(struct inode *inode, int type, bool rcu)
19+
#define xfs_get_acl NULL
20+
#define xfs_set_acl NULL
21+
static inline int __xfs_set_acl(struct inode *inode, struct posix_acl *acl,
22+
int type)
2023
{
21-
return NULL;
24+
return 0;
2225
}
23-
# define xfs_set_acl NULL
2426
static inline void xfs_forget_acl(struct inode *inode, const char *name)
2527
{
2628
}

fs/xfs/xfs_iops.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ xfs_generic_create(
209209
if (unlikely(error))
210210
goto out_cleanup_inode;
211211

212-
#ifdef CONFIG_XFS_POSIX_ACL
213212
if (default_acl) {
214213
error = __xfs_set_acl(inode, default_acl, ACL_TYPE_DEFAULT);
215214
if (error)
@@ -220,7 +219,6 @@ xfs_generic_create(
220219
if (error)
221220
goto out_cleanup_inode;
222221
}
223-
#endif
224222

225223
xfs_setup_iops(ip);
226224

0 commit comments

Comments
 (0)