[pnfs] [PATCH 17/38] [v1] pnfs: require layout driver {alloc, free}_layout

Benny Halevy bhalevy at panasas.com
Tue Jan 8 02:33:16 EST 2008


On Jan. 08, 2008, 0:09 +0200, Dean Hildebrand <seattleplus at gmail.com> wrote:
> Should we also require set_layout?

No. set_layout is gone.  Its function is embedded in alloc_lseg
so the layout driver allocates and sets up it private area
in the layout segment in the same call.
(see http://git.linux-nfs.org/?p=bhalevy/linux-pnfs.git;a=commitdiff;h=160939ad8c008ebb43d59b9d33b0440b3c23aace)

Benny

> 
> Dean
> 
> Benny Halevy wrote:
>> 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",
>>   
> _______________________________________________
> pNFS mailing list
> pNFS at linux-nfs.org
> http://linux-nfs.org/cgi-bin/mailman/listinfo/pnfs
> 



More information about the pNFS mailing list