Displaying 11 results from an estimated 11 matches for "dev_attr_cache_type_ro".
2016 Aug 17
0
[PATCH 09/15] virtio-blk: Pass attribute group to device_add_disk
....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_attribute dev_attr_cache_type_rw =
__ATTR(cache_type, S_IRUGO|S_IWUSR,
vi...
2012 Jul 04
1
[PATCH] virtio-blk: allow toggling host cache between writeback and writethrough
...lk_get_cache_mode(vblk->vdev);
> +
> + BUG_ON(writeback >= ARRAY_SIZE(virtblk_cache_types));
> + return snprintf(buf, 40, "%s\n", virtblk_cache_types[writeback]);
Why 40? Why snprintf? A plain sprintf won't do?
> +}
> +
> +static const 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 =
> + __ATTR(cache_type, S_IRUGO|S_IWUSR,
> + virtblk_cache_type_show, virtblk_cache_type_store);
> +
> static int __devinit virtb...
2012 Jul 04
1
[PATCH] virtio-blk: allow toggling host cache between writeback and writethrough
...lk_get_cache_mode(vblk->vdev);
> +
> + BUG_ON(writeback >= ARRAY_SIZE(virtblk_cache_types));
> + return snprintf(buf, 40, "%s\n", virtblk_cache_types[writeback]);
Why 40? Why snprintf? A plain sprintf won't do?
> +}
> +
> +static const 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 =
> + __ATTR(cache_type, S_IRUGO|S_IWUSR,
> + virtblk_cache_type_show, virtblk_cache_type_store);
> +
> static int __devinit virtb...
2016 Jun 28
2
[PATCH] virtio-blk: Generate uevent after attribute available
...+ b/drivers/block/virtio_blk.c
@@ -567,6 +567,7 @@ static int virtblk_probe(struct virtio_device *vdev)
{
struct virtio_blk *vblk;
struct request_queue *q;
+ struct device *ddev;
int err, index;
u64 cap;
@@ -746,6 +747,8 @@ static int virtblk_probe(struct virtio_device *vdev)
&dev_attr_cache_type_ro);
if (err)
goto out_del_disk;
+ ddev = disk_to_dev(vblk->disk);
+ kobject_uevent(&ddev->kobj, KOBJ_CHANGE);
return 0;
out_del_disk:
--
2.9.0
2016 Jun 28
2
[PATCH] virtio-blk: Generate uevent after attribute available
...+ b/drivers/block/virtio_blk.c
@@ -567,6 +567,7 @@ static int virtblk_probe(struct virtio_device *vdev)
{
struct virtio_blk *vblk;
struct request_queue *q;
+ struct device *ddev;
int err, index;
u64 cap;
@@ -746,6 +747,8 @@ static int virtblk_probe(struct virtio_device *vdev)
&dev_attr_cache_type_ro);
if (err)
goto out_del_disk;
+ ddev = disk_to_dev(vblk->disk);
+ kobject_uevent(&ddev->kobj, KOBJ_CHANGE);
return 0;
out_del_disk:
--
2.9.0
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
2018 May 23
3
[PATCH] block drivers/block: Use octal not symbolic permissions
..., NULL);
/* The queue's logical block size must be set before calling this */
static void virtblk_update_capacity(struct virtio_blk *vblk, bool resize)
@@ -576,10 +576,10 @@ virtblk_cache_type_show(struct device *dev, struct device_attribute *attr,
}
static const struct device_attribute dev_attr_cache_type_ro =
- __ATTR(cache_type, S_IRUGO,
+ __ATTR(cache_type, 0444,
virtblk_cache_type_show, NULL);
static const struct device_attribute dev_attr_cache_type_rw =
- __ATTR(cache_type, S_IRUGO|S_IWUSR,
+ __ATTR(cache_type, 0644,
virtblk_cache_type_show, virtblk_cache_type_store);
static...
2018 May 23
3
[PATCH] block drivers/block: Use octal not symbolic permissions
..., NULL);
/* The queue's logical block size must be set before calling this */
static void virtblk_update_capacity(struct virtio_blk *vblk, bool resize)
@@ -576,10 +576,10 @@ virtblk_cache_type_show(struct device *dev, struct device_attribute *attr,
}
static const struct device_attribute dev_attr_cache_type_ro =
- __ATTR(cache_type, S_IRUGO,
+ __ATTR(cache_type, 0444,
virtblk_cache_type_show, NULL);
static const struct device_attribute dev_attr_cache_type_rw =
- __ATTR(cache_type, S_IRUGO|S_IWUSR,
+ __ATTR(cache_type, 0644,
virtblk_cache_type_show, virtblk_cache_type_store);
static...
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