aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/block/dasd_devmap.c
diff options
context:
space:
mode:
authorStefan Weinhuber <wein@de.ibm.com>2006-03-24 06:15:25 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-24 10:33:17 -0500
commit20c644680af1ef9a6b36c0873f59498c98b07ab1 (patch)
treeaf2e50faeb690b7aacf7be3480f08f0a6ec0b56f /drivers/s390/block/dasd_devmap.c
parent554a826e0a29f1a88e5a5332f0718c059885ec17 (diff)
[PATCH] s390: dasd extended error reporting
The DASD extended error reporting is a facility that allows to get detailed information about certain problems in the DASD I/O. This information can be used to implement fail-over applications that can recover these problems. Signed-off-by: Stefan Weinhuber <wein@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/s390/block/dasd_devmap.c')
-rw-r--r--drivers/s390/block/dasd_devmap.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
index 1629b27c48ab..f576f243cd93 100644
--- a/drivers/s390/block/dasd_devmap.c
+++ b/drivers/s390/block/dasd_devmap.c
@@ -715,10 +715,51 @@ dasd_discipline_show(struct device *dev, struct device_attribute *attr, char *bu
715 715
716static DEVICE_ATTR(discipline, 0444, dasd_discipline_show, NULL); 716static DEVICE_ATTR(discipline, 0444, dasd_discipline_show, NULL);
717 717
718/*
719 * extended error-reporting
720 */
721static ssize_t
722dasd_eer_show(struct device *dev, struct device_attribute *attr, char *buf)
723{
724 struct dasd_devmap *devmap;
725 int eer_flag;
726
727 devmap = dasd_find_busid(dev->bus_id);
728 if (!IS_ERR(devmap) && devmap->device)
729 eer_flag = dasd_eer_enabled(devmap->device);
730 else
731 eer_flag = 0;
732 return snprintf(buf, PAGE_SIZE, eer_flag ? "1\n" : "0\n");
733}
734
735static ssize_t
736dasd_eer_store(struct device *dev, struct device_attribute *attr,
737 const char *buf, size_t count)
738{
739 struct dasd_devmap *devmap;
740 int rc;
741
742 devmap = dasd_devmap_from_cdev(to_ccwdev(dev));
743 if (IS_ERR(devmap))
744 return PTR_ERR(devmap);
745 if (!devmap->device)
746 return count;
747 if (buf[0] == '1') {
748 rc = dasd_eer_enable(devmap->device);
749 if (rc)
750 return rc;
751 } else
752 dasd_eer_disable(devmap->device);
753 return count;
754}
755
756static DEVICE_ATTR(eer_enabled, 0644, dasd_eer_show, dasd_eer_store);
757
718static struct attribute * dasd_attrs[] = { 758static struct attribute * dasd_attrs[] = {
719 &dev_attr_readonly.attr, 759 &dev_attr_readonly.attr,
720 &dev_attr_discipline.attr, 760 &dev_attr_discipline.attr,
721 &dev_attr_use_diag.attr, 761 &dev_attr_use_diag.attr,
762 &dev_attr_eer_enabled.attr,
722 NULL, 763 NULL,
723}; 764};
724 765