mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Eliminate root_dev_names - part 1 of 2
@ 2002-08-15 19:38 Jeff Dike
  2002-08-16  1:48 ` Alexander Viro
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Dike @ 2002-08-15 19:38 UTC (permalink / raw)
  To: Linus Torvalds, viro; +Cc: linux-kernel, Jeff Dike

This patch changes all instances of get_gendisk to get_gendisk_by_kdev_t.

The following patch, which actually removes the root_dev_names array,
introduces get_gendisk_by_name, so this keeps the naming somewhat consistent.

				Jeff

diff -Naur um-31/drivers/block/blkpg.c um/drivers/block/blkpg.c
--- um-31/drivers/block/blkpg.c	Mon Aug 12 22:29:47 2002
+++ um/drivers/block/blkpg.c	Thu Aug 15 11:02:29 2002
@@ -83,7 +83,7 @@
 		return -EINVAL;
 
 	/* find the drive major */
-	g = get_gendisk(dev);
+	g = get_gendisk_by_kdev_t(dev);
 	if (!g)
 		return -ENXIO;
 	part = g->part + minor(dev) - g->first_minor;
@@ -132,7 +132,7 @@
 	int holder;
 
 	/* find the drive major */
-	g = get_gendisk(dev);
+	g = get_gendisk_by_kdev_t(dev);
 	if (!g)
 		return -ENXIO;
 	part = g->part + minor(dev) - g->first_minor;
diff -Naur um-31/drivers/block/genhd.c um/drivers/block/genhd.c
--- um-31/drivers/block/genhd.c	Mon Aug 12 22:29:47 2002
+++ um/drivers/block/genhd.c	Thu Aug 15 11:21:47 2002
@@ -94,14 +94,14 @@
 
 
 /**
- * get_gendisk - get partitioning information for a given device
+ * get_gendisk_by_kdev_t - get partitioning information for a given device
  * @dev: device to get partitioning information for
  *
  * This function gets the structure containing partitioning
  * information for the given device @dev.
  */
 struct gendisk *
-get_gendisk(kdev_t dev)
+get_gendisk_by_kdev_t(kdev_t dev)
 {
 	struct gendisk *gp = NULL;
 	int major = major(dev);
@@ -122,7 +122,7 @@
 	return NULL;
 }
 
-EXPORT_SYMBOL(get_gendisk);
+EXPORT_SYMBOL(get_gendisk_by_kdev_t);
 
 #ifdef CONFIG_PROC_FS
 /* iterator */
diff -Naur um-31/drivers/ide/hptraid.c um/drivers/ide/hptraid.c
--- um-31/drivers/ide/hptraid.c	Sat Jul 27 21:52:34 2002
+++ um/drivers/ide/hptraid.c	Thu Aug 15 11:02:29 2002
@@ -306,7 +306,7 @@
 	/* now blank the /proc/partitions table for the wrong partition table,
 	   so that scripts don't accidentally mount it and crash the kernel */
 	/* XXX: the 0 is an utter hack  --hch */
-	gd = get_gendisk(mk_kdev(major, 0));
+	gd = get_gendisk_by_kdev_t(mk_kdev(major, 0));
 	if (gd != NULL) {
 		int j;
 		for (j = 1 + (minor << gd->minor_shift);
diff -Naur um-31/drivers/md/md.c um/drivers/md/md.c
--- um-31/drivers/md/md.c	Thu Aug  1 20:40:54 2002
+++ um/drivers/md/md.c	Thu Aug 15 11:02:28 2002
@@ -294,7 +294,7 @@
 	/*
 	 * ok, add this new device name to the list
 	 */
-	hd = get_gendisk (dev);
+	hd = get_gendisk_by_kdev_t (dev);
 	dname->name = NULL;
 	if (hd)
 		dname->name = disk_name (hd, minor(dev), dname->namebuf);
diff -Naur um-31/fs/block_dev.c um/fs/block_dev.c
--- um-31/fs/block_dev.c	Mon Aug 12 22:29:51 2002
+++ um/fs/block_dev.c	Thu Aug 15 11:02:31 2002
@@ -516,7 +516,7 @@
 	if (invalidate_device(dev, 0))
 		printk("VFS: busy inodes on changed media.\n");
 
-	disk = get_gendisk(dev);
+	disk = get_gendisk_by_kdev_t(dev);
 	part = disk->part + minor(dev) - disk->first_minor;
 	if (bdops->revalidate)
 		bdops->revalidate(dev);
@@ -531,7 +531,7 @@
 	down(&bdev->bd_sem);
 	res = check_disk_change(bdev);
 	if (bdev->bd_invalidated && !bdev->bd_part_count) {
-		struct gendisk *g = get_gendisk(to_kdev_t(bdev->bd_dev));
+		struct gendisk *g = get_gendisk_by_kdev_t(to_kdev_t(bdev->bd_dev));
 		struct hd_struct *part;
 		part = g->part + MINOR(bdev->bd_dev) - g->first_minor;
 		bdev->bd_invalidated = 0;
@@ -599,7 +599,7 @@
 	}
 	if (!bdev->bd_contains) {
 		unsigned minor = minor(dev);
-		struct gendisk *g = get_gendisk(dev);
+		struct gendisk *g = get_gendisk_by_kdev_t(dev);
 		bdev->bd_contains = bdev;
 		if (g) {
 			int shift = g->minor_shift;
@@ -618,7 +618,7 @@
 		}
 	}
 	if (bdev->bd_contains == bdev) {
-		struct gendisk *g = get_gendisk(dev);
+		struct gendisk *g = get_gendisk_by_kdev_t(dev);
 		if (bdev->bd_op->open) {
 			ret = bdev->bd_op->open(inode, file);
 			if (ret)
@@ -659,7 +659,7 @@
 		down(&bdev->bd_contains->bd_sem);
 		bdev->bd_contains->bd_part_count++;
 		if (!bdev->bd_openers) {
-			struct gendisk *g = get_gendisk(dev);
+			struct gendisk *g = get_gendisk_by_kdev_t(dev);
 			struct hd_struct *p;
 			p = g->part + minor(dev) - g->first_minor;
 			inode->i_data.backing_dev_info =
@@ -788,7 +788,7 @@
 static int blkdev_reread_part(struct block_device *bdev)
 {
 	kdev_t dev = to_kdev_t(bdev->bd_dev);
-	struct gendisk *disk = get_gendisk(dev);
+	struct gendisk *disk = get_gendisk_by_kdev_t(dev);
 	struct hd_struct *part;
 	int res;
 
diff -Naur um-31/fs/partitions/check.c um/fs/partitions/check.c
--- um-31/fs/partitions/check.c	Mon Aug 12 22:29:52 2002
+++ um/fs/partitions/check.c	Thu Aug 15 11:02:30 2002
@@ -462,7 +462,7 @@
 void grok_partitions(kdev_t dev, long size)
 {
 	struct block_device *bdev;
-	struct gendisk *g = get_gendisk(dev);
+	struct gendisk *g = get_gendisk_by_kdev_t(dev);
 	struct hd_struct *p;
 
 	if (!g)
@@ -516,7 +516,7 @@
 	int p, major, minor, minor0, max_p, res;
 	struct hd_struct *part;
 
-	g = get_gendisk(dev);
+	g = get_gendisk_by_kdev_t(dev);
 	if (g == NULL)
 		return -EINVAL;
 
diff -Naur um-31/include/linux/genhd.h um/include/linux/genhd.h
--- um-31/include/linux/genhd.h	Thu Aug  1 20:41:00 2002
+++ um/include/linux/genhd.h	Thu Aug 15 11:02:30 2002
@@ -89,7 +89,7 @@
 /* drivers/block/genhd.c */
 extern void add_gendisk(struct gendisk *gp);
 extern void del_gendisk(struct gendisk *gp);
-extern struct gendisk *get_gendisk(kdev_t dev);
+extern struct gendisk *get_gendisk_by_kdev_t(kdev_t dev);
 static inline unsigned long get_start_sect(struct block_device *bdev)
 {
 	return bdev->bd_offset;
@@ -250,7 +250,7 @@
 
 static inline unsigned int disk_index (kdev_t dev)
 {
-	struct gendisk *g = get_gendisk(dev);
+	struct gendisk *g = get_gendisk_by_kdev_t(dev);
 	return g ? (minor(dev) >> g->minor_shift) : 0;
 }
 


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

* Re: [PATCH] Eliminate root_dev_names - part 1 of 2
  2002-08-15 19:38 [PATCH] Eliminate root_dev_names - part 1 of 2 Jeff Dike
@ 2002-08-16  1:48 ` Alexander Viro
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Viro @ 2002-08-16  1:48 UTC (permalink / raw)
  To: Jeff Dike; +Cc: Linus Torvalds, linux-kernel



On Thu, 15 Aug 2002, Jeff Dike wrote:

> This patch changes all instances of get_gendisk to get_gendisk_by_kdev_t.
> 
> The following patch, which actually removes the root_dev_names array,
> introduces get_gendisk_by_name, so this keeps the naming somewhat consistent.

Leave it alone for now.  I'm one driver away from per-disk gendisks
(i2o is the last remaining) and as soon as I'm done with it there will
be a lot of changes in that area.  I.e. tonight.

BTW, disk_name() and get_gendisk() will disappear from the export
list, being replaced by partition_name() (taken out of md.c, exported
and sans the "cache" - it doesn't give any benefits anymore).


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

end of thread, other threads:[~2002-08-16  1:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-15 19:38 [PATCH] Eliminate root_dev_names - part 1 of 2 Jeff Dike
2002-08-16  1:48 ` Alexander Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®