[pnfs] [PATCH 17/38] [v1] pnfs: require layout driver {alloc, free}_layout
Benny Halevy
bhalevy at panasas.com
Fri Jan 4 05:52:28 EST 2008
mandate implementation of the layout driver's
alloc_layout and free_layout methods
Signed-off-by: Benny Halevy <bhalevy at panasas.com>
---
fs/nfs/pnfs.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index d4500e0..cfd20d1 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -258,12 +258,19 @@ struct pnfs_client_operations*
pnfs_register_layoutdriver(struct pnfs_layoutdriver_type *ld_type)
{
struct pnfs_module *pnfs_mod;
+ struct layoutdriver_io_operations *io_ops = ld_type->ld_io_ops;
if (!pnfs_initialized) {
printk(KERN_ERR "%s Registration failure. pNFS not initialized.\n", __FUNCTION__);
return NULL;
}
+ if (!io_ops || !io_ops->alloc_layout || !io_ops->free_layout) {
+ printk(KERN_ERR "%s Layout driver must provide "
+ "alloc_layout and free_layout.\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