[pnfs] [PATCH 24/28] pnfsblock: bl_new_request
Fred Isaman
iisaman at citi.umich.edu
Tue Mar 11 15:32:05 EDT 2008
From: Fred <iisaman at citi.umich.edu>
Implement a simple bl_new_request function that marks request
with PG_USE_PNFS.
Signed-off-by: Fred <iisaman at citi.umich.edu>
---
fs/nfs/blocklayout/blocklayout.c | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c
index 246b5ff..f74836c 100644
--- a/fs/nfs/blocklayout/blocklayout.c
+++ b/fs/nfs/blocklayout/blocklayout.c
@@ -870,6 +870,26 @@ cleanup:
return ret;
}
+static void
+bl_new_request(struct pnfs_layout_segment *lseg, struct nfs_page *req,
+ loff_t pos, unsigned count, struct pnfs_fsdata *fsdata)
+{
+ dprintk("%s enter %u@%Lu\n", __func__, count, pos);
+ /* Note at this stage the req points to the page, but the
+ * page does not point to the req.
+ */
+ if (!lseg)
+ return;
+ if (fsdata) {
+ /* A write request */
+ int use_pnfs = (fsdata == bl_use_pnfs);
+ if (use_pnfs)
+ set_bit(PG_USE_PNFS, &req->wb_flags);
+ } else {
+ /* STUB - what whould we do for read requests? */
+ }
+}
+
static ssize_t
bl_get_stripesize(struct pnfs_layout_type *layoutid)
{
@@ -912,6 +932,7 @@ static struct layoutdriver_io_operations blocklayout_io_operations = {
.read_pagelist = bl_read_pagelist,
.write_pagelist = bl_write_pagelist,
.write_begin = bl_write_begin,
+ .new_request = bl_new_request,
.alloc_layout = bl_alloc_layout,
.free_layout = bl_free_layout,
.alloc_lseg = bl_alloc_lseg,
--
1.5.3.3
More information about the pNFS
mailing list