1 #include <linux/nfs_fs.h>
2 #include <linux/nfs_mount.h>
5 #ifdef CONFIG_NFS_V3_ACL
6 static struct rpc_stat nfsacl_rpcstat
= { &nfsacl_program
};
7 static const struct rpc_version
*nfsacl_version
[] = {
8 [3] = &nfsacl_version3
,
11 const struct rpc_program nfsacl_program
= {
13 .number
= NFS_ACL_PROGRAM
,
14 .nrvers
= ARRAY_SIZE(nfsacl_version
),
15 .version
= nfsacl_version
,
16 .stats
= &nfsacl_rpcstat
,
20 * Initialise an NFSv3 ACL client connection
22 static void nfs_init_server_aclclient(struct nfs_server
*server
)
24 if (server
->flags
& NFS_MOUNT_NOACL
)
27 server
->client_acl
= rpc_bind_new_program(server
->client
, &nfsacl_program
, 3);
28 if (IS_ERR(server
->client_acl
))
31 /* No errors! Assume that Sun nfsacls are supported */
32 server
->caps
|= NFS_CAP_ACLS
;
36 server
->caps
&= ~NFS_CAP_ACLS
;
39 static inline void nfs_init_server_aclclient(struct nfs_server
*server
)
41 server
->flags
&= ~NFS_MOUNT_NOACL
;
42 server
->caps
&= ~NFS_CAP_ACLS
;
46 struct nfs_server
*nfs3_create_server(struct nfs_mount_info
*mount_info
,
47 struct nfs_subversion
*nfs_mod
)
49 struct nfs_server
*server
= nfs_create_server(mount_info
, nfs_mod
);
50 /* Create a client RPC handle for the NFS v3 ACL management interface */
52 nfs_init_server_aclclient(server
);
56 struct nfs_server
*nfs3_clone_server(struct nfs_server
*source
,
58 struct nfs_fattr
*fattr
,
59 rpc_authflavor_t flavor
)
61 struct nfs_server
*server
= nfs_clone_server(source
, fh
, fattr
, flavor
);
62 if (!IS_ERR(server
) && !IS_ERR(source
->client_acl
))
63 nfs_init_server_aclclient(server
);