search for: revalidate_disk

Displaying 20 results from an estimated 34 matches for "revalidate_disk".

2020 Sep 01
10
remove revalidate_disk()
Hi Jens, this series removes the revalidate_disk() function, which has been a really odd duck in the last years. The prime reason why most people use it is because it propagates a size change from the gendisk to the block_device structure. But it also calls into the rather ill defined ->revalidate_disk method which is rather useless for the...
2013 Feb 21
3
[PATCH] virtio-blk: emit udev event when device is resized
...cap_str_2[10], cap_str_10[10]; + char event[] = "RESIZE=1"; + char *envp[] = { event, NULL }; u64 capacity, size; mutex_lock(&vblk->config_lock); @@ -568,6 +570,7 @@ static void virtblk_config_changed_work(struct work_struct *work) set_capacity(vblk->disk, capacity); revalidate_disk(vblk->disk); + kobject_uevent_env(&disk_to_dev(vblk->disk)->kobj, KOBJ_CHANGE, envp); done: mutex_unlock(&vblk->config_lock); } -- 1.7.1
2013 Feb 21
3
[PATCH] virtio-blk: emit udev event when device is resized
...cap_str_2[10], cap_str_10[10]; + char event[] = "RESIZE=1"; + char *envp[] = { event, NULL }; u64 capacity, size; mutex_lock(&vblk->config_lock); @@ -568,6 +570,7 @@ static void virtblk_config_changed_work(struct work_struct *work) set_capacity(vblk->disk, capacity); revalidate_disk(vblk->disk); + kobject_uevent_env(&disk_to_dev(vblk->disk)->kobj, KOBJ_CHANGE, envp); done: mutex_unlock(&vblk->config_lock); } -- 1.7.1
2017 Jul 26
2
[PATCH] virtio_blk: fix incorrect message when disk is resized
...t;, - (unsigned long long)capacity, - queue_logical_block_size(q), - cap_str_10, cap_str_2); + "new size: %llu %d-byte logical blocks (%s/%s)\n", + nblocks, + queue_logical_block_size(q), + cap_str_10, + cap_str_2); set_capacity(vblk->disk, capacity); revalidate_disk(vblk->disk); -- 2.13.3
2017 Jul 26
2
[PATCH] virtio_blk: fix incorrect message when disk is resized
...t;, - (unsigned long long)capacity, - queue_logical_block_size(q), - cap_str_10, cap_str_2); + "new size: %llu %d-byte logical blocks (%s/%s)\n", + nblocks, + queue_logical_block_size(q), + cap_str_10, + cap_str_2); set_capacity(vblk->disk, capacity); revalidate_disk(vblk->disk); -- 2.13.3
2018 Jan 03
1
[PATCH] virtio_blk: print capacity at probe time
...tr_2); set_capacity(vblk->disk, capacity); +} + +static void virtblk_config_changed_work(struct work_struct *work) +{ + struct virtio_blk *vblk = + container_of(work, struct virtio_blk, config_work); + char *envp[] = { "RESIZE=1", NULL }; + + virtblk_update_capacity(vblk, true); revalidate_disk(vblk->disk); kobject_uevent_env(&disk_to_dev(vblk->disk)->kobj, KOBJ_CHANGE, envp); } @@ -621,7 +630,6 @@ static int virtblk_probe(struct virtio_device *vdev) struct request_queue *q; int err, index; - u64 cap; u32 v, blk_size, sg_elems, opt_io_size; u16 min_io_size; u8...
2017 Aug 04
0
[PATCH] virtio_blk: fix incorrect message when disk is resized
...ueue_logical_block_size(q), > - cap_str_10, cap_str_2); > + "new size: %llu %d-byte logical blocks (%s/%s)\n", > + nblocks, > + queue_logical_block_size(q), > + cap_str_10, > + cap_str_2); > > set_capacity(vblk->disk, capacity); > revalidate_disk(vblk->disk); > -- > 2.13.3 > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 455 bytes Desc: not available URL: <http://lists.linuxfoundation.org/pipermail/virtualization/attachments/20170804/15...
2014 Oct 05
0
[PATCH 06/16] virtio_blk: drop config_enable
...k); - if (!vblk->config_enable) - goto done; /* Host must always specify the capacity. */ virtio_cread(vdev, struct virtio_blk_config, capacity, &capacity); @@ -374,7 +369,7 @@ static void virtblk_config_changed_work(struct work_struct *work) set_capacity(vblk->disk, capacity); revalidate_disk(vblk->disk); kobject_uevent_env(&disk_to_dev(vblk->disk)->kobj, KOBJ_CHANGE, envp); -done: + mutex_unlock(&vblk->config_lock); } @@ -609,7 +604,6 @@ static int virtblk_probe(struct virtio_device *vdev) mutex_init(&vblk->config_lock); INIT_WORK(&vblk->c...
2014 Oct 05
0
[PATCH 07/16] virtio-blk: drop config_mutex
...ze; - mutex_lock(&vblk->config_lock); - /* Host must always specify the capacity. */ virtio_cread(vdev, struct virtio_blk_config, capacity, &capacity); @@ -369,8 +364,6 @@ static void virtblk_config_changed_work(struct work_struct *work) set_capacity(vblk->disk, capacity); revalidate_disk(vblk->disk); kobject_uevent_env(&disk_to_dev(vblk->disk)->kobj, KOBJ_CHANGE, envp); - - mutex_unlock(&vblk->config_lock); } static void virtblk_config_changed(struct virtio_device *vdev) @@ -601,7 +594,6 @@ static int virtblk_probe(struct virtio_device *vdev) vblk->...
2014 Oct 06
0
[PATCH v2 05/15] virtio_blk: drop config_enable
...k); - if (!vblk->config_enable) - goto done; /* Host must always specify the capacity. */ virtio_cread(vdev, struct virtio_blk_config, capacity, &capacity); @@ -374,7 +369,7 @@ static void virtblk_config_changed_work(struct work_struct *work) set_capacity(vblk->disk, capacity); revalidate_disk(vblk->disk); kobject_uevent_env(&disk_to_dev(vblk->disk)->kobj, KOBJ_CHANGE, envp); -done: + mutex_unlock(&vblk->config_lock); } @@ -609,7 +604,6 @@ static int virtblk_probe(struct virtio_device *vdev) mutex_init(&vblk->config_lock); INIT_WORK(&vblk->c...
2019 Dec 11
0
[PATCH 15/24] compat_ioctl: scsi: move ioctl handling into drivers
...static int sd_ioctl(struct block_device *bdev, fmode_t mode, break; default: error = scsi_cmd_blk_ioctl(bdev, mode, cmd, p); - if (error != -ENOTTY) - break; - error = scsi_ioctl(sdp, cmd, p); break; } out: @@ -1691,39 +1687,31 @@ static void sd_rescan(struct device *dev) revalidate_disk(sdkp->disk); } +static int sd_ioctl(struct block_device *bdev, fmode_t mode, + unsigned int cmd, unsigned long arg) +{ + void __user *p = (void __user *)arg; + int ret; + + ret = sd_ioctl_common(bdev, mode, cmd, p); + if (ret != -ENOTTY) + return ret; + + return scsi_ioctl(scsi_disk(bde...
2019 Dec 11
3
[PATCH 00/24] block, scsi: final compat_ioctl cleanup
Hi Jens, James and Martin, This series concludes the work I did for linux-5.5 on the compat_ioctl() cleanup, killing off fs/compat_ioctl.c and block/compat_ioctl.c by moving everything into drivers. Overall this would be a reduction both in complexity and line count, but as I'm also adding documentation the overall number of lines increases in the end. My plan was originally to keep the
2020 Jan 02
1
[PATCH v3 13/22] compat_ioctl: scsi: move ioctl handling into drivers
...static int sd_ioctl(struct block_device *bdev, fmode_t mode, break; default: error = scsi_cmd_blk_ioctl(bdev, mode, cmd, p); - if (error != -ENOTTY) - break; - error = scsi_ioctl(sdp, cmd, p); break; } out: @@ -1691,39 +1687,31 @@ static void sd_rescan(struct device *dev) revalidate_disk(sdkp->disk); } +static int sd_ioctl(struct block_device *bdev, fmode_t mode, + unsigned int cmd, unsigned long arg) +{ + void __user *p = (void __user *)arg; + int ret; + + ret = sd_ioctl_common(bdev, mode, cmd, p); + if (ret != -ENOTTY) + return ret; + + return scsi_ioctl(scsi_disk(bde...
2012 Jul 04
1
[PATCH] virtio-blk: allow toggling host cache between writeback and writethrough
...io_device *vdev) > +{ > + u8 writeback = virtblk_get_cache_mode(vdev); > + struct virtio_blk *vblk = vdev->priv; > + > + if (writeback) > + blk_queue_flush(vblk->disk->queue, REQ_FLUSH); > + else > + blk_queue_flush(vblk->disk->queue, 0); > + > + revalidate_disk(vblk->disk); > +} > + > +static const char *virtblk_cache_types[] = { > + "write through", "write back" > +}; > + I wonder whether something that lacks space would have been better, especially for show: shells might get confused and split a string at a spac...
2012 Jul 04
1
[PATCH] virtio-blk: allow toggling host cache between writeback and writethrough
...io_device *vdev) > +{ > + u8 writeback = virtblk_get_cache_mode(vdev); > + struct virtio_blk *vblk = vdev->priv; > + > + if (writeback) > + blk_queue_flush(vblk->disk->queue, REQ_FLUSH); > + else > + blk_queue_flush(vblk->disk->queue, 0); > + > + revalidate_disk(vblk->disk); > +} > + > +static const char *virtblk_cache_types[] = { > + "write through", "write back" > +}; > + I wonder whether something that lacks space would have been better, especially for show: shells might get confused and split a string at a spac...
2012 Nov 19
0
[PATCH 247/493] drivers/block: remove use of __devinit
..., const struct of_device_id *match) { struct gendisk *disk; int index, rc; diff --git a/drivers/block/umem.c b/drivers/block/umem.c index eb0d821..970d107 100644 --- a/drivers/block/umem.c +++ b/drivers/block/umem.c @@ -789,7 +789,7 @@ static const struct block_device_operations mm_fops = { .revalidate_disk = mm_revalidate, }; -static int __devinit mm_pci_probe(struct pci_dev *dev, +static int mm_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) { int ret = -ENODEV; diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index dbba5cf..9f64e5cb 100644 --- a/drivers...
2012 Nov 19
0
[PATCH 247/493] drivers/block: remove use of __devinit
..., const struct of_device_id *match) { struct gendisk *disk; int index, rc; diff --git a/drivers/block/umem.c b/drivers/block/umem.c index eb0d821..970d107 100644 --- a/drivers/block/umem.c +++ b/drivers/block/umem.c @@ -789,7 +789,7 @@ static const struct block_device_operations mm_fops = { .revalidate_disk = mm_revalidate, }; -static int __devinit mm_pci_probe(struct pci_dev *dev, +static int mm_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) { int ret = -ENODEV; diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index dbba5cf..9f64e5cb 100644 --- a/drivers...
2011 Apr 04
18
[PATCH 00/22] Staging: hv: Cleanup storage drivers - Phase IV
More cleanup. In this patch-set we deal with the following issues: 1) While a Linux guest on Hyper-V can be assigned removable media devices (DVD, floppy etc), these devices are not handled by the Hyper-V block driver. So, we cleanup all the dead code dealing with removable media devices. 2) There were multiple functions to retrieve information about the device. Since much of
2011 Apr 04
18
[PATCH 00/22] Staging: hv: Cleanup storage drivers - Phase IV
More cleanup. In this patch-set we deal with the following issues: 1) While a Linux guest on Hyper-V can be assigned removable media devices (DVD, floppy etc), these devices are not handled by the Hyper-V block driver. So, we cleanup all the dead code dealing with removable media devices. 2) There were multiple functions to retrieve information about the device. Since much of
2014 Oct 06
25
[PATCH v2 00/15] virtio: fix spec compliance issues
Rusty, I have a mind to include this patchset for this merge window. Any input on this? This fixes the following virtio spec compliance issues: 1. on restore, drivers use device before setting ACKNOWLEDGE and DRIVER bits 2. on probe, drivers aren't prepared to handle config interrupts arriving before probe returns 3. on probe, drivers use device before DRIVER_OK it set Note that 1 is a