public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Yang Xu <xuyang2018.jy@fujitsu.com>
Cc: linux-xfs@vger.kernel.org, brauner@kernel.org
Subject: Re: [PATCH] xfs: improve __xfs_set_acl
Date: Mon, 25 Apr 2022 09:34:10 -0700	[thread overview]
Message-ID: <20220425163410.GL17025@magnolia> (raw)
In-Reply-To: <1650531290-3262-1-git-send-email-xuyang2018.jy@fujitsu.com>

On Thu, Apr 21, 2022 at 04:54:50PM +0800, Yang Xu wrote:
> 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>

Seems reasonable to me.
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  fs/xfs/xfs_acl.h  | 8 +++++---
>  fs/xfs/xfs_iops.c | 2 --
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/xfs/xfs_acl.h b/fs/xfs/xfs_acl.h
> index bb6abdcb265d..263404d0bfda 100644
> --- a/fs/xfs/xfs_acl.h
> +++ b/fs/xfs/xfs_acl.h
> @@ -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)
>  {
>  }
> diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
> index b34e8e4344a8..94313b7e9991 100644
> --- a/fs/xfs/xfs_iops.c
> +++ b/fs/xfs/xfs_iops.c
> @@ -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);
>  
> -- 
> 2.27.0
> 

      parent reply	other threads:[~2022-04-25 16:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21  8:54 [PATCH] xfs: improve __xfs_set_acl Yang Xu
2022-04-24  5:28 ` Christoph Hellwig
2022-04-25  9:48 ` Christian Brauner
2022-04-25 16:34 ` Darrick J. Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220425163410.GL17025@magnolia \
    --to=djwong@kernel.org \
    --cc=brauner@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=xuyang2018.jy@fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox