genhd.c (754451342fc5954061ede74b0a8485ec4a4c6eaa) genhd.c (5657a819a8d94426c76be04dcedfad0f64cfff00)
1/*
2 * gendisk handling
3 */
4
5#include <linux/module.h>
6#include <linux/fs.h>
7#include <linux/genhd.h>
8#include <linux/kdev_t.h>

--- 1125 unchanged lines hidden (view full) ---

1134 struct device_attribute *attr,
1135 char *buf)
1136{
1137 struct gendisk *disk = dev_to_disk(dev);
1138
1139 return sprintf(buf, "%d\n", queue_discard_alignment(disk->queue));
1140}
1141
1/*
2 * gendisk handling
3 */
4
5#include <linux/module.h>
6#include <linux/fs.h>
7#include <linux/genhd.h>
8#include <linux/kdev_t.h>

--- 1125 unchanged lines hidden (view full) ---

1134 struct device_attribute *attr,
1135 char *buf)
1136{
1137 struct gendisk *disk = dev_to_disk(dev);
1138
1139 return sprintf(buf, "%d\n", queue_discard_alignment(disk->queue));
1140}
1141
1142static DEVICE_ATTR(range, S_IRUGO, disk_range_show, NULL);
1143static DEVICE_ATTR(ext_range, S_IRUGO, disk_ext_range_show, NULL);
1144static DEVICE_ATTR(removable, S_IRUGO, disk_removable_show, NULL);
1145static DEVICE_ATTR(hidden, S_IRUGO, disk_hidden_show, NULL);
1146static DEVICE_ATTR(ro, S_IRUGO, disk_ro_show, NULL);
1147static DEVICE_ATTR(size, S_IRUGO, part_size_show, NULL);
1148static DEVICE_ATTR(alignment_offset, S_IRUGO, disk_alignment_offset_show, NULL);
1149static DEVICE_ATTR(discard_alignment, S_IRUGO, disk_discard_alignment_show,
1150 NULL);
1151static DEVICE_ATTR(capability, S_IRUGO, disk_capability_show, NULL);
1152static DEVICE_ATTR(stat, S_IRUGO, part_stat_show, NULL);
1153static DEVICE_ATTR(inflight, S_IRUGO, part_inflight_show, NULL);
1154static DEVICE_ATTR(badblocks, S_IRUGO | S_IWUSR, disk_badblocks_show,
1155 disk_badblocks_store);
1142static DEVICE_ATTR(range, 0444, disk_range_show, NULL);
1143static DEVICE_ATTR(ext_range, 0444, disk_ext_range_show, NULL);
1144static DEVICE_ATTR(removable, 0444, disk_removable_show, NULL);
1145static DEVICE_ATTR(hidden, 0444, disk_hidden_show, NULL);
1146static DEVICE_ATTR(ro, 0444, disk_ro_show, NULL);
1147static DEVICE_ATTR(size, 0444, part_size_show, NULL);
1148static DEVICE_ATTR(alignment_offset, 0444, disk_alignment_offset_show, NULL);
1149static DEVICE_ATTR(discard_alignment, 0444, disk_discard_alignment_show, NULL);
1150static DEVICE_ATTR(capability, 0444, disk_capability_show, NULL);
1151static DEVICE_ATTR(stat, 0444, part_stat_show, NULL);
1152static DEVICE_ATTR(inflight, 0444, part_inflight_show, NULL);
1153static DEVICE_ATTR(badblocks, 0644, disk_badblocks_show, disk_badblocks_store);
1156#ifdef CONFIG_FAIL_MAKE_REQUEST
1157static struct device_attribute dev_attr_fail =
1154#ifdef CONFIG_FAIL_MAKE_REQUEST
1155static struct device_attribute dev_attr_fail =
1158 __ATTR(make-it-fail, S_IRUGO|S_IWUSR, part_fail_show, part_fail_store);
1156 __ATTR(make-it-fail, 0644, part_fail_show, part_fail_store);
1159#endif
1160#ifdef CONFIG_FAIL_IO_TIMEOUT
1161static struct device_attribute dev_attr_fail_timeout =
1157#endif
1158#ifdef CONFIG_FAIL_IO_TIMEOUT
1159static struct device_attribute dev_attr_fail_timeout =
1162 __ATTR(io-timeout-fail, S_IRUGO|S_IWUSR, part_timeout_show,
1163 part_timeout_store);
1160 __ATTR(io-timeout-fail, 0644, part_timeout_show, part_timeout_store);
1164#endif
1165
1166static struct attribute *disk_attrs[] = {
1167 &dev_attr_range.attr,
1168 &dev_attr_ext_range.attr,
1169 &dev_attr_removable.attr,
1170 &dev_attr_hidden.attr,
1171 &dev_attr_ro.attr,

--- 747 unchanged lines hidden (view full) ---

1919
1920 disk_block_events(disk);
1921 disk->ev->poll_msecs = intv;
1922 __disk_unblock_events(disk, true);
1923
1924 return count;
1925}
1926
1161#endif
1162
1163static struct attribute *disk_attrs[] = {
1164 &dev_attr_range.attr,
1165 &dev_attr_ext_range.attr,
1166 &dev_attr_removable.attr,
1167 &dev_attr_hidden.attr,
1168 &dev_attr_ro.attr,

--- 747 unchanged lines hidden (view full) ---

1916
1917 disk_block_events(disk);
1918 disk->ev->poll_msecs = intv;
1919 __disk_unblock_events(disk, true);
1920
1921 return count;
1922}
1923
1927static const DEVICE_ATTR(events, S_IRUGO, disk_events_show, NULL);
1928static const DEVICE_ATTR(events_async, S_IRUGO, disk_events_async_show, NULL);
1929static const DEVICE_ATTR(events_poll_msecs, S_IRUGO|S_IWUSR,
1924static const DEVICE_ATTR(events, 0444, disk_events_show, NULL);
1925static const DEVICE_ATTR(events_async, 0444, disk_events_async_show, NULL);
1926static const DEVICE_ATTR(events_poll_msecs, 0644,
1930 disk_events_poll_msecs_show,
1931 disk_events_poll_msecs_store);
1932
1933static const struct attribute *disk_events_attrs[] = {
1934 &dev_attr_events.attr,
1935 &dev_attr_events_async.attr,
1936 &dev_attr_events_poll_msecs.attr,
1937 NULL,

--- 107 unchanged lines hidden ---
1927 disk_events_poll_msecs_show,
1928 disk_events_poll_msecs_store);
1929
1930static const struct attribute *disk_events_attrs[] = {
1931 &dev_attr_events.attr,
1932 &dev_attr_events_async.attr,
1933 &dev_attr_events_poll_msecs.attr,
1934 NULL,

--- 107 unchanged lines hidden ---