Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 98886
b: refs/heads/master
c: 1c9ce52
h: refs/heads/master
v: v3
  • Loading branch information
Kay Sievers authored and Jens Axboe committed Jul 3, 2008
1 parent 3638ddc commit d70cea1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 02c62304e6af60f1963695c6bc1bbffe619aa585
refs/heads/master: 1c9ce5276324ae566ca409491b99a2cc8d5986fa
10 changes: 10 additions & 0 deletions trunk/block/genhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,14 @@ static ssize_t disk_removable_show(struct device *dev,
(disk->flags & GENHD_FL_REMOVABLE ? 1 : 0));
}

static ssize_t disk_ro_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct gendisk *disk = dev_to_disk(dev);

return sprintf(buf, "%d\n", disk->policy ? 1 : 0);
}

static ssize_t disk_size_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
Expand Down Expand Up @@ -472,6 +480,7 @@ static ssize_t disk_fail_store(struct device *dev,

static DEVICE_ATTR(range, S_IRUGO, disk_range_show, NULL);
static DEVICE_ATTR(removable, S_IRUGO, disk_removable_show, NULL);
static DEVICE_ATTR(ro, S_IRUGO, disk_ro_show, NULL);
static DEVICE_ATTR(size, S_IRUGO, disk_size_show, NULL);
static DEVICE_ATTR(capability, S_IRUGO, disk_capability_show, NULL);
static DEVICE_ATTR(stat, S_IRUGO, disk_stat_show, NULL);
Expand All @@ -483,6 +492,7 @@ static struct device_attribute dev_attr_fail =
static struct attribute *disk_attrs[] = {
&dev_attr_range.attr,
&dev_attr_removable.attr,
&dev_attr_ro.attr,
&dev_attr_size.attr,
&dev_attr_capability.attr,
&dev_attr_stat.attr,
Expand Down

0 comments on commit d70cea1

Please sign in to comment.