Re: [PATCH] target: fix compile failure in linux-next

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

 



On Wed, 2010-12-22 at 10:47 -0600, James Bottomley wrote:
> The interfaces open/close_bdev_exclusive are being eliminated in the
> merge window.  Fix by using the replacements.
> 
> James
> 

Hi James,

If you don't mind I am going to let srf carry this patch for now, and I
will begin a 'for-linux-next' branch to prevent future breakage from
drivers/target/.

Best Regards,

--nab

> ---
> 
> diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
> index e99bfc2..c6e0d75 100644
> --- a/drivers/target/target_core_iblock.c
> +++ b/drivers/target/target_core_iblock.c
> @@ -152,8 +152,8 @@ static struct se_device *iblock_create_virtdevice(
>  	printk(KERN_INFO  "IBLOCK: Claiming struct block_device: %s\n",
>  			ib_dev->ibd_udev_path);
>  
> -	bd = open_bdev_exclusive(ib_dev->ibd_udev_path,
> -			FMODE_WRITE|FMODE_READ, ib_dev);
> +	bd = blkdev_get_by_path(ib_dev->ibd_udev_path,
> +				FMODE_WRITE|FMODE_READ|FMODE_EXCL, ib_dev);
>  	if (!(bd))
>  		goto failed;
>  	/*
> @@ -220,7 +220,7 @@ static void iblock_free_device(void *p)
>  {
>  	struct iblock_dev *ib_dev = p;
>  
> -	close_bdev_exclusive(ib_dev->ibd_bd, FMODE_WRITE|FMODE_READ);
> +	blkdev_put(ib_dev->ibd_bd, FMODE_WRITE|FMODE_READ|FMODE_EXCL);
>  	bioset_free(ib_dev->ibd_bio_set);
>  	kfree(ib_dev);
>  }
> diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c
> index 6a7495b..742d246 100644
> --- a/drivers/target/target_core_pscsi.c
> +++ b/drivers/target/target_core_pscsi.c
> @@ -460,10 +460,10 @@ static struct se_device *pscsi_create_type_disk(
>  	 * Claim exclusive struct block_device access to struct scsi_device
>  	 * for TYPE_DISK using supplied udev_path
>  	 */
> -	bd = open_bdev_exclusive(se_dev->se_dev_udev_path,
> -				FMODE_WRITE|FMODE_READ, pdv);
> +	bd = blkdev_get_by_path(se_dev->se_dev_udev_path,
> +				FMODE_WRITE|FMODE_READ|FMODE_EXCL, pdv);
>  	if (!(bd)) {
> -		printk("pSCSI: open_bdev_exclusive() failed\n");
> +		printk("pSCSI: blkdev_get_by_path() failed\n");
>  		scsi_device_put(sd);
>  		return NULL;
>  	}
> @@ -471,7 +471,7 @@ static struct se_device *pscsi_create_type_disk(
>  
>  	dev = pscsi_add_device_to_list(hba, se_dev, pdv, sd, dev_flags);
>  	if (!(dev)) {
> -		close_bdev_exclusive(pdv->pdv_bd, FMODE_WRITE|FMODE_READ);
> +		blkdev_put(pdv->pdv_bd, FMODE_WRITE|FMODE_READ|FMODE_EXCL);
>  		scsi_device_put(sd);
>  		return NULL;
>  	}
> @@ -680,8 +680,8 @@ static void pscsi_free_device(void *p)
>  		 * struct scsi_device with TYPE_DISK from pscsi_create_type_disk()
>  		 */
>  		if ((sd->type == TYPE_DISK) && pdv->pdv_bd) {
> -			close_bdev_exclusive(pdv->pdv_bd,
> -					FMODE_WRITE|FMODE_READ);
> +			blkdev_put(pdv->pdv_bd,
> +				   FMODE_WRITE|FMODE_READ|FMODE_EXCL);
>  			pdv->pdv_bd = NULL;
>  		}
>  		/*
> 
> 

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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux