#
31a5990e |
| 06-Mar-2024 |
Duoming Zhou <duoming@zju.edu.cn> |
um: Fix return value in ubd_init()
When kmalloc_array() fails to allocate memory, the ubd_init() should return -ENOMEM instead of -1. So, fix it.
Fixes: f88f0bdfc32f ("um: UBD Improvements") Signed
um: Fix return value in ubd_init()
When kmalloc_array() fails to allocate memory, the ubd_init() should return -ENOMEM instead of -1. So, fix it.
Fixes: f88f0bdfc32f ("um: UBD Improvements") Signed-off-by: Duoming Zhou <duoming@zju.edu.cn> Reviewed-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Richard Weinberger <richard@nod.at>
show more ...
|
#
fb5d1d38 |
| 22-Feb-2024 |
Christoph Hellwig <hch@lst.de> |
ubd: open the backing files in ubd_add
Opening the backing device only when the block device is opened is a bit weird as no one configures block devices to not use them. Opend them at add time, clos
ubd: open the backing files in ubd_add
Opening the backing device only when the block device is opened is a bit weird as no one configures block devices to not use them. Opend them at add time, close them at remove time and remove the now superflous opened counter as remove can simply check for disk_openers.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Richard Weinberger <richard@nod.at> Link: https://lore.kernel.org/r/20240222072417.3773131-8-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
#
f3c17dcc |
| 22-Feb-2024 |
Christoph Hellwig <hch@lst.de> |
ubd: remove the queue pointer in struct ubd
No need for it now, everything goes through the gendisk.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Richard Weinberger <richard@nod.at> L
ubd: remove the queue pointer in struct ubd
No need for it now, everything goes through the gendisk.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Richard Weinberger <richard@nod.at> Link: https://lore.kernel.org/r/20240222072417.3773131-7-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
#
5e4e1ff8 |
| 22-Feb-2024 |
Christoph Hellwig <hch@lst.de> |
ubd: move set_disk_ro to ubd_add
No need to delay this until open time.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Richard Weinberger <richard@nod.at> Link: https://lore.kernel.org/
ubd: move set_disk_ro to ubd_add
No need to delay this until open time.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Richard Weinberger <richard@nod.at> Link: https://lore.kernel.org/r/20240222072417.3773131-6-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
#
58ebe3e7 |
| 22-Feb-2024 |
Christoph Hellwig <hch@lst.de> |
ubd: move setting the variable queue limits to ubd_add
No reason to delay this until open time.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Richard Weinberger <richard@nod.at> Link:
ubd: move setting the variable queue limits to ubd_add
No reason to delay this until open time.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Richard Weinberger <richard@nod.at> Link: https://lore.kernel.org/r/20240222072417.3773131-5-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
#
b8b364d2 |
| 22-Feb-2024 |
Christoph Hellwig <hch@lst.de> |
ubd: move setting the nonrot flag to ubd_add
No reason to delay this until open time.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Richard Weinberger <richard@nod.at> Link: https://lo
ubd: move setting the nonrot flag to ubd_add
No reason to delay this until open time.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Richard Weinberger <richard@nod.at> Link: https://lore.kernel.org/r/20240222072417.3773131-4-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
#
0267e9ca |
| 22-Feb-2024 |
Christoph Hellwig <hch@lst.de> |
ubd: remove ubd_disk_register
Fold it into the only caller to remove lots of references to the global ubd_devs array.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Richard Weinberger <
ubd: remove ubd_disk_register
Fold it into the only caller to remove lots of references to the global ubd_devs array.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Richard Weinberger <richard@nod.at> Link: https://lore.kernel.org/r/20240222072417.3773131-3-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
#
32621ad7 |
| 22-Feb-2024 |
Christoph Hellwig <hch@lst.de> |
ubd: remove the ubd_gendisk array
And add a disk pointer to the ubd structure instead to keep all the per-device information together.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Ric
ubd: remove the ubd_gendisk array
And add a disk pointer to the ubd structure instead to keep all the per-device information together.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Richard Weinberger <richard@nod.at> Link: https://lore.kernel.org/r/20240222072417.3773131-2-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
#
5d6789ce |
| 15-Feb-2024 |
Christoph Hellwig <hch@lst.de> |
ubd: pass queue_limits to blk_mq_alloc_disk
Pass the few limits ubd imposes directly to blk_mq_alloc_disk instead of setting them one at a time.
Signed-off-by: Christoph Hellwig <hch@lst.de> Link:
ubd: pass queue_limits to blk_mq_alloc_disk
Pass the few limits ubd imposes directly to blk_mq_alloc_disk instead of setting them one at a time.
Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20240215070300.2200308-2-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
#
27e32cd2 |
| 13-Feb-2024 |
Christoph Hellwig <hch@lst.de> |
block: pass a queue_limits argument to blk_mq_alloc_disk
Pass a queue_limits to blk_mq_alloc_disk and apply it if non-NULL. This will allow allocating queues with valid queue limits instead of sett
block: pass a queue_limits argument to blk_mq_alloc_disk
Pass a queue_limits to blk_mq_alloc_disk and apply it if non-NULL. This will allow allocating queues with valid queue limits instead of setting the values one at a time later.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Keith Busch <kbusch@kernel.org> Reviewed-by: John Garry <john.g.garry@oracle.com> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Reviewed-by: Ming Lei <ming.lei@redhat.com> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Link: https://lore.kernel.org/r/20240213073425.1621680-11-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
#
599d9d4e |
| 28-Dec-2023 |
Christoph Hellwig <hch@lst.de> |
ubd: use the default discard granularity
The discard granularity now defaults to a single sector, so don't set that value explicitly.
Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Richard
ubd: use the default discard granularity
The discard granularity now defaults to a single sector, so don't set that value explicitly.
Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Richard Weinberger <richard@nod.at> Link: https://lore.kernel.org/r/20231228075545.362768-5-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
#
05bdb996 |
| 08-Jun-2023 |
Christoph Hellwig <hch@lst.de> |
block: replace fmode_t with a block-specific type for block open flags
The only overlap between the block open flags mapped into the fmode_t and other uses of fmode_t are FMODE_READ and FMODE_WRITE.
block: replace fmode_t with a block-specific type for block open flags
The only overlap between the block open flags mapped into the fmode_t and other uses of fmode_t are FMODE_READ and FMODE_WRITE. Define a new blk_mode_t instead for use in blkdev_get_by_{dev,path}, ->open and ->ioctl and stop abusing fmode_t.
Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Jack Wang <jinpu.wang@ionos.com> [rnbd] Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Christian Brauner <brauner@kernel.org> Link: https://lore.kernel.org/r/20230608110258.189493-28-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
#
bd6abfc8 |
| 08-Jun-2023 |
Christoph Hellwig <hch@lst.de> |
ubd: remove commented out code in ubd_open
This code has been dead forever, make sure it doesn't show up in code searches.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke
ubd: remove commented out code in ubd_open
This code has been dead forever, make sure it doesn't show up in code searches.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Acked-by: Christian Brauner <brauner@kernel.org> Acked-by: Richard Weinberger <richard@nod.at> Link: https://lore.kernel.org/r/20230608110258.189493-25-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
#
ae220766 |
| 08-Jun-2023 |
Christoph Hellwig <hch@lst.de> |
block: remove the unused mode argument to ->release
The mode argument to the ->release block_device_operation is never used, so remove it.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by:
block: remove the unused mode argument to ->release
The mode argument to the ->release block_device_operation is never used, so remove it.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Acked-by: Christian Brauner <brauner@kernel.org> Acked-by: Jack Wang <jinpu.wang@ionos.com> [rnbd] Link: https://lore.kernel.org/r/20230608110258.189493-10-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
#
d32e2bf8 |
| 08-Jun-2023 |
Christoph Hellwig <hch@lst.de> |
block: pass a gendisk to ->open
->open is only called on the whole device. Make that explicit by passing a gendisk instead of the block_device.
Signed-off-by: Christoph Hellwig <hch@lst.de> Review
block: pass a gendisk to ->open
->open is only called on the whole device. Make that explicit by passing a gendisk instead of the block_device.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Acked-by: Christian Brauner <brauner@kernel.org> Acked-by: Jack Wang <jinpu.wang@ionos.com> [rnbd] Link: https://lore.kernel.org/r/20230608110258.189493-9-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
#
4dc5a328 |
| 20-Jul-2022 |
Xin Gao <gaoxin@cdjrlc.com> |
um: Do not initialise statics to 0.
do not initialise statics to 0.
Signed-off-by: Xin Gao <gaoxin@cdjrlc.com> Signed-off-by: Richard Weinberger <richard@nod.at>
|
#
7ee1de6e |
| 14-Jul-2022 |
Bart Van Assche <bvanassche@acm.org> |
um: Use enum req_op where appropriate
Improve static type checking by using type enum req_op instead of int where appropriate.
Cc: Richard Weinberger <richard@nod.at> Cc: Anton Ivanov <anton.ivanov
um: Use enum req_op where appropriate
Improve static type checking by using type enum req_op instead of int where appropriate.
Cc: Richard Weinberger <richard@nod.at> Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20220714180729.1065367-21-bvanassche@acm.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
#
8b9ab626 |
| 19-Jun-2022 |
Christoph Hellwig <hch@lst.de> |
block: remove blk_cleanup_disk
blk_cleanup_disk is nothing but a trivial wrapper for put_disk now, so remove it.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@sus
block: remove blk_cleanup_disk
blk_cleanup_disk is nothing but a trivial wrapper for put_disk now, so remove it.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Link: https://lore.kernel.org/r/20220619060552.1850436-7-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
#
07c6e92a |
| 18-Apr-2022 |
Christoph Hellwig <hch@lst.de> |
ubd: don't set the discard_alignment queue limit
The discard_alignment queue limit is named a bit misleading means the offset into the block device at which the discard granularity starts. Setting i
ubd: don't set the discard_alignment queue limit
The discard_alignment queue limit is named a bit misleading means the offset into the block device at which the discard granularity starts. Setting it to the discard granularity as done by ubd is mostly harmless but also useless.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Link: https://lore.kernel.org/r/20220418045314.360785-2-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
#
70200574 |
| 15-Apr-2022 |
Christoph Hellwig <hch@lst.de> |
block: remove QUEUE_FLAG_DISCARD
Just use a non-zero max_discard_sectors as an indicator for discard support, similar to what is done for write zeroes.
The only places where needs special attention
block: remove QUEUE_FLAG_DISCARD
Just use a non-zero max_discard_sectors as an indicator for discard support, similar to what is done for write zeroes.
The only places where needs special attention is the RAID5 driver, which must clear discard support for security reasons by default, even if the default stacking rules would allow for it.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Acked-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com> [drbd] Acked-by: Jan Höppner <hoeppner@linux.ibm.com> [s390] Acked-by: Coly Li <colyli@suse.de> [bcache] Acked-by: David Sterba <dsterba@suse.com> [btrfs] Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Link: https://lore.kernel.org/r/20220415045258.199825-25-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
#
d2a0a616 |
| 25-Jan-2022 |
Frédéric Danis <frederic.danis@collabora.com> |
um: Fix WRITE_ZEROES in the UBD Driver
Call to fallocate with FALLOC_FL_PUNCH_HOLE on a device backed by a sparse file can end up by missing data, zeroes data range, if the underlying file is used w
um: Fix WRITE_ZEROES in the UBD Driver
Call to fallocate with FALLOC_FL_PUNCH_HOLE on a device backed by a sparse file can end up by missing data, zeroes data range, if the underlying file is used with a tool like bmaptool which will referenced only used spaces.
Signed-off-by: Frédéric Danis <frederic.danis@collabora.com> Acked-by: Anton Ivanov <anton.ivanov@cambridgegreys.com> Signed-off-by: Richard Weinberger <richard@nod.at>
show more ...
|
#
66638f16 |
| 15-Oct-2021 |
Luis Chamberlain <mcgrof@kernel.org> |
um/drivers/ubd_kern: add error handling support for add_disk()
We never checked for errors on add_disk() as this function returned void. Now that this is fixed, use the shiny new error handling.
ub
um/drivers/ubd_kern: add error handling support for add_disk()
We never checked for errors on add_disk() as this function returned void. Now that this is fixed, use the shiny new error handling.
ubd_disk_register() never returned an error, so just fix that now and let the caller handle the error condition.
Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.com> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org> Link: https://lore.kernel.org/r/20211015233028.2167651-8-mcgrof@kernel.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
#
b81e0c23 |
| 20-Sep-2021 |
Christoph Hellwig <hch@lst.de> |
block: drop unused includes in <linux/genhd.h>
Drop various include not actually used in genhd.h itself, and move the remaning includes closer together.
Signed-off-by: Christoph Hellwig <hch@lst.de
block: drop unused includes in <linux/genhd.h>
Drop various include not actually used in genhd.h itself, and move the remaning includes closer together.
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Link: https://lore.kernel.org/r/20210920123328.1399408-15-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
#
25d84545 |
| 04-Aug-2021 |
Christoph Hellwig <hch@lst.de> |
ubd: use bvec_virt
Use bvec_virt instead of open coding it.
Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com> Link: https://lore.kernel.org/r/20
ubd: use bvec_virt
Use bvec_virt instead of open coding it.
Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com> Link: https://lore.kernel.org/r/20210804095634.460779-12-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|
#
efee99e6 |
| 28-Jun-2021 |
Christoph Hellwig <hch@lst.de> |
ubd: remove dead code in ubd_setup_common
Remove some leftovers of the fake major number parsing that cause complains from some compilers.
Fixes: 2933a1b2c6f3 ("ubd: remove the code to register as
ubd: remove dead code in ubd_setup_common
Remove some leftovers of the fake major number parsing that cause complains from some compilers.
Fixes: 2933a1b2c6f3 ("ubd: remove the code to register as the legacy IDE driver") Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20210628093937.1325608-1-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
show more ...
|