Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115482
b: refs/heads/master
c: 0fc71e3
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jens Axboe committed Oct 17, 2008
1 parent 31dd883 commit 58e6dd2
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: 0e11e342bac31f51ea055b147d20f77b59b9dd2c
refs/heads/master: 0fc71e3d6520ba7abad5cfbc9a33db0190e4d5b8
10 changes: 10 additions & 0 deletions trunk/fs/partitions/check.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,14 @@ check_partition(struct gendisk *hd, struct block_device *bdev)
return ERR_PTR(res);
}

static ssize_t part_partition_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct hd_struct *p = dev_to_part(dev);

return sprintf(buf, "%d\n", p->partno);
}

static ssize_t part_start_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
Expand Down Expand Up @@ -260,6 +268,7 @@ ssize_t part_fail_store(struct device *dev,
}
#endif

static DEVICE_ATTR(partition, S_IRUGO, part_partition_show, NULL);
static DEVICE_ATTR(start, S_IRUGO, part_start_show, NULL);
static DEVICE_ATTR(size, S_IRUGO, part_size_show, NULL);
static DEVICE_ATTR(stat, S_IRUGO, part_stat_show, NULL);
Expand All @@ -269,6 +278,7 @@ static struct device_attribute dev_attr_fail =
#endif

static struct attribute *part_attrs[] = {
&dev_attr_partition.attr,
&dev_attr_start.attr,
&dev_attr_size.attr,
&dev_attr_stat.attr,
Expand Down

0 comments on commit 58e6dd2

Please sign in to comment.