[PATCH 10/24] pnfs_submit: mandate basic io path operations for layout drivers

Fred Isaman
2010-06-08T04:19:47Z

Mandate read_pagelist, write_pagelist, and commit. This will help
void needless checks in the io path.

Signed-off-by: Fred Isaman <iisaman@netapp.com>
---
fs/nfs/pnfs.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index b990471..836cb0f 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -272,6 +272,14 @@ pnfs_register_layoutdriver(struct pnfs_layoutdriver_type *ld_type)
return NULL;
}

+ if (!io_ops->read_pagelist || !io_ops->write_pagelist ||
+ !io_ops->commit) {
+ printk(KERN_ERR "%s Layout driver must provide "
+ "read_pagelist, write_pagelist, and commit.\n",
+ __func__);
+ return NULL;
+ }
+
pnfs_mod = kmalloc(sizeof(struct pnfs_module), GFP_KERNEL);
if (pnfs_mod != NULL) {
dprintk("%s Registering id:%u name:%s\n",
--
1.6.6.1