diff options
author | Andy Adamson <andros@netapp.com> | 2011-02-28 20:34:16 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-03-11 15:38:42 -0500 |
commit | 64419a9b20938d9070fdd8c58c2fa23c911915f8 (patch) | |
tree | 182c1eaebcfb9b8e02fc75d807b346209757ace1 /fs/nfs/pnfs.c | |
parent | bae724ef95b0d0a1f4518f5451e7c8aabc41f820 (diff) |
NFSv4.1: generic read
Separate the rpc run portion of nfs_read_rpcsetup into a new function
nfs_initiate_read that is called for normal NFS I/O.
Add a pNFS read_pagelist function that is called instead of nfs_intitate_read
for pNFS reads.
Signed-off-by: Andy Adamson <andros@citi.umich.edu>
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Dean Hildebrand <dhildeb@us.ibm.com>
Signed-off-by: Fred Isaman <iisaman@citi.umich.edu>
Signed-off-by: Fred Isaman <iisaman@netapp.com>
Signed-off-by: Mike Sager <sager@netapp.com>
Signed-off-by: Mingyang Guo <guomingyang@nrchpc.ac.cn>
Signed-off-by: Ricardo Labiaga <Ricardo.Labiaga@netapp.com>
Signed-off-by: Tao Guo <guotao@nrchpc.ac.cn>
Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/pnfs.c')
-rw-r--r-- | fs/nfs/pnfs.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 77966ecb0a2c..86c154bad5db 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/nfs_fs.h> | 30 | #include <linux/nfs_fs.h> |
31 | #include "internal.h" | 31 | #include "internal.h" |
32 | #include "pnfs.h" | 32 | #include "pnfs.h" |
33 | #include "iostat.h" | ||
33 | 34 | ||
34 | #define NFSDBG_FACILITY NFSDBG_PNFS | 35 | #define NFSDBG_FACILITY NFSDBG_PNFS |
35 | 36 | ||
@@ -880,6 +881,33 @@ pnfs_pageio_init_read(struct nfs_pageio_descriptor *pgio, struct inode *inode) | |||
880 | } | 881 | } |
881 | 882 | ||
882 | /* | 883 | /* |
884 | * Call the appropriate parallel I/O subsystem read function. | ||
885 | */ | ||
886 | enum pnfs_try_status | ||
887 | pnfs_try_to_read_data(struct nfs_read_data *rdata, | ||
888 | const struct rpc_call_ops *call_ops) | ||
889 | { | ||
890 | struct inode *inode = rdata->inode; | ||
891 | struct nfs_server *nfss = NFS_SERVER(inode); | ||
892 | enum pnfs_try_status trypnfs; | ||
893 | |||
894 | rdata->mds_ops = call_ops; | ||
895 | |||
896 | dprintk("%s: Reading ino:%lu %u@%llu\n", | ||
897 | __func__, inode->i_ino, rdata->args.count, rdata->args.offset); | ||
898 | |||
899 | trypnfs = nfss->pnfs_curr_ld->read_pagelist(rdata); | ||
900 | if (trypnfs == PNFS_NOT_ATTEMPTED) { | ||
901 | put_lseg(rdata->lseg); | ||
902 | rdata->lseg = NULL; | ||
903 | } else { | ||
904 | nfs_inc_stats(inode, NFSIOS_PNFS_READ); | ||
905 | } | ||
906 | dprintk("%s End (trypnfs:%d)\n", __func__, trypnfs); | ||
907 | return trypnfs; | ||
908 | } | ||
909 | |||
910 | /* | ||
883 | * Device ID cache. Currently supports one layout type per struct nfs_client. | 911 | * Device ID cache. Currently supports one layout type per struct nfs_client. |
884 | * Add layout type to the lookup key to expand to support multiple types. | 912 | * Add layout type to the lookup key to expand to support multiple types. |
885 | */ | 913 | */ |