diff options
author | Fred Isaman <iisaman@netapp.com> | 2011-03-03 10:13:44 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-03-11 15:38:44 -0500 |
commit | 44b83799a922a153957c65ccfc985a8c902958c8 (patch) | |
tree | 4dad6ec4655a876c3f12a15919fad407fd22ef59 /fs/nfs/pnfs.c | |
parent | 5053aa568d4017aeb1fa35247d4ad96be262920f (diff) |
NFSv4.1: trigger LAYOUTGET for writes
Signed-off-by: Fred Isaman <iisaman@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/pnfs.c')
-rw-r--r-- | fs/nfs/pnfs.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 3e545144a0b2..5f205d31d96c 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c | |||
@@ -873,6 +873,28 @@ pnfs_pageio_init_read(struct nfs_pageio_descriptor *pgio, struct inode *inode) | |||
873 | pgio->pg_test = (ld && ld->pg_test) ? pnfs_read_pg_test : NULL; | 873 | pgio->pg_test = (ld && ld->pg_test) ? pnfs_read_pg_test : NULL; |
874 | } | 874 | } |
875 | 875 | ||
876 | static int pnfs_write_pg_test(struct nfs_pageio_descriptor *pgio, | ||
877 | struct nfs_page *prev, | ||
878 | struct nfs_page *req) | ||
879 | { | ||
880 | if (pgio->pg_count == prev->wb_bytes) { | ||
881 | /* This is first coelesce call for a series of nfs_pages */ | ||
882 | pgio->pg_lseg = pnfs_update_layout(pgio->pg_inode, | ||
883 | prev->wb_context, | ||
884 | IOMODE_RW); | ||
885 | } | ||
886 | return NFS_SERVER(pgio->pg_inode)->pnfs_curr_ld->pg_test(pgio, prev, req); | ||
887 | } | ||
888 | |||
889 | void | ||
890 | pnfs_pageio_init_write(struct nfs_pageio_descriptor *pgio, struct inode *inode) | ||
891 | { | ||
892 | struct pnfs_layoutdriver_type *ld; | ||
893 | |||
894 | ld = NFS_SERVER(inode)->pnfs_curr_ld; | ||
895 | pgio->pg_test = (ld && ld->pg_test) ? pnfs_write_pg_test : NULL; | ||
896 | } | ||
897 | |||
876 | /* | 898 | /* |
877 | * Call the appropriate parallel I/O subsystem read function. | 899 | * Call the appropriate parallel I/O subsystem read function. |
878 | */ | 900 | */ |