diff options
author | Trond Myklebust <trond.myklebust@hammerspace.com> | 2022-02-23 23:43:26 +0300 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@hammerspace.com> | 2022-02-26 02:50:13 +0300 |
commit | 84631f84ac95b6ff6f08a41ffba1f93eaab4e9c7 (patch) | |
tree | 1a21d245d9d62bfea52d7159a2ef7bdd65a9c6a4 /fs/nfs/internal.h | |
parent | f1ec501d08b78fd52e56124519e3e6cdecbfc16f (diff) | |
download | linux-84631f84ac95b6ff6f08a41ffba1f93eaab4e9c7.tar.xz |
NFS: Clean up NFSv4.2 xattrs
Add a helper for the xattr mask so that we can get rid of the inlined
ifdefs.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'fs/nfs/internal.h')
-rw-r--r-- | fs/nfs/internal.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 2de7c56a1fbe..b5398af53c7f 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h @@ -388,6 +388,20 @@ int nfs_mknod(struct user_namespace *, struct inode *, struct dentry *, umode_t, int nfs_rename(struct user_namespace *, struct inode *, struct dentry *, struct inode *, struct dentry *, unsigned int); +#ifdef CONFIG_NFS_V4_2 +static inline __u32 nfs_access_xattr_mask(const struct nfs_server *server) +{ + if (!(server->caps & NFS_CAP_XATTR)) + return 0; + return NFS4_ACCESS_XAREAD | NFS4_ACCESS_XAWRITE | NFS4_ACCESS_XALIST; +} +#else +static inline __u32 nfs_access_xattr_mask(const struct nfs_server *server) +{ + return 0; +} +#endif + /* file.c */ int nfs_file_fsync(struct file *file, loff_t start, loff_t end, int datasync); loff_t nfs_file_llseek(struct file *, loff_t, int); |