Re: [PATCH 07/13] RFC: pnfs: full mount/umount infrastructure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 02, 2010 at 02:00:13PM -0400, Fred Isaman wrote:
>  static struct pnfs_layoutdriver_type *
>  find_pnfs_driver(u32 id) {
> -	return NULL;
> +	struct  pnfs_layoutdriver_type *local;
> +
> +	spin_lock(&pnfs_spinlock);
> +	local = find_pnfs_driver_locked(id);
> +	spin_unlock(&pnfs_spinlock);
> +	return local;

What about refcounting the structure?

> +	spin_lock(&pnfs_spinlock);
> +	if (!find_pnfs_driver_locked(ld_type->id)) {
> +		list_add(&ld_type->pnfs_tblid, &pnfs_modules_tbl);
> +		status = 0;
> +		dprintk("%s Registering id:%u name:%s\n", __func__, ld_type->id,
> +			ld_type->name);
> +	} else
> +		printk(KERN_ERR "%s Module with id %d already loaded!\n",
> +			__func__, ld_type->id);
> +	spin_unlock(&pnfs_spinlock);

In other places we generally don't bother doing these checks, so for
pnfs with just three clients it's even more poinless.

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux