Commit d6f4965d authored by Andrew Patterson's avatar Andrew Patterson Committed by Jens Axboe

cciss: Allow triggering of rescan of logical drive topology via sysfs entry

Added /sys/bus/pci/devices/<dev>/ccissX/rescan sysfs entry used
to kick off a rescan that discovers logical drive topology changes.
Signed-off-by: default avatarAndrew Patterson <andrew.patterson@hp.com>
Signed-off-by: default avatarStephen M. Cameron <scameron@beardog.cce.hp.com>
Acked-by: default avatarMike Miller <mike.miller@hp.com>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent b368c9dd
...@@ -31,3 +31,10 @@ Date: March 2009 ...@@ -31,3 +31,10 @@ Date: March 2009
Kernel Version: 2.6.30 Kernel Version: 2.6.30
Contact: iss_storagedev@hp.com Contact: iss_storagedev@hp.com
Description: A symbolic link to /sys/block/cciss!cXdY Description: A symbolic link to /sys/block/cciss!cXdY
Where: /sys/bus/pci/devices/<dev>/ccissX/rescan
Date: August 2009
Kernel Version: 2.6.31
Contact: iss_storagedev@hp.com
Description: Kicks of a rescan of the controller to discover logical
drive topology changes.
...@@ -195,6 +195,7 @@ static int sendcmd_withirq_core(ctlr_info_t *h, CommandList_struct *c, ...@@ -195,6 +195,7 @@ static int sendcmd_withirq_core(ctlr_info_t *h, CommandList_struct *c,
static int process_sendcmd_error(ctlr_info_t *h, CommandList_struct *c); static int process_sendcmd_error(ctlr_info_t *h, CommandList_struct *c);
static void fail_all_cmds(unsigned long ctlr); static void fail_all_cmds(unsigned long ctlr);
static int add_to_scan_list(struct ctlr_info *h);
static int scan_thread(void *data); static int scan_thread(void *data);
static int check_for_unit_attention(ctlr_info_t *h, CommandList_struct *c); static int check_for_unit_attention(ctlr_info_t *h, CommandList_struct *c);
...@@ -460,9 +461,19 @@ static void __devinit cciss_procinit(int i) ...@@ -460,9 +461,19 @@ static void __devinit cciss_procinit(int i)
#define to_hba(n) container_of(n, struct ctlr_info, dev) #define to_hba(n) container_of(n, struct ctlr_info, dev)
#define to_drv(n) container_of(n, drive_info_struct, dev) #define to_drv(n) container_of(n, drive_info_struct, dev)
static struct device_type cciss_host_type = { static ssize_t host_store_rescan(struct device *dev,
.name = "cciss_host", struct device_attribute *attr,
}; const char *buf, size_t count)
{
struct ctlr_info *h = to_hba(dev);
add_to_scan_list(h);
wake_up_process(cciss_scan_thread);
wait_for_completion_interruptible(&h->scan_wait);
return count;
}
DEVICE_ATTR(rescan, S_IWUSR, NULL, host_store_rescan);
static ssize_t dev_show_unique_id(struct device *dev, static ssize_t dev_show_unique_id(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
...@@ -566,6 +577,25 @@ static ssize_t dev_show_rev(struct device *dev, ...@@ -566,6 +577,25 @@ static ssize_t dev_show_rev(struct device *dev,
} }
DEVICE_ATTR(rev, S_IRUGO, dev_show_rev, NULL); DEVICE_ATTR(rev, S_IRUGO, dev_show_rev, NULL);
static struct attribute *cciss_host_attrs[] = {
&dev_attr_rescan.attr,
NULL
};
static struct attribute_group cciss_host_attr_group = {
.attrs = cciss_host_attrs,
};
static struct attribute_group *cciss_host_attr_groups[] = {
&cciss_host_attr_group,
NULL
};
static struct device_type cciss_host_type = {
.name = "cciss_host",
.groups = cciss_host_attr_groups,
};
static struct attribute *cciss_dev_attrs[] = { static struct attribute *cciss_dev_attrs[] = {
&dev_attr_unique_id.attr, &dev_attr_unique_id.attr,
&dev_attr_model.attr, &dev_attr_model.attr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment