Displaying 20 results from an estimated 36 matches for "alignment_offset".
2011 Jun 01
6
[PATCH 1/1] [virt] virtio-blk: Use ida to allocate disk index
...g. */
struct list_head reqs;
@@ -343,12 +348,26 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
struct request_queue *q;
int err;
u64 cap;
- u32 v, blk_size, sg_elems, opt_io_size;
+ u32 v, blk_size, sg_elems, opt_io_size, index;
u16 min_io_size;
u8 physical_block_exp, alignment_offset;
- if (index_to_minor(index) >= 1 << MINORBITS)
- return -ENOSPC;
+ do {
+ if (!ida_pre_get(&vd_index_ida, GFP_KERNEL))
+ return err;
+
+ spin_lock(&vd_index_lock);
+ err = ida_get_new(&vd_index_ida, &index);
+ spin_unlock(&vd_index_lock);
+ } while (err == -EA...
2011 Jun 01
6
[PATCH 1/1] [virt] virtio-blk: Use ida to allocate disk index
...g. */
struct list_head reqs;
@@ -343,12 +348,26 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
struct request_queue *q;
int err;
u64 cap;
- u32 v, blk_size, sg_elems, opt_io_size;
+ u32 v, blk_size, sg_elems, opt_io_size, index;
u16 min_io_size;
u8 physical_block_exp, alignment_offset;
- if (index_to_minor(index) >= 1 << MINORBITS)
- return -ENOSPC;
+ do {
+ if (!ida_pre_get(&vd_index_ida, GFP_KERNEL))
+ return err;
+
+ spin_lock(&vd_index_lock);
+ err = ida_get_new(&vd_index_ida, &index);
+ spin_unlock(&vd_index_lock);
+ } while (err == -EA...
2020 Aug 05
1
[PATCH v3 06/38] virtio_blk: correct tags for config space fields
...f device (if VIRTIO_BLK_F_BLK_SIZE) */
- __u32 blk_size;
+ __virtio32 blk_size;
/* the next 4 entries are guarded by VIRTIO_BLK_F_TOPOLOGY */
/* exponent for physical block per logical block. */
@@ -78,42 +78,42 @@ struct virtio_blk_config {
/* alignment offset in logical blocks. */
__u8 alignment_offset;
/* minimum I/O size without performance penalty in logical blocks. */
- __u16 min_io_size;
+ __virtio16 min_io_size;
/* optimal sustained I/O size in logical blocks. */
- __u32 opt_io_size;
+ __virtio32 opt_io_size;
/* writeback mode (if VIRTIO_BLK_F_CONFIG_WCE) */
__u8 wce;
__u8 unuse...
2017 Mar 01
3
[systemd-devel] udev virtio by-path naming
...That reports the following,
given a basic Fedora 25 guest, with a virtio-mmio disk added as per the
guide above...
looking at device '/devices/platform/a003e00.virtio_mmio/virtio3/block/vda':
KERNEL=="vda"
SUBSYSTEM=="block"
DRIVER==""
ATTR{alignment_offset}=="0"
ATTR{badblocks}==""
ATTR{cache_type}=="write back"
ATTR{capability}=="50"
ATTR{discard_alignment}=="0"
ATTR{ext_range}=="256"
ATTR{inflight}==" 0 0"
ATTR{range}=="16"
A...
2017 Mar 01
3
[systemd-devel] udev virtio by-path naming
...That reports the following,
given a basic Fedora 25 guest, with a virtio-mmio disk added as per the
guide above...
looking at device '/devices/platform/a003e00.virtio_mmio/virtio3/block/vda':
KERNEL=="vda"
SUBSYSTEM=="block"
DRIVER==""
ATTR{alignment_offset}=="0"
ATTR{badblocks}==""
ATTR{cache_type}=="write back"
ATTR{capability}=="50"
ATTR{discard_alignment}=="0"
ATTR{ext_range}=="256"
ATTR{inflight}==" 0 0"
ATTR{range}=="16"
A...
2018 Jan 31
0
systemd-udevd not applying ATTR to block device at boot
...14877 938 923845 15717 2732 310 82984 4328 0 9685 20033"
ATTR{range}=="16"
ATTR{discard_alignment}=="0"
ATTR{events}==""
ATTR{ext_range}=="256"
ATTR{events_poll_msecs}=="-1"
ATTR{alignment_offset}=="0"
ATTR{badblocks}==""
ATTR{inflight}==" 0 0"
ATTR{removable}=="0"
ATTR{capability}=="50"
ATTR{events_async}==""
looking at parent device '/devices/pci0000:00/0000:00:03.0/virtio0/host0/target0:0:...
2018 Jan 03
1
[PATCH] virtio_blk: print capacity at probe time
...object_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 physical_block_exp, alignment_offset;
@@ -719,17 +727,6 @@ static int virtblk_probe(struct virtio_device *vdev)
if (virtio_has_feature(vdev, VIRTIO_BLK_F_RO))
set_disk_ro(vblk->disk, 1);
- /* Host must always specify the capacity. */
- virtio_cread(vdev, struct virtio_blk_config, capacity, &cap);
-
- /* If capacity is to...
2016 Aug 17
0
[PATCH 09/15] virtio-blk: Pass attribute group to device_add_disk
...lk_attr_group_rw = {
+ .attrs = virtblk_attrs_rw,
+};
+
static int virtblk_probe(struct virtio_device *vdev)
{
struct virtio_blk *vblk;
@@ -560,6 +580,7 @@ static int virtblk_probe(struct virtio_device *vdev)
u32 v, blk_size, sg_elems, opt_io_size;
u16 min_io_size;
u8 physical_block_exp, alignment_offset;
+ struct attribute_group *attr_group;
if (!vdev->config->get) {
dev_err(&vdev->dev, "%s failure: config access disabled\n",
@@ -719,19 +740,14 @@ static int virtblk_probe(struct virtio_device *vdev)
virtio_device_ready(vdev);
- device_add_disk(&vdev->dev,...
2019 Feb 07
0
[PATCH v7 5/5] virtio-blk: Consider virtio_max_dma_size() for maximum segment size
...io_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -723,7 +723,7 @@ static int virtblk_probe(struct virtio_device *vdev)
struct request_queue *q;
int err, index;
- u32 v, blk_size, sg_elems, opt_io_size;
+ u32 v, blk_size, max_size, sg_elems, opt_io_size;
u16 min_io_size;
u8 physical_block_exp, alignment_offset;
@@ -826,14 +826,16 @@ static int virtblk_probe(struct virtio_device *vdev)
/* No real sector limit. */
blk_queue_max_hw_sectors(q, -1U);
+ max_size = virtio_max_dma_size(vdev);
+
/* Host can optionally specify maximum segment size and number of
* segments. */
err = virtio_cread_feat...
2020 Aug 03
0
[PATCH v2 06/24] virtio_blk: correct tags for config space fields
...f device (if VIRTIO_BLK_F_BLK_SIZE) */
- __u32 blk_size;
+ __virtio32 blk_size;
/* the next 4 entries are guarded by VIRTIO_BLK_F_TOPOLOGY */
/* exponent for physical block per logical block. */
@@ -78,42 +78,42 @@ struct virtio_blk_config {
/* alignment offset in logical blocks. */
__u8 alignment_offset;
/* minimum I/O size without performance penalty in logical blocks. */
- __u16 min_io_size;
+ __virtio16 min_io_size;
/* optimal sustained I/O size in logical blocks. */
- __u32 opt_io_size;
+ __virtio32 opt_io_size;
/* writeback mode (if VIRTIO_BLK_F_CONFIG_WCE) */
__u8 wce;
__u8 unuse...
2023 Sep 04
1
[PATCH] virtio-blk: fix implicit overflow on virtio_max_dma_size
...n(-)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 1fe011676d07..4a4b9bad551e 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -1313,6 +1313,7 @@ static int virtblk_probe(struct virtio_device *vdev)
u16 min_io_size;
u8 physical_block_exp, alignment_offset;
unsigned int queue_depth;
+ size_t max_dma_size;
if (!vdev->config->get) {
dev_err(&vdev->dev, "%s failure: config access disabled\n",
@@ -1411,7 +1412,8 @@ static int virtblk_probe(struct virtio_device *vdev)
/* No real sector limit. */
blk_queue_max_hw_sectors...
2015 Jan 13
0
[PATCH 2/6] virtio/blk: verify device has config space
...6 insertions(+)
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 7ef7c09..7164da8 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -575,6 +575,12 @@ static int virtblk_probe(struct virtio_device *vdev)
u16 min_io_size;
u8 physical_block_exp, alignment_offset;
+ if (!vdev->config->get) {
+ dev_err(&vdev->dev, "%s failure: config access disabled\n",
+ __func__);
+ return -EINVAL;
+ }
+
err = ida_simple_get(&vd_index_ida, 0, minor_to_index(1 << MINORBITS),
GFP_KERNEL);
if (err < 0)
--
MST
2018 May 23
3
[PATCH] block drivers/block: Use octal not symbolic permissions
...S_IRUGO, disk_ext_range_show, NULL);
-static DEVICE_ATTR(removable, S_IRUGO, disk_removable_show, NULL);
-static DEVICE_ATTR(hidden, S_IRUGO, disk_hidden_show, NULL);
-static DEVICE_ATTR(ro, S_IRUGO, disk_ro_show, NULL);
-static DEVICE_ATTR(size, S_IRUGO, part_size_show, NULL);
-static DEVICE_ATTR(alignment_offset, S_IRUGO, disk_alignment_offset_show, NULL);
-static DEVICE_ATTR(discard_alignment, S_IRUGO, disk_discard_alignment_show,
- NULL);
-static DEVICE_ATTR(capability, S_IRUGO, disk_capability_show, NULL);
-static DEVICE_ATTR(stat, S_IRUGO, part_stat_show, NULL);
-static DEVICE_ATTR(inflight, S_IRUG...
2018 May 23
3
[PATCH] block drivers/block: Use octal not symbolic permissions
...S_IRUGO, disk_ext_range_show, NULL);
-static DEVICE_ATTR(removable, S_IRUGO, disk_removable_show, NULL);
-static DEVICE_ATTR(hidden, S_IRUGO, disk_hidden_show, NULL);
-static DEVICE_ATTR(ro, S_IRUGO, disk_ro_show, NULL);
-static DEVICE_ATTR(size, S_IRUGO, part_size_show, NULL);
-static DEVICE_ATTR(alignment_offset, S_IRUGO, disk_alignment_offset_show, NULL);
-static DEVICE_ATTR(discard_alignment, S_IRUGO, disk_discard_alignment_show,
- NULL);
-static DEVICE_ATTR(capability, S_IRUGO, disk_capability_show, NULL);
-static DEVICE_ATTR(stat, S_IRUGO, part_stat_show, NULL);
-static DEVICE_ATTR(inflight, S_IRUG...
2017 Mar 01
0
[systemd-devel] udev virtio by-path naming
...a basic Fedora 25 guest, with a virtio-mmio disk added as per the
> guide above...
>
> looking at device '/devices/platform/a003e00.virtio_mmio/virtio3/block/vda':
> KERNEL=="vda"
> SUBSYSTEM=="block"
> DRIVER==""
> ATTR{alignment_offset}=="0"
> ATTR{badblocks}==""
> ATTR{cache_type}=="write back"
> ATTR{capability}=="50"
> ATTR{discard_alignment}=="0"
> ATTR{ext_range}=="256"
> ATTR{inflight}==" 0 0"
>...
2011 Oct 30
2
[PATCHv4] virtio-blk: use ida to allocate disk index
..._attribute *attr, char *buf)
{
@@ -341,14 +352,17 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
{
struct virtio_blk *vblk;
struct request_queue *q;
- int err;
+ int err, index;
u64 cap;
u32 v, blk_size, sg_elems, opt_io_size;
u16 min_io_size;
u8 physical_block_exp, alignment_offset;
- if (index_to_minor(index) >= 1 << MINORBITS)
- return -ENOSPC;
+ err = ida_simple_get(&vd_index_ida, 0, minor_to_index(1 << MINORBITS),
+ GFP_KERNEL);
+ if (err < 0)
+ goto out;
+ index = err;
/* We need to know how many segments before we allocate. */
err...
2011 Oct 30
2
[PATCHv4] virtio-blk: use ida to allocate disk index
..._attribute *attr, char *buf)
{
@@ -341,14 +352,17 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
{
struct virtio_blk *vblk;
struct request_queue *q;
- int err;
+ int err, index;
u64 cap;
u32 v, blk_size, sg_elems, opt_io_size;
u16 min_io_size;
u8 physical_block_exp, alignment_offset;
- if (index_to_minor(index) >= 1 << MINORBITS)
- return -ENOSPC;
+ err = ida_simple_get(&vd_index_ida, 0, minor_to_index(1 << MINORBITS),
+ GFP_KERNEL);
+ if (err < 0)
+ goto out;
+ index = err;
/* We need to know how many segments before we allocate. */
err...
2011 Jan 18
6
BUG while writing to USB btrfs filesystem
While untar''ing an image to an sd card via a reader, I got the
following bug. The system also has a btrfs root, and a whole swath of
processes went into uninterruptable sleep. I was able to poke around
via ssh and sysrq, and already had netconsole set up to capture the
bug.
Root fs is on /dev/sdi1, and /dev/sdj2 is the card reader which was
the target of the untar.
[29571.448889] sd
2013 Apr 05
8
[PATCH 0/7] virtio cleanups
Aiming these for coming merge window.
Nothing should change, but get ready for a non-guest-endian config transports,
and > 32 features bits.
Final one is just an overdue consolidation.
Cheers,
Rusty.
Rusty Russell (7):
virtio_config: introduce size-based accessors.
virtio: use size-based config accessors.
virtio_config: helpers for non-converting accessors.
virtio_config: make
2013 Apr 05
8
[PATCH 0/7] virtio cleanups
Aiming these for coming merge window.
Nothing should change, but get ready for a non-guest-endian config transports,
and > 32 features bits.
Final one is just an overdue consolidation.
Cheers,
Rusty.
Rusty Russell (7):
virtio_config: introduce size-based accessors.
virtio: use size-based config accessors.
virtio_config: helpers for non-converting accessors.
virtio_config: make