aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor_core@ameritech.net>2005-04-29 02:26:06 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-20 18:15:03 -0400
commit6c1852a08e444a2e66367352a99c0e93c8bf3e97 (patch)
treeffa075f75b7eb0e5b1399aeb8e34e6cf9a631a10 /drivers/block
parentfc7e4828995d8c9e4c9597f8a19179e4ab53f73e (diff)
[PATCH] sysfs: (driver/block) if show/store is missing return -EIO
sysfs: fix drivers/block so if an attribute doesn't implement show or store method read/write will return -EIO instead of 0 or -EINVAL. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/as-iosched.c4
-rw-r--r--drivers/block/cfq-iosched.c4
-rw-r--r--drivers/block/deadline-iosched.c4
-rw-r--r--drivers/block/genhd.c2
-rw-r--r--drivers/block/ll_rw_blk.c4
5 files changed, 9 insertions, 9 deletions
diff --git a/drivers/block/as-iosched.c b/drivers/block/as-iosched.c
index a9575bb58a5..638db06de2b 100644
--- a/drivers/block/as-iosched.c
+++ b/drivers/block/as-iosched.c
@@ -2044,7 +2044,7 @@ as_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
2044 struct as_fs_entry *entry = to_as(attr); 2044 struct as_fs_entry *entry = to_as(attr);
2045 2045
2046 if (!entry->show) 2046 if (!entry->show)
2047 return 0; 2047 return -EIO;
2048 2048
2049 return entry->show(e->elevator_data, page); 2049 return entry->show(e->elevator_data, page);
2050} 2050}
@@ -2057,7 +2057,7 @@ as_attr_store(struct kobject *kobj, struct attribute *attr,
2057 struct as_fs_entry *entry = to_as(attr); 2057 struct as_fs_entry *entry = to_as(attr);
2058 2058
2059 if (!entry->store) 2059 if (!entry->store)
2060 return -EINVAL; 2060 return -EIO;
2061 2061
2062 return entry->store(e->elevator_data, page, length); 2062 return entry->store(e->elevator_data, page, length);
2063} 2063}
diff --git a/drivers/block/cfq-iosched.c b/drivers/block/cfq-iosched.c
index 2210bacad56..3ac47dde64d 100644
--- a/drivers/block/cfq-iosched.c
+++ b/drivers/block/cfq-iosched.c
@@ -1775,7 +1775,7 @@ cfq_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
1775 struct cfq_fs_entry *entry = to_cfq(attr); 1775 struct cfq_fs_entry *entry = to_cfq(attr);
1776 1776
1777 if (!entry->show) 1777 if (!entry->show)
1778 return 0; 1778 return -EIO;
1779 1779
1780 return entry->show(e->elevator_data, page); 1780 return entry->show(e->elevator_data, page);
1781} 1781}
@@ -1788,7 +1788,7 @@ cfq_attr_store(struct kobject *kobj, struct attribute *attr,
1788 struct cfq_fs_entry *entry = to_cfq(attr); 1788 struct cfq_fs_entry *entry = to_cfq(attr);
1789 1789
1790 if (!entry->store) 1790 if (!entry->store)
1791 return -EINVAL; 1791 return -EIO;
1792 1792
1793 return entry->store(e->elevator_data, page, length); 1793 return entry->store(e->elevator_data, page, length);
1794} 1794}
diff --git a/drivers/block/deadline-iosched.c b/drivers/block/deadline-iosched.c
index d63d34c671f..7f79f3dd016 100644
--- a/drivers/block/deadline-iosched.c
+++ b/drivers/block/deadline-iosched.c
@@ -886,7 +886,7 @@ deadline_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
886 struct deadline_fs_entry *entry = to_deadline(attr); 886 struct deadline_fs_entry *entry = to_deadline(attr);
887 887
888 if (!entry->show) 888 if (!entry->show)
889 return 0; 889 return -EIO;
890 890
891 return entry->show(e->elevator_data, page); 891 return entry->show(e->elevator_data, page);
892} 892}
@@ -899,7 +899,7 @@ deadline_attr_store(struct kobject *kobj, struct attribute *attr,
899 struct deadline_fs_entry *entry = to_deadline(attr); 899 struct deadline_fs_entry *entry = to_deadline(attr);
900 900
901 if (!entry->store) 901 if (!entry->store)
902 return -EINVAL; 902 return -EIO;
903 903
904 return entry->store(e->elevator_data, page, length); 904 return entry->store(e->elevator_data, page, length);
905} 905}
diff --git a/drivers/block/genhd.c b/drivers/block/genhd.c
index 8bbe01d4b48..53f7d846b74 100644
--- a/drivers/block/genhd.c
+++ b/drivers/block/genhd.c
@@ -322,7 +322,7 @@ static ssize_t disk_attr_show(struct kobject *kobj, struct attribute *attr,
322 struct gendisk *disk = to_disk(kobj); 322 struct gendisk *disk = to_disk(kobj);
323 struct disk_attribute *disk_attr = 323 struct disk_attribute *disk_attr =
324 container_of(attr,struct disk_attribute,attr); 324 container_of(attr,struct disk_attribute,attr);
325 ssize_t ret = 0; 325 ssize_t ret = -EIO;
326 326
327 if (disk_attr->show) 327 if (disk_attr->show)
328 ret = disk_attr->show(disk,page); 328 ret = disk_attr->show(disk,page);
diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c
index f20eba22b14..81fe3a0c1fe 100644
--- a/drivers/block/ll_rw_blk.c
+++ b/drivers/block/ll_rw_blk.c
@@ -3574,7 +3574,7 @@ queue_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
3574 3574
3575 q = container_of(kobj, struct request_queue, kobj); 3575 q = container_of(kobj, struct request_queue, kobj);
3576 if (!entry->show) 3576 if (!entry->show)
3577 return 0; 3577 return -EIO;
3578 3578
3579 return entry->show(q, page); 3579 return entry->show(q, page);
3580} 3580}
@@ -3588,7 +3588,7 @@ queue_attr_store(struct kobject *kobj, struct attribute *attr,
3588 3588
3589 q = container_of(kobj, struct request_queue, kobj); 3589 q = container_of(kobj, struct request_queue, kobj);
3590 if (!entry->store) 3590 if (!entry->store)
3591 return -EINVAL; 3591 return -EIO;
3592 3592
3593 return entry->store(q, page, length); 3593 return entry->store(q, page, length);
3594} 3594}