Add a function to the experimental nfs subsystem that tests to see
if a local file system supports NFSv4 ACLs. This allows the NFSHASNFS4ACL() macro to be correctly implemented. The NFSv4 ACL support should now work when the server exports a ZFS volume. Approved by: kib (mentor)
This commit is contained in:
parent
5df7c0e4ae
commit
c2b3891e90
@ -426,6 +426,28 @@ newnfs_portinit(void)
|
||||
mtx_init(&nfs_state_mutex, "nfs_state_mutex", NULL, MTX_DEF);
|
||||
}
|
||||
|
||||
#ifdef NFS4_ACL_EXTATTR_NAME
|
||||
/*
|
||||
* Determine if the file system supports NFSv4 ACLs.
|
||||
* Return 1 if it does, 0 otherwise.
|
||||
*/
|
||||
int
|
||||
nfs_supportsnfsv4acls(struct mount *mp)
|
||||
{
|
||||
|
||||
if (mp->mnt_stat.f_fstypename == NULL)
|
||||
return (0);
|
||||
if (strcmp(mp->mnt_stat.f_fstypename, "ufs") == 0) {
|
||||
/* Not yet */
|
||||
return (0);
|
||||
} else if (strcmp(mp->mnt_stat.f_fstypename, "zfs") == 0) {
|
||||
/* Always supports them */
|
||||
return (1);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
#endif /* NFS4_ACL_EXTATTR_NAME */
|
||||
|
||||
extern int (*nfsd_call_nfscommon)(struct thread *, struct nfssvc_args *);
|
||||
|
||||
/*
|
||||
|
@ -787,7 +787,8 @@ void newnfs_realign(struct mbuf **);
|
||||
#define NFSSETWRITEVERF(n) ((n)->nm_state |= NFSSTA_HASWRITEVERF)
|
||||
#define NFSSETHASSETFSID(n) ((n)->nm_state |= NFSSTA_HASSETFSID)
|
||||
#ifdef NFS4_ACL_EXTATTR_NAME
|
||||
#define NFSHASNFS4ACL(m) 0
|
||||
#define NFSHASNFS4ACL(m) nfs_supportsnfsv4acls(m)
|
||||
int nfs_supportsnfsv4acls(struct mount *);
|
||||
#else
|
||||
#define NFSHASNFS4ACL(m) 0
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user