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>
This commit is contained in:
Trond Myklebust
2022-02-23 15:43:26 -05:00
parent f1ec501d08
commit 84631f84ac
3 changed files with 18 additions and 12 deletions

View File

@@ -1392,13 +1392,8 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry,
case NFS4_OPEN_CLAIM_FH:
p->o_arg.access = NFS4_ACCESS_READ | NFS4_ACCESS_MODIFY |
NFS4_ACCESS_EXTEND | NFS4_ACCESS_DELETE |
NFS4_ACCESS_EXECUTE;
#ifdef CONFIG_NFS_V4_2
if (!(server->caps & NFS_CAP_XATTR))
break;
p->o_arg.access |= NFS4_ACCESS_XAREAD | NFS4_ACCESS_XAWRITE |
NFS4_ACCESS_XALIST;
#endif
NFS4_ACCESS_EXECUTE |
nfs_access_xattr_mask(server);
}
p->o_arg.clientid = server->nfs_client->cl_clientid;
p->o_arg.id.create_time = ktime_to_ns(sp->so_seqid.create_time);