search for: minor_to_index

Displaying 7 results from an estimated 7 matches for "minor_to_index".

2011 Oct 30
2
[PATCHv4] virtio-blk: use ida to allocate disk index
...unsigned int sg_elems; + /* Ida index - used to track minor number allocations. */ + int index; + /* Scatterlist: can be too big for stack. */ struct scatterlist sg[/*sg_elems*/]; }; @@ -276,6 +282,11 @@ static int index_to_minor(int index) return index << PART_BITS; } +static int minor_to_index(int minor) +{ + return minor >> PART_BITS; +} + static ssize_t virtblk_serial_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -341,14 +352,17 @@ static int __devinit virtblk_probe(struct virtio_device *vdev) { struct virtio_blk *vblk; struct request_queue *...
2011 Oct 30
2
[PATCHv4] virtio-blk: use ida to allocate disk index
...unsigned int sg_elems; + /* Ida index - used to track minor number allocations. */ + int index; + /* Scatterlist: can be too big for stack. */ struct scatterlist sg[/*sg_elems*/]; }; @@ -276,6 +282,11 @@ static int index_to_minor(int index) return index << PART_BITS; } +static int minor_to_index(int minor) +{ + return minor >> PART_BITS; +} + static ssize_t virtblk_serial_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -341,14 +352,17 @@ static int __devinit virtblk_probe(struct virtio_device *vdev) { struct virtio_blk *vblk; struct request_queue *...
2015 Jan 13
0
[PATCH 2/6] virtio/blk: verify device has config space
...lk_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
2015 Jan 13
8
[PATCH 0/6] virtio: graceful failure with get == NULL
virtio 1.0 says device configuration is optional, but most drivers treat it as mandatory. Even if presented by device, guest bios might disable the BAR holding that configuration, so we can't assume it's there, but we also don't want to fail if not in case drivers can cope with it's absence - such as caif or rng. Add code to drivers to check presence of get callback and fail
2015 Jan 13
8
[PATCH 0/6] virtio: graceful failure with get == NULL
virtio 1.0 says device configuration is optional, but most drivers treat it as mandatory. Even if presented by device, guest bios might disable the BAR holding that configuration, so we can't assume it's there, but we also don't want to fail if not in case drivers can cope with it's absence - such as caif or rng. Add code to drivers to check presence of get callback and fail
2015 Jan 14
22
[PATCH v3 00/16] virtio-pci: towards virtio 1.0 guest support
Changes since v2: handling for devices without config space (e.g. rng) reduce # of mappings for VQs These patches seem to work fine on my virtio-1.0 qemu branch. There haven't been any bugs since v2: just minor cleanups and enhancements. QEMU side is still undergoing polishing, but is already testable. Rusty, what do you think? Let's merge these for 3.20? Also - will you be doing that
2015 Jan 14
22
[PATCH v3 00/16] virtio-pci: towards virtio 1.0 guest support
Changes since v2: handling for devices without config space (e.g. rng) reduce # of mappings for VQs These patches seem to work fine on my virtio-1.0 qemu branch. There haven't been any bugs since v2: just minor cleanups and enhancements. QEMU side is still undergoing polishing, but is already testable. Rusty, what do you think? Let's merge these for 3.20? Also - will you be doing that