diff options
author | Andy Adamson <andros@netapp.com> | 2011-07-30 20:52:35 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-07-31 12:18:15 -0400 |
commit | 7f11d8d38d64739e190581e015a2a2730ff54e2a (patch) | |
tree | 449178cb7ef4e4675cab239400f6b4e43ac83980 /fs/nfs/nfs4proc.c | |
parent | 3557c6c3be5b2ca0b11365db7f8a813253eb520b (diff) |
pnfs: GETDEVICELIST
The block driver uses GETDEVICELIST
Signed-off-by: Andy Adamson <andros@netapp.com>
[pass struct nfs_server * to getdevicelist]
[get machince creds for getdevicelist]
[fix getdevicelist decode sizing]
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Benny Halevy <bhalevy@tonian.com>
Signed-off-by: Jim Rees <rees@umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index efa6ae822ca8..af32d3df0544 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -5834,6 +5834,54 @@ int nfs4_proc_layoutreturn(struct nfs4_layoutreturn *lrp) | |||
5834 | return status; | 5834 | return status; |
5835 | } | 5835 | } |
5836 | 5836 | ||
5837 | /* | ||
5838 | * Retrieve the list of Data Server devices from the MDS. | ||
5839 | */ | ||
5840 | static int _nfs4_getdevicelist(struct nfs_server *server, | ||
5841 | const struct nfs_fh *fh, | ||
5842 | struct pnfs_devicelist *devlist) | ||
5843 | { | ||
5844 | struct nfs4_getdevicelist_args args = { | ||
5845 | .fh = fh, | ||
5846 | .layoutclass = server->pnfs_curr_ld->id, | ||
5847 | }; | ||
5848 | struct nfs4_getdevicelist_res res = { | ||
5849 | .devlist = devlist, | ||
5850 | }; | ||
5851 | struct rpc_message msg = { | ||
5852 | .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_GETDEVICELIST], | ||
5853 | .rpc_argp = &args, | ||
5854 | .rpc_resp = &res, | ||
5855 | }; | ||
5856 | int status; | ||
5857 | |||
5858 | dprintk("--> %s\n", __func__); | ||
5859 | status = nfs4_call_sync(server->client, server, &msg, &args.seq_args, | ||
5860 | &res.seq_res, 0); | ||
5861 | dprintk("<-- %s status=%d\n", __func__, status); | ||
5862 | return status; | ||
5863 | } | ||
5864 | |||
5865 | int nfs4_proc_getdevicelist(struct nfs_server *server, | ||
5866 | const struct nfs_fh *fh, | ||
5867 | struct pnfs_devicelist *devlist) | ||
5868 | { | ||
5869 | struct nfs4_exception exception = { }; | ||
5870 | int err; | ||
5871 | |||
5872 | do { | ||
5873 | err = nfs4_handle_exception(server, | ||
5874 | _nfs4_getdevicelist(server, fh, devlist), | ||
5875 | &exception); | ||
5876 | } while (exception.retry); | ||
5877 | |||
5878 | dprintk("%s: err=%d, num_devs=%u\n", __func__, | ||
5879 | err, devlist->num_devs); | ||
5880 | |||
5881 | return err; | ||
5882 | } | ||
5883 | EXPORT_SYMBOL_GPL(nfs4_proc_getdevicelist); | ||
5884 | |||
5837 | static int | 5885 | static int |
5838 | _nfs4_proc_getdeviceinfo(struct nfs_server *server, struct pnfs_device *pdev) | 5886 | _nfs4_proc_getdeviceinfo(struct nfs_server *server, struct pnfs_device *pdev) |
5839 | { | 5887 | { |