search for: set_capac

Displaying 20 results from an estimated 88 matches for "set_capac".

Did you mean: set_cap
2016 Aug 17
0
[PATCH 15/15] block: Add FIXME comment to handle device_add_disk error
...| 1 + 58 files changed, 60 insertions(+) diff --git a/arch/m68k/emu/nfblock.c b/arch/m68k/emu/nfblock.c index 29dfdd6..ec45cb6 100644 --- a/arch/m68k/emu/nfblock.c +++ b/arch/m68k/emu/nfblock.c @@ -138,6 +138,7 @@ static int __init nfhd_init_one(int id, u32 blocks, u32 bsize) set_capacity(dev->disk, (sector_t)blocks * (bsize / 512)); dev->disk->queue = dev->queue; + /* FIXME: handle error. */ device_add_disk(NULL, dev->disk, NULL); list_add_tail(&dev->list, &nfhd_list); diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index...
2016 Aug 17
20
[PATCH 00/15] Fix issue with KOBJ_ADD uevent versus disk attributes
This is an attempt to fix the issue that some disks' sysfs attributes are not ready at the time its KOBJ_ADD event is sent. The symptom is during device hotplug, udev may fail to find certain attributes, such as serial or wwn, of the disk. As a result the /dev/disk/by-id entries are not created. The cause is device_add_disk emits the uevent before returning, and the callers have to create
2016 Aug 17
20
[PATCH 00/15] Fix issue with KOBJ_ADD uevent versus disk attributes
This is an attempt to fix the issue that some disks' sysfs attributes are not ready at the time its KOBJ_ADD event is sent. The symptom is during device hotplug, udev may fail to find certain attributes, such as serial or wwn, of the disk. As a result the /dev/disk/by-id entries are not created. The cause is device_add_disk emits the uevent before returning, and the callers have to create
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 callers. So this adds a new helper to just
2016 Jun 30
17
[PATCH v2 00/12] gendisk: Generate uevent after attribute available
The race condition is noticed between disk_add() and disk attributes, on virtio-blk hotplug. Userspace listens to the KOBJ_ADD uevent generated in add_disk(). At that point we haven't created the serial attribute file, therefore depending on how fast udev reacts, the /dev/disk/by-id/ entry doesn't always get created. As pointed out by Christoph Hellwig in the specific fix [1], virtio-blk
2016 Jun 30
17
[PATCH v2 00/12] gendisk: Generate uevent after attribute available
The race condition is noticed between disk_add() and disk attributes, on virtio-blk hotplug. Userspace listens to the KOBJ_ADD uevent generated in add_disk(). At that point we haven't created the serial attribute file, therefore depending on how fast udev reacts, the /dev/disk/by-id/ entry doesn't always get created. As pointed out by Christoph Hellwig in the specific fix [1], virtio-blk
2018 Jan 03
1
[PATCH] virtio_blk: print capacity at probe time
...t;new size: %llu %d-byte logical blocks (%s/%s)\n", + "[%s] %s%llu %d-byte logical blocks (%s/%s)\n", + vblk->disk->disk_name, + resize ? "new size: " : "", nblocks, queue_logical_block_size(q), cap_str_10, cap_str_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...
2013 Feb 21
3
[PATCH] virtio-blk: emit udev event when device is resized
...eue *q = vblk->disk->queue; char 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
...eue *q = vblk->disk->queue; char 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
...%llu %d-byte logical blocks (%s/%s)\n", - (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
...%llu %d-byte logical blocks (%s/%s)\n", - (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
2016 Jun 30
1
[PATCH v2 04/12] axonrom: Generate uevent after attribute available
...) > > diff --git a/arch/powerpc/sysdev/axonram.c b/arch/powerpc/sysdev/axonram.c > index 4efd69b..27e7175 100644 > --- a/arch/powerpc/sysdev/axonram.c > +++ b/arch/powerpc/sysdev/axonram.c > @@ -238,7 +238,7 @@ static int axon_ram_probe(struct platform_device *device) > set_capacity(bank->disk, bank->size >> AXON_RAM_SECTOR_SHIFT); > blk_queue_make_request(bank->disk->queue, axon_ram_make_request); > blk_queue_logical_block_size(bank->disk->queue, AXON_RAM_SECTOR_SIZE); > - add_disk(bank->disk, true); > + ad...
2016 Jun 30
1
[PATCH v2 04/12] axonrom: Generate uevent after attribute available
...) > > diff --git a/arch/powerpc/sysdev/axonram.c b/arch/powerpc/sysdev/axonram.c > index 4efd69b..27e7175 100644 > --- a/arch/powerpc/sysdev/axonram.c > +++ b/arch/powerpc/sysdev/axonram.c > @@ -238,7 +238,7 @@ static int axon_ram_probe(struct platform_device *device) > set_capacity(bank->disk, bank->size >> AXON_RAM_SECTOR_SHIFT); > blk_queue_make_request(bank->disk->queue, axon_ram_make_request); > blk_queue_logical_block_size(bank->disk->queue, AXON_RAM_SECTOR_SIZE); > - add_disk(bank->disk, true); > + ad...
2011 Dec 07
2
[PATCH RFC] virtio_blk: fix config handler race
...+ goto done; + /* Host must always specify the capacity. */ vdev->config->get(vdev, offsetof(struct virtio_blk_config, capacity), &capacity, sizeof(capacity)); @@ -340,6 +351,8 @@ static void virtblk_config_changed_work(struct work_struct *work) cap_str_10, cap_str_2); set_capacity(vblk->disk, capacity); +done: + mutex_lock(&vblk->config_lock); } static void virtblk_config_changed(struct virtio_device *vdev) @@ -388,7 +401,9 @@ static int __devinit virtblk_probe(struct virtio_device *vdev) vblk->vdev = vdev; vblk->sg_elems = sg_elems; sg_init_tabl...
2011 Dec 07
2
[PATCH RFC] virtio_blk: fix config handler race
...+ goto done; + /* Host must always specify the capacity. */ vdev->config->get(vdev, offsetof(struct virtio_blk_config, capacity), &capacity, sizeof(capacity)); @@ -340,6 +351,8 @@ static void virtblk_config_changed_work(struct work_struct *work) cap_str_10, cap_str_2); set_capacity(vblk->disk, capacity); +done: + mutex_lock(&vblk->config_lock); } static void virtblk_config_changed(struct virtio_device *vdev) @@ -388,7 +401,9 @@ static int __devinit virtblk_probe(struct virtio_device *vdev) vblk->vdev = vdev; vblk->sg_elems = sg_elems; sg_init_tabl...
2013 May 13
22
[PATCH] xen-blk(front|back): Handle large physical sector disks
...6 vdisk_info, u16 sector_size) + u16 vdisk_info, u16 sector_size, + unsigned int physical_sector_size) { struct gendisk *gd; int nr_minors = 1; @@ -734,7 +737,7 @@ static int xlvbd_alloc_gendisk(blkif_sector_t capacity, gd->driverfs_dev = &(info->xbdev->dev); set_capacity(gd, capacity); - if (xlvbd_init_blk_queue(gd, sector_size)) { + if (xlvbd_init_blk_queue(gd, sector_size, physical_sector_size)) { del_gendisk(gd); goto release; } @@ -1395,6 +1398,7 @@ static void blkfront_connect(struct blkfront_info *info) { unsigned long long sectors; unsigned...
2016 Jun 30
0
[PATCH v2 04/12] axonrom: Generate uevent after attribute available
...e changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/sysdev/axonram.c b/arch/powerpc/sysdev/axonram.c index 4efd69b..27e7175 100644 --- a/arch/powerpc/sysdev/axonram.c +++ b/arch/powerpc/sysdev/axonram.c @@ -238,7 +238,7 @@ static int axon_ram_probe(struct platform_device *device) set_capacity(bank->disk, bank->size >> AXON_RAM_SECTOR_SHIFT); blk_queue_make_request(bank->disk->queue, axon_ram_make_request); blk_queue_logical_block_size(bank->disk->queue, AXON_RAM_SECTOR_SIZE); - add_disk(bank->disk, true); + add_disk(bank->disk, false); bank->i...
2017 Aug 04
0
[PATCH] virtio_blk: fix incorrect message when disk is resized
...- (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 > -------------- 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....
2014 Oct 05
0
[PATCH 06/16] virtio_blk: drop config_enable
...; mutex_lock(&vblk->config_lock); - 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-...
2014 Oct 05
0
[PATCH 07/16] virtio-blk: drop config_mutex
...ESIZE=1", NULL }; u64 capacity, size; - 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_...