remove ->revalidate_disk
Subsystems (4)
Hi Jens,
with the previously merged patches all real users of ->revalidate_disk are gone. This series removes the two remaining not actually required instances and the method itself.
PATCH 1/3 paride/pd: remove ->revalidate_disk
->revalidate_disk is only called during add_disk for pd, but at that point the driver has already set the capacity to the one returned from Identify a little earlier, so this additional update is entirely superflous.
--- drivers/block/paride/pd.c | 11 ----------- 1 file changed, 11 deletions(-)
drivers/block/paride/pd.c +0 -11
@@ -859,16 +859,6 @@ static unsigned int pd_check_events(struct gendisk *p, unsigned int clearing)return r ?DISK_EVENT_MEDIA_CHANGE :0 ; } -static int pd_revalidate (struct gendisk *p) -{ -struct pd_unit *disk = p->private_data; -if (pd_special_command (disk, pd_identify) ==0 ) -set_capacity (p, disk->capacity); -else -set_capacity (p,0 ); -return 0 ; -} -static const struct block_device_operations pd_fops = { .owner =THIS_MODULE , .open = pd_open,
@@ -877,7 +867,6 @@ static const struct block_device_operations pd_fops = { .compat_ioctl = pd_ioctl, .getgeo = pd_getgeo, .check_events = pd_check_events, - .revalidate_disk= pd_revalidate };/* probing */
Signature · 1 line
2.28.0
PATCH 2/3 umem: remove ->revalidate_disk
In reply to Christoph Hellwig->revalidate_disk is only called during add_disk for pd, but at that point the driver has already set the capacity to the same value a little earlier, so this additional update is entirely superflous.
--- drivers/block/umem.c | 16 ---------------- 1 file changed, 16 deletions(-)
drivers/block/umem.c +0 -16
@@ -746,21 +746,6 @@ static void del_battery_timer(void)del_timer (&battery_timer); } -/* -* Note no locks taken out here. In a worst case scenario, we could drop -* a chunk of system memory. But that should never happen, since validation -* happens at open or mount time, when locks are held. -* -* That's crap, since doing that while some partitions are opened -* or mounted will give you really nasty results. -*/ -static int mm_revalidate (struct gendisk *disk) -{ -struct cardinfo *card = disk->private_data; -set_capacity (disk, card->mm_size <<1 ); -return 0 ; -} -static int mm_getgeo (struct block_device *bdev,struct hd_geometry *geo) {struct cardinfo *card = bdev->bd_disk->private_data;
@@ -781,7 +766,6 @@ static const struct block_device_operations mm_fops = { .owner = THIS_MODULE, .submit_bio = mm_submit_bio, .getgeo = mm_getgeo, - .revalidate_disk = mm_revalidate, };static int mm_pci_probe (struct pci_dev *dev,const struct pci_device_id *id)
Signature · 1 line
2.28.0
PATCH 3/3 block: remove the revalidate_disk method
In reply to Christoph HellwigNo implementations left.
--- Documentation/filesystems/locking.rst | 2 -- fs/block_dev.c | 12 ++++-------- include/linux/blkdev.h | 1 - 3 files changed, 4 insertions(+), 11 deletions(-)
Documentation/filesystems/locking.rst +0 -2
@@ -468,7 +468,6 @@ prototypes:: int (*direct_access) (struct block_device *, sector_t, void **, unsigned long *); void (*unlock_native_capacity) (struct gendisk *); - int (*revalidate_disk) (struct gendisk *); int (*getgeo)(struct block_device *, struct hd_geometry *); void (*swap_slot_free_notify) (struct block_device *, unsigned long);
@@ -483,7 +482,6 @@ ioctl: no compat_ioctl: no direct_access: no unlock_native_capacity: no -revalidate_disk: no getgeo: no swap_slot_free_notify: no (see below) ======================= ===================
fs/block_dev.c +4 -8
@@ -1400,14 +1400,10 @@ int bdev_disk_changed(struct block_device *bdev, bool invalidate)* below to get the sane behavior for most device while not breaking * userspace for this particular setup. */ -if (invalidate) { -if (disk_part_scan_enabled (disk) || - !(disk->flags &GENHD_FL_REMOVABLE )) -set_capacity (disk,0 ); - }else { -if (disk->fops->revalidate_disk) - disk->fops->revalidate_disk (disk); - } +if (invalidate && + (disk_part_scan_enabled (disk) || + !(disk->flags &GENHD_FL_REMOVABLE ))) +set_capacity (disk,0 );check_disk_size_change (disk, bdev, !invalidate);
include/linux/blkdev.h +0 -1
@@ -1837,7 +1837,6 @@ struct block_device_operations {unsigned int (*check_events) (struct gendisk *disk,unsigned int clearing);void (*unlock_native_capacity) (struct gendisk *); -int (*revalidate_disk) (struct gendisk *);int (*getgeo)(struct block_device *,struct hd_geometry *);/* this callback is with swap_lock and sometimes page table lock held */ void (*swap_slot_free_notify) (struct block_device *,unsigned long );
Signature · 1 line
2.28.0