pnfsblock: use pageio_ops api
authorBenny Halevy <bhalevy@panasas.com>
Sun, 31 Jul 2011 00:52:40 +0000 (20:52 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Sun, 31 Jul 2011 16:18:15 +0000 (12:18 -0400)
[pnfsblock: use pnfs_generic_pg_init_read/write]
Signed-off-by: Peng Tao <peng_tao@emc.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Jim Rees <rees@umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/blocklayout/blocklayout.c

index 44562cbbe3942c5590f67bcb9f9233b7fe52433f..1f5287c2230ae8e19df4f5885b0402a97181010a 100644 (file)
@@ -135,6 +135,18 @@ bl_clear_layoutdriver(struct nfs_server *server)
        return 0;
 }
 
+static const struct nfs_pageio_ops bl_pg_read_ops = {
+       .pg_init = pnfs_generic_pg_init_read,
+       .pg_test = pnfs_generic_pg_test,
+       .pg_doio = pnfs_generic_pg_readpages,
+};
+
+static const struct nfs_pageio_ops bl_pg_write_ops = {
+       .pg_init = pnfs_generic_pg_init_write,
+       .pg_test = pnfs_generic_pg_test,
+       .pg_doio = pnfs_generic_pg_writepages,
+};
+
 static struct pnfs_layoutdriver_type blocklayout_type = {
        .id                             = LAYOUT_BLOCK_VOLUME,
        .name                           = "LAYOUT_BLOCK_VOLUME",
@@ -148,6 +160,8 @@ static struct pnfs_layoutdriver_type blocklayout_type = {
        .cleanup_layoutcommit           = bl_cleanup_layoutcommit,
        .set_layoutdriver               = bl_set_layoutdriver,
        .clear_layoutdriver             = bl_clear_layoutdriver,
+       .pg_read_ops                    = &bl_pg_read_ops,
+       .pg_write_ops                   = &bl_pg_write_ops,
 };
 
 static int __init nfs4blocklayout_init(void)