diff options
author | Bryan Schumaker <bjschuma@netapp.com> | 2011-03-24 13:12:29 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-03-24 13:52:41 -0400 |
commit | 5a5ea0d485c9715c86bf858bbdc5f6d373b3db88 (patch) | |
tree | 0aef824c36b7eb6eac6ea706c4c9a33930128ee3 /fs/nfs/nfs4proc.c | |
parent | 7c5130588d691a3b34d02312f1bd1b6d56fe0100 (diff) |
NFS: Add secinfo procedure
This patch adds the nfs4 operation secinfo as a
valid nfs rpc operation.
Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 448657456b68..0b8bae119976 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -4639,6 +4639,40 @@ int nfs4_proc_fs_locations(struct inode *dir, const struct qstr *name, | |||
4639 | return status; | 4639 | return status; |
4640 | } | 4640 | } |
4641 | 4641 | ||
4642 | static int _nfs4_proc_secinfo(struct inode *dir, const struct qstr *name, struct nfs4_secinfo_flavors *flavors) | ||
4643 | { | ||
4644 | int status; | ||
4645 | struct nfs4_secinfo_arg args = { | ||
4646 | .dir_fh = NFS_FH(dir), | ||
4647 | .name = name, | ||
4648 | }; | ||
4649 | struct nfs4_secinfo_res res = { | ||
4650 | .flavors = flavors, | ||
4651 | }; | ||
4652 | struct rpc_message msg = { | ||
4653 | .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_SECINFO], | ||
4654 | .rpc_argp = &args, | ||
4655 | .rpc_resp = &res, | ||
4656 | }; | ||
4657 | |||
4658 | dprintk("NFS call secinfo %s\n", name->name); | ||
4659 | status = nfs4_call_sync(NFS_SERVER(dir)->client, NFS_SERVER(dir), &msg, &args.seq_args, &res.seq_res, 0); | ||
4660 | dprintk("NFS reply secinfo: %d\n", status); | ||
4661 | return status; | ||
4662 | } | ||
4663 | |||
4664 | int nfs4_proc_secinfo(struct inode *dir, const struct qstr *name, struct nfs4_secinfo_flavors *flavors) | ||
4665 | { | ||
4666 | struct nfs4_exception exception = { }; | ||
4667 | int err; | ||
4668 | do { | ||
4669 | err = nfs4_handle_exception(NFS_SERVER(dir), | ||
4670 | _nfs4_proc_secinfo(dir, name, flavors), | ||
4671 | &exception); | ||
4672 | } while (exception.retry); | ||
4673 | return err; | ||
4674 | } | ||
4675 | |||
4642 | #ifdef CONFIG_NFS_V4_1 | 4676 | #ifdef CONFIG_NFS_V4_1 |
4643 | /* | 4677 | /* |
4644 | * Check the exchange flags returned by the server for invalid flags, having | 4678 | * Check the exchange flags returned by the server for invalid flags, having |
@@ -5756,6 +5790,7 @@ const struct nfs_rpc_ops nfs_v4_clientops = { | |||
5756 | .close_context = nfs4_close_context, | 5790 | .close_context = nfs4_close_context, |
5757 | .open_context = nfs4_atomic_open, | 5791 | .open_context = nfs4_atomic_open, |
5758 | .init_client = nfs4_init_client, | 5792 | .init_client = nfs4_init_client, |
5793 | .secinfo = nfs4_proc_secinfo, | ||
5759 | }; | 5794 | }; |
5760 | 5795 | ||
5761 | static const struct xattr_handler nfs4_xattr_nfs4_acl_handler = { | 5796 | static const struct xattr_handler nfs4_xattr_nfs4_acl_handler = { |