Displaying 15 results from an estimated 15 matches for "virtblk_cache_types".
2017 Jun 09
3
[PATCH v1] virtio_blk: Use sysfs_match_string() helper
...53cc4c542b4..0e707b8cce9d 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -541,12 +541,9 @@ virtblk_cache_type_store(struct device *dev, struct device_attribute *attr,
int i;
BUG_ON(!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_CONFIG_WCE));
- for (i = ARRAY_SIZE(virtblk_cache_types); --i >= 0; )
- if (sysfs_streq(buf, virtblk_cache_types[i]))
- break;
-
+ i = sysfs_match_string(virtblk_cache_types, buf);
if (i < 0)
- return -EINVAL;
+ return i;
virtio_cwrite8(vdev, offsetof(struct virtio_blk_config, wce), i);
virtblk_update_cache_mode(vdev);
--
2.11.0
2017 Jun 09
3
[PATCH v1] virtio_blk: Use sysfs_match_string() helper
...53cc4c542b4..0e707b8cce9d 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -541,12 +541,9 @@ virtblk_cache_type_store(struct device *dev, struct device_attribute *attr,
int i;
BUG_ON(!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_CONFIG_WCE));
- for (i = ARRAY_SIZE(virtblk_cache_types); --i >= 0; )
- if (sysfs_streq(buf, virtblk_cache_types[i]))
- break;
-
+ i = sysfs_match_string(virtblk_cache_types, buf);
if (i < 0)
- return -EINVAL;
+ return i;
virtio_cwrite8(vdev, offsetof(struct virtio_blk_config, wce), i);
virtblk_update_cache_mode(vdev);
--
2.11.0
2012 Jul 04
1
[PATCH] virtio-blk: allow toggling host cache between writeback and writethrough
...ev);
> + 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 space. How about we change it to writethrough,
writeback before it's too lat...
2012 Jul 04
1
[PATCH] virtio-blk: allow toggling host cache between writeback and writethrough
...ev);
> + 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 space. How about we change it to writethrough,
writeback before it's too lat...
2017 Jul 03
0
[PATCH v1] virtio_blk: Use sysfs_match_string() helper
...rivers/block/virtio_blk.c
> +++ b/drivers/block/virtio_blk.c
> @@ -541,12 +541,9 @@ virtblk_cache_type_store(struct device *dev,
> struct device_attribute *attr,
> ? int i;
> ?
> ? BUG_ON(!virtio_has_feature(vblk->vdev,
> VIRTIO_BLK_F_CONFIG_WCE));
> - for (i = ARRAY_SIZE(virtblk_cache_types); --i >= 0; )
> - if (sysfs_streq(buf, virtblk_cache_types[i]))
> - break;
> -
> + i = sysfs_match_string(virtblk_cache_types, buf);
> ? if (i < 0)
> - return -EINVAL;
> + return i;
> ?
> ? virtio_cwrite8(vdev, offsetof(struct virtio_blk_config, wce),
> i);...
2017 Jul 03
2
[PATCH v1] virtio_blk: Use sysfs_match_string() helper
...b/drivers/block/virtio_blk.c
> > @@ -541,12 +541,9 @@ virtblk_cache_type_store(struct device *dev,
> > struct device_attribute *attr,
> > ? int i;
> > ?
> > ? BUG_ON(!virtio_has_feature(vblk->vdev,
> > VIRTIO_BLK_F_CONFIG_WCE));
> > - for (i = ARRAY_SIZE(virtblk_cache_types); --i >= 0; )
> > - if (sysfs_streq(buf, virtblk_cache_types[i]))
> > - break;
> > -
> > + i = sysfs_match_string(virtblk_cache_types, buf);
> > ? if (i < 0)
> > - return -EINVAL;
> > + return i;
> > ?
> > ? virtio_cwrite8(vdev, offse...
2017 Jul 03
2
[PATCH v1] virtio_blk: Use sysfs_match_string() helper
...b/drivers/block/virtio_blk.c
> > @@ -541,12 +541,9 @@ virtblk_cache_type_store(struct device *dev,
> > struct device_attribute *attr,
> > ? int i;
> > ?
> > ? BUG_ON(!virtio_has_feature(vblk->vdev,
> > VIRTIO_BLK_F_CONFIG_WCE));
> > - for (i = ARRAY_SIZE(virtblk_cache_types); --i >= 0; )
> > - if (sysfs_streq(buf, virtblk_cache_types[i]))
> > - break;
> > -
> > + i = sysfs_match_string(virtblk_cache_types, buf);
> > ? if (i < 0)
> > - return -EINVAL;
> > + return i;
> > ?
> > ? virtio_cwrite8(vdev, offse...
2016 Aug 17
0
[PATCH 09/15] virtio-blk: Pass attribute group to device_add_disk
...git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
index 4564df5..ff60d82 100644
--- a/drivers/block/virtio_blk.c
+++ b/drivers/block/virtio_blk.c
@@ -522,10 +522,10 @@ virtblk_cache_type_show(struct device *dev, struct device_attribute *attr,
return snprintf(buf, 40, "%s\n", virtblk_cache_types[writeback]);
}
-static const struct device_attribute dev_attr_cache_type_ro =
+static struct device_attribute dev_attr_cache_type_ro =
__ATTR(cache_type, S_IRUGO,
virtblk_cache_type_show, NULL);
-static const struct device_attribute dev_attr_cache_type_rw =
+static struct device_attri...
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 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
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
2013 Mar 21
24
[PATCH 00/22] New virtio PCI layout
I've renewed this again, with some comments from HPA. I've tried to
keep the new patches separate, so you can see the changes since we
last discussed this (and so it's easy to back it out if we decide it's
insane).
I haven't even looked at the QEMU side so this is completely untested.
Comments gratefully received!
Rusty.
Michael S Tsirkin (1):
pci: add pci_iomap_range
2013 Mar 21
24
[PATCH 00/22] New virtio PCI layout
I've renewed this again, with some comments from HPA. I've tried to
keep the new patches separate, so you can see the changes since we
last discussed this (and so it's easy to back it out if we decide it's
insane).
I haven't even looked at the QEMU side so this is completely untested.
Comments gratefully received!
Rusty.
Michael S Tsirkin (1):
pci: add pci_iomap_range