lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160225200454.21975.76837.stgit@dwillia2-desk3.amr.corp.intel.com>
Date:	Thu, 25 Feb 2016 12:04:54 -0800
From:	Dan Williams <dan.j.williams@...el.com>
To:	axboe@...com
Cc:	linux-block@...r.kernel.org,
	Ross Zwisler <ross.zwisler@...ux.intel.com>, hch@....de,
	linux-kernel@...r.kernel.org
Subject: [PATCH 3/3] block: remove ->driverfs_dev

Now that all drivers that specify a ->driverfs_dev have been converted
to device_add_disk(), the pointer can be removed from struct gendisk.

Cc: Jens Axboe <axboe@...com>
Cc: Christoph Hellwig <hch@....de>
Cc: Ross Zwisler <ross.zwisler@...ux.intel.com>
Signed-off-by: Dan Williams <dan.j.williams@...el.com>
---
 block/genhd.c         |    5 ++---
 drivers/nvdimm/bus.c  |    2 +-
 include/linux/genhd.h |    4 +---
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/block/genhd.c b/block/genhd.c
index 3fa2654ada52..d20f36bf42fa 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -797,10 +797,9 @@ void __init printk_all_partitions(void)
 			       , disk_name(disk, part->partno, name_buf),
 			       part->info ? part->info->uuid : "");
 			if (is_part0) {
-				if (disk->driverfs_dev != NULL &&
-				    disk->driverfs_dev->driver != NULL)
+				if (dev->parent && dev->parent->driver)
 					printk(" driver: %s\n",
-					      disk->driverfs_dev->driver->name);
+					      dev->parent->driver->name);
 				else
 					printk(" (driver?)\n");
 			} else
diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c
index 2b2181cdeb63..f2540bfaa65a 100644
--- a/drivers/nvdimm/bus.c
+++ b/drivers/nvdimm/bus.c
@@ -235,7 +235,7 @@ EXPORT_SYMBOL(__nd_driver_register);
 
 int nvdimm_revalidate_disk(struct gendisk *disk)
 {
-	struct device *dev = disk->driverfs_dev;
+	struct device *dev = disk_to_dev(disk)->parent;
 	struct nd_region *nd_region = to_nd_region(dev->parent);
 	const char *pol = nd_region->ro ? "only" : "write";
 
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 6fa03fe589ad..0c065e8549f1 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -204,7 +204,6 @@ struct gendisk {
 	void *private_data;
 
 	int flags;
-	struct device *driverfs_dev;  // FIXME: remove
 	struct kobject *slave_dir;
 
 	struct timer_rand_state *random;
@@ -434,8 +433,7 @@ extern void part_round_stats(int cpu, struct hd_struct *part);
 extern int device_add_disk(struct device *parent, struct gendisk *disk);
 static inline void add_disk(struct gendisk *disk)
 {
-	/* temporary while we convert callers to device_add_disk */
-	WARN_ON(device_add_disk(disk->driverfs_dev, disk) != 0);
+	WARN_ON(device_add_disk(NULL, disk) != 0);
 }
 
 extern void del_gendisk(struct gendisk *gp);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ