[pnfs] [PATCH 25/38] [v1] pnfs: client layout cache: require layout driver {alloc, free}_lseg
Benny Halevy
bhalevy at panasas.com
Fri Jan 4 05:52:58 EST 2008
mandate implementation of the layout driver's alloc_lseg
and free_lseg methods.
Signed-off-by: Benny Halevy <bhalevy at panasas.com>
---
fs/nfs/pnfs.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index c95659b..82b65bc 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -271,6 +271,12 @@ pnfs_register_layoutdriver(struct pnfs_layoutdriver_type *ld_type)
return NULL;
}
+ if (!io_ops->alloc_lseg || !io_ops->free_lseg) {
+ printk(KERN_ERR "%s Layout driver must provide "
+ "alloc_lseg and free_lseg.\n", __FUNCTION__);
+ return NULL;
+ }
+
pnfs_mod = kmalloc(sizeof(struct pnfs_module), GFP_KERNEL);
if (pnfs_mod != NULL) {
dprintk("%s Registering id:%u name:%s\n",
--
1.5.3.3
More information about the pNFS
mailing list