Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 343696
b: refs/heads/master
c: 51976a8
h: refs/heads/master
v: v3
  • Loading branch information
Boaz Harrosh authored and James Bottomley committed Nov 27, 2012
1 parent 96f5ebc commit 271839c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: afd5e34b2bb34881d3a789e62486814a49b47faa
refs/heads/master: 51976a8c85cec0c62e410bc38b8a11dbc690764d
28 changes: 28 additions & 0 deletions trunk/drivers/scsi/osd/osd_uld.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,37 @@ struct osd_dev_handle {

static DEFINE_IDA(osd_minor_ida);

/*
* scsi sysfs attribute operations
*/
static ssize_t osdname_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
struct osd_uld_device *ould = container_of(dev, struct osd_uld_device,
class_dev);
return sprintf(buf, "%s\n", ould->odi.osdname);
}

static ssize_t systemid_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
struct osd_uld_device *ould = container_of(dev, struct osd_uld_device,
class_dev);

memcpy(buf, ould->odi.systemid, ould->odi.systemid_len);
return ould->odi.systemid_len;
}

static struct device_attribute osd_uld_attrs[] = {
__ATTR(osdname, S_IRUGO, osdname_show, NULL),
__ATTR(systemid, S_IRUGO, systemid_show, NULL),
__ATTR_NULL,
};

static struct class osd_uld_class = {
.owner = THIS_MODULE,
.name = "scsi_osd",
.dev_attrs = osd_uld_attrs,
};

/*
Expand Down

0 comments on commit 271839c

Please sign in to comment.