diff options
Diffstat (limited to 'drivers/block/cciss.c')
-rw-r--r-- | drivers/block/cciss.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index b674f93d4be..063e8b0834d 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -603,6 +603,29 @@ static ssize_t cciss_show_lunid(struct device *dev, | |||
603 | } | 603 | } |
604 | DEVICE_ATTR(lunid, S_IRUGO, cciss_show_lunid, NULL); | 604 | DEVICE_ATTR(lunid, S_IRUGO, cciss_show_lunid, NULL); |
605 | 605 | ||
606 | static ssize_t cciss_show_raid_level(struct device *dev, | ||
607 | struct device_attribute *attr, char *buf) | ||
608 | { | ||
609 | drive_info_struct *drv = dev_get_drvdata(dev); | ||
610 | struct ctlr_info *h = to_hba(drv->dev->parent); | ||
611 | int raid; | ||
612 | unsigned long flags; | ||
613 | |||
614 | spin_lock_irqsave(CCISS_LOCK(h->ctlr), flags); | ||
615 | if (h->busy_configuring) { | ||
616 | spin_unlock_irqrestore(CCISS_LOCK(h->ctlr), flags); | ||
617 | return -EBUSY; | ||
618 | } | ||
619 | raid = drv->raid_level; | ||
620 | spin_unlock_irqrestore(CCISS_LOCK(h->ctlr), flags); | ||
621 | if (raid < 0 || raid > RAID_UNKNOWN) | ||
622 | raid = RAID_UNKNOWN; | ||
623 | |||
624 | return snprintf(buf, strlen(raid_label[raid]) + 7, "RAID %s\n", | ||
625 | raid_label[raid]); | ||
626 | } | ||
627 | DEVICE_ATTR(raid_level, S_IRUGO, cciss_show_raid_level, NULL); | ||
628 | |||
606 | static struct attribute *cciss_host_attrs[] = { | 629 | static struct attribute *cciss_host_attrs[] = { |
607 | &dev_attr_rescan.attr, | 630 | &dev_attr_rescan.attr, |
608 | NULL | 631 | NULL |
@@ -629,6 +652,7 @@ static struct attribute *cciss_dev_attrs[] = { | |||
629 | &dev_attr_vendor.attr, | 652 | &dev_attr_vendor.attr, |
630 | &dev_attr_rev.attr, | 653 | &dev_attr_rev.attr, |
631 | &dev_attr_lunid.attr, | 654 | &dev_attr_lunid.attr, |
655 | &dev_attr_raid_level.attr, | ||
632 | NULL | 656 | NULL |
633 | }; | 657 | }; |
634 | 658 | ||