linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] target: fix compile failure in linux-next
@ 2010-12-22 16:47 James Bottomley
  2010-12-23 22:42 ` Nicholas A. Bellinger
  0 siblings, 1 reply; 4+ messages in thread
From: James Bottomley @ 2010-12-22 16:47 UTC (permalink / raw)
  To: Nicholas A. Bellinger; +Cc: Christoph Hellwig, linux-scsi

The interfaces open/close_bdev_exclusive are being eliminated in the
merge window.  Fix by using the replacements.

James

---

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;
 		}
 		/*



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] target: fix compile failure in linux-next
  2010-12-22 16:47 [PATCH] target: fix compile failure in linux-next James Bottomley
@ 2010-12-23 22:42 ` Nicholas A. Bellinger
  2010-12-23 22:50   ` James Bottomley
  0 siblings, 1 reply; 4+ messages in thread
From: Nicholas A. Bellinger @ 2010-12-23 22:42 UTC (permalink / raw)
  To: James Bottomley; +Cc: Christoph Hellwig, linux-scsi, Stephen Rothwell

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;
>  		}
>  		/*
> 
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] target: fix compile failure in linux-next
  2010-12-23 22:42 ` Nicholas A. Bellinger
@ 2010-12-23 22:50   ` James Bottomley
  2010-12-23 22:52     ` Nicholas A. Bellinger
  0 siblings, 1 reply; 4+ messages in thread
From: James Bottomley @ 2010-12-23 22:50 UTC (permalink / raw)
  To: Nicholas A. Bellinger; +Cc: Christoph Hellwig, linux-scsi, Stephen Rothwell

On Thu, 2010-12-23 at 14:42 -0800, Nicholas A. Bellinger wrote:
> 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/.

It's already done.  The point about postmerge trees is to fix this type
of thing.

James



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] target: fix compile failure in linux-next
  2010-12-23 22:50   ` James Bottomley
@ 2010-12-23 22:52     ` Nicholas A. Bellinger
  0 siblings, 0 replies; 4+ messages in thread
From: Nicholas A. Bellinger @ 2010-12-23 22:52 UTC (permalink / raw)
  To: James Bottomley; +Cc: Christoph Hellwig, linux-scsi, Stephen Rothwell

On Thu, 2010-12-23 at 16:50 -0600, James Bottomley wrote:
> On Thu, 2010-12-23 at 14:42 -0800, Nicholas A. Bellinger wrote:
> > 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/.
> 
> It's already done.  The point about postmerge trees is to fix this type
> of thing.
> 

Ahhh, thanks for the clarification here.  I will try my best to prevent
this type of conflict for linux-next in the future.

Best Regards,

--nab


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-12-23 22:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-22 16:47 [PATCH] target: fix compile failure in linux-next James Bottomley
2010-12-23 22:42 ` Nicholas A. Bellinger
2010-12-23 22:50   ` James Bottomley
2010-12-23 22:52     ` Nicholas A. Bellinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).