diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-31 21:45:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-31 21:45:44 -0400 |
commit | 6dbb35b0a74b44b2a48a5373d48074c5aa69fdf5 (patch) | |
tree | 4afb5eec521659e19c9d2343c2431054a082eb06 /fs/nfs/nfs3client.c | |
parent | fd37ce34bd512f2b1a503f82abf8768da556a955 (diff) | |
parent | ad0fcd4eb68059de02e1766948263c71b8a5b1dc (diff) |
Merge tag 'nfs-for-3.6-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull second wave of NFS client updates from Trond Myklebust:
- Patches from Bryan to allow splitting of the NFSv2/v3/v4 code into
separate modules.
- Fix Oopses in the NFSv4 idmapper
- Fix a deadlock whereby rpciod tries to allocate a new socket and ends
up recursing into the NFS code due to memory reclaim.
- Increase the number of permitted callback connections.
* tag 'nfs-for-3.6-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
nfs: explicitly reject LOCK_MAND flock() requests
nfs: increase number of permitted callback connections.
SUNRPC: return negative value in case rpcbind client creation error
NFS: Convert v4 into a module
NFS: Convert v3 into a module
NFS: Convert v2 into a module
NFS: Keep module parameters in the generic NFS client
NFS: Split out remaining NFS v4 inode functions
NFS: Pass super operations and xattr handlers in the nfs_subversion
NFS: Only initialize the ACL client in the v3 case
NFS: Create a try_mount rpc op
NFS: Remove the NFS v4 xdev mount function
NFS: Add version registering framework
NFS: Fix a number of bugs in the idmapper
nfs: skip commit in releasepage if we're freeing memory for fs-related reasons
sunrpc: clarify comments on rpc_make_runnable
pnfsblock: bail out partial page IO
Diffstat (limited to 'fs/nfs/nfs3client.c')
-rw-r--r-- | fs/nfs/nfs3client.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/fs/nfs/nfs3client.c b/fs/nfs/nfs3client.c new file mode 100644 index 000000000000..b3fc65ef39ca --- /dev/null +++ b/fs/nfs/nfs3client.c | |||
@@ -0,0 +1,65 @@ | |||
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 | } | ||