diff options
Diffstat (limited to 'block/genhd.c')
-rw-r--r-- | block/genhd.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/block/genhd.c b/block/genhd.c index 517e4332cb37..b11a4ad7d571 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
@@ -861,12 +861,23 @@ static ssize_t disk_alignment_offset_show(struct device *dev, | |||
861 | return sprintf(buf, "%d\n", queue_alignment_offset(disk->queue)); | 861 | return sprintf(buf, "%d\n", queue_alignment_offset(disk->queue)); |
862 | } | 862 | } |
863 | 863 | ||
864 | static ssize_t disk_discard_alignment_show(struct device *dev, | ||
865 | struct device_attribute *attr, | ||
866 | char *buf) | ||
867 | { | ||
868 | struct gendisk *disk = dev_to_disk(dev); | ||
869 | |||
870 | return sprintf(buf, "%u\n", queue_discard_alignment(disk->queue)); | ||
871 | } | ||
872 | |||
864 | static DEVICE_ATTR(range, S_IRUGO, disk_range_show, NULL); | 873 | static DEVICE_ATTR(range, S_IRUGO, disk_range_show, NULL); |
865 | static DEVICE_ATTR(ext_range, S_IRUGO, disk_ext_range_show, NULL); | 874 | static DEVICE_ATTR(ext_range, S_IRUGO, disk_ext_range_show, NULL); |
866 | static DEVICE_ATTR(removable, S_IRUGO, disk_removable_show, NULL); | 875 | static DEVICE_ATTR(removable, S_IRUGO, disk_removable_show, NULL); |
867 | static DEVICE_ATTR(ro, S_IRUGO, disk_ro_show, NULL); | 876 | static DEVICE_ATTR(ro, S_IRUGO, disk_ro_show, NULL); |
868 | static DEVICE_ATTR(size, S_IRUGO, part_size_show, NULL); | 877 | static DEVICE_ATTR(size, S_IRUGO, part_size_show, NULL); |
869 | static DEVICE_ATTR(alignment_offset, S_IRUGO, disk_alignment_offset_show, NULL); | 878 | static DEVICE_ATTR(alignment_offset, S_IRUGO, disk_alignment_offset_show, NULL); |
879 | static DEVICE_ATTR(discard_alignment, S_IRUGO, disk_discard_alignment_show, | ||
880 | NULL); | ||
870 | static DEVICE_ATTR(capability, S_IRUGO, disk_capability_show, NULL); | 881 | static DEVICE_ATTR(capability, S_IRUGO, disk_capability_show, NULL); |
871 | static DEVICE_ATTR(stat, S_IRUGO, part_stat_show, NULL); | 882 | static DEVICE_ATTR(stat, S_IRUGO, part_stat_show, NULL); |
872 | static DEVICE_ATTR(inflight, S_IRUGO, part_inflight_show, NULL); | 883 | static DEVICE_ATTR(inflight, S_IRUGO, part_inflight_show, NULL); |
@@ -887,6 +898,7 @@ static struct attribute *disk_attrs[] = { | |||
887 | &dev_attr_ro.attr, | 898 | &dev_attr_ro.attr, |
888 | &dev_attr_size.attr, | 899 | &dev_attr_size.attr, |
889 | &dev_attr_alignment_offset.attr, | 900 | &dev_attr_alignment_offset.attr, |
901 | &dev_attr_discard_alignment.attr, | ||
890 | &dev_attr_capability.attr, | 902 | &dev_attr_capability.attr, |
891 | &dev_attr_stat.attr, | 903 | &dev_attr_stat.attr, |
892 | &dev_attr_inflight.attr, | 904 | &dev_attr_inflight.attr, |