Skip to contentSkip to conversation

pnfsblock: iterating all local block disks instead of only scsi disks when initializing mount point.

PATCH New Tao Guo 1 participant 1 message May 14, 2010

Subsystems (2)
lore
Share & tools
lore

Tao Guo

author
#0 lore raw

PATCH 2/2 pnfsblock: iterating all local block disks instead of only scsi disks when initializing mount point.

So we can use virtual block devices like MD/DM in blocklayoutdriver.

---
 fs/nfs/blocklayout/blocklayout.c    |   12 ++--
 fs/nfs/blocklayout/blocklayout.h    |    3 +-
 fs/nfs/blocklayout/blocklayoutdev.c |  116 +++++++++++++++--------------------
 fs/nfs/blocklayout/blocklayoutdm.c  |    2 +-
 4 files changed, 57 insertions(+), 76 deletions(-)
fs/nfs/blocklayout/blocklayout.c +6 -6
index 918e6d6..688984f 100644
@@ -765,7 +765,7 @@ bl_initialize_mountpoint(struct nfs_server *server, const struct nfs_fh *fh)
 	struct pnfs_mount_type *mtype = NULL;
 	struct pnfs_devicelist *dlist = NULL;
 	struct pnfs_block_dev *bdev;
-	LIST_HEAD(scsi_disklist);
+	LIST_HEAD(block_disklist);
 	int status, i;
 
 	dprintk("%s enter\n", __func__);
@@ -783,10 +783,10 @@ bl_initialize_mountpoint(struct nfs_server *server, const struct nfs_fh *fh)
 	spin_lock_init(&b_mt_id->bm_lock);
 	INIT_LIST_HEAD(&b_mt_id->bm_devlist);
 
-	/* Construct a list of all visible scsi disks that have not been
+	/* Construct a list of all visible block disks that have not been
 	 * claimed.
 	 */
-	status =  nfs4_blk_create_scsi_disk_list(&scsi_disklist);
+	status =  nfs4_blk_create_block_disk_list(&block_disklist);
 	if (status < 0)
 		goto out_error;
 
@@ -804,13 +804,13 @@ bl_initialize_mountpoint(struct nfs_server *server, const struct nfs_fh *fh)
 		/* For each device returned in dlist, call GETDEVICEINFO, and
 		 * decode the opaque topology encoding to create a flat
 		 * volume topology, matching VOLUME_SIMPLE disk signatures
-		 * to disks in the visible scsi disk list.
+		 * to disks in the visible block disk list.
 		 * Construct an LVM meta device from the flat volume topology.
 		 */
 		for (i = 0; i < dlist->num_devs; i++) {
 			bdev = nfs4_blk_get_deviceinfo(server, fh,
 						     &dlist->dev_id[i],
-						     &scsi_disklist);
+						     &block_disklist);
 			if (!bdev)
 				goto out_error;
 			spin_lock(&b_mt_id->bm_lock);
@@ -823,7 +823,7 @@ bl_initialize_mountpoint(struct nfs_server *server, const struct nfs_fh *fh)
 	status = 0;
  out_return:
 	kfree(dlist);
-	nfs4_blk_destroy_disk_list(&scsi_disklist);
+	nfs4_blk_destroy_disk_list(&block_disklist);
 	return status;
 
  out_error:
fs/nfs/blocklayout/blocklayout.h +1 -2
index 286adc9..0efed8d 100644
@@ -44,7 +44,6 @@
 #define SetPagePnfsErr(page)	set_bit(PG_pnfserr, &(page)->flags)
 #define ClearPagePnfsErr(page)	clear_bit(PG_pnfserr, &(page)->flags)
 
-extern struct class shost_class; /* exported from drivers/scsi/hosts.c */
 extern int dm_dev_create(struct dm_ioctl *param); /* from dm-ioctl.c */
 extern int dm_dev_remove(struct dm_ioctl *param); /* from dm-ioctl.c */
 extern int dm_do_resume(struct dm_ioctl *param);
@@ -250,7 +249,7 @@ struct pnfs_block_dev *nfs4_blk_decode_device(struct nfs_server *server,
 					      struct list_head *sdlist);
 int nfs4_blk_process_layoutget(struct pnfs_layout_type *lo,
 			       struct nfs4_pnfs_layoutget_res *lgr);
-int nfs4_blk_create_scsi_disk_list(struct list_head *);
+int nfs4_blk_create_block_disk_list(struct list_head *);
 void nfs4_blk_destroy_disk_list(struct list_head *);
 /* blocklayoutdm.c */
 struct pnfs_block_dev *nfs4_blk_init_metadev(struct nfs_server *server,
fs/nfs/blocklayout/blocklayoutdev.c +48 -66

198 lines not on this page · raw message

fs/nfs/blocklayout/blocklayoutdm.c +1 -1
index d70f6b2..3d15de0 100644
@@ -257,7 +257,7 @@ static int nfs4_blk_resolve(int root, struct pnfs_blk_volume *vols,
  * Create an LVM dm device table that represents the volume topology returned
  * by GETDEVICELIST or GETDEVICEINFO.
  *
- * vols:  topology with VOLUME_SIMPLEs mapped to visable scsi disks.
+ * vols:  topology with VOLUME_SIMPLEs mapped to visable block disks.
  * size:  number of volumes in vols.
  */
 int nfs4_blk_flatten(struct pnfs_blk_volume *vols, int size,
Signature · 1 line
1.6.3.3