~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/fs/nfs/nfs3client.c

Version: ~ [ linux-5.4 ] ~ [ linux-5.3.13 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.86 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.156 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.203 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.202 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.78 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #include <linux/nfs_fs.h>
  2 #include <linux/nfs_mount.h>
  3 #include "internal.h"
  4 
  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,
  9 };
 10 
 11 const struct rpc_program nfsacl_program = {
 12         .name                   = "nfsacl",
 13         .number                 = NFS_ACL_PROGRAM,
 14         .nrvers                 = ARRAY_SIZE(nfsacl_version),
 15         .version                = nfsacl_version,
 16         .stats                  = &nfsacl_rpcstat,
 17 };
 18 
 19 /*
 20  * Initialise an NFSv3 ACL client connection
 21  */
 22 static void nfs_init_server_aclclient(struct nfs_server *server)
 23 {
 24         if (server->flags & NFS_MOUNT_NOACL)
 25                 goto out_noacl;
 26 
 27         server->client_acl = rpc_bind_new_program(server->client, &nfsacl_program, 3);
 28         if (IS_ERR(server->client_acl))
 29                 goto out_noacl;
 30 
 31         /* No errors! Assume that Sun nfsacls are supported */
 32         server->caps |= NFS_CAP_ACLS;
 33         return;
 34 
 35 out_noacl:
 36         server->caps &= ~NFS_CAP_ACLS;
 37 }
 38 #else
 39 static inline void nfs_init_server_aclclient(struct nfs_server *server)
 40 {
 41         server->flags &= ~NFS_MOUNT_NOACL;
 42         server->caps &= ~NFS_CAP_ACLS;
 43 }
 44 #endif
 45 
 46 struct nfs_server *nfs3_create_server(struct nfs_mount_info *mount_info,
 47                                       struct nfs_subversion *nfs_mod)
 48 {
 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 */
 51         if (!IS_ERR(server))
 52                 nfs_init_server_aclclient(server);
 53         return server;
 54 }
 55 
 56 struct nfs_server *nfs3_clone_server(struct nfs_server *source,
 57                                      struct nfs_fh *fh,
 58                                      struct nfs_fattr *fattr,
 59                                      rpc_authflavor_t flavor)
 60 {
 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);
 64         return server;
 65 }
 66 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp