summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-sysfs.c
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2009-06-22 11:12:29 +0200
committerAlasdair G Kergon <agk@redhat.com>2009-06-22 11:12:29 +0200
commit486d220fe4909b5745c4faa67faddd30a707abe2 (patch)
treeeb7184f8299a5446532a6ff96d48fcdc3a461268 /drivers/md/dm-sysfs.c
parentdm table: improve warning message when devices not freed before destruction (diff)
downloadlinux-486d220fe4909b5745c4faa67faddd30a707abe2.tar.xz
linux-486d220fe4909b5745c4faa67faddd30a707abe2.zip
dm: sysfs add suspended attribute
Add a file named 'suspended' to each device-mapper device directory in sysfs. It holds the value 1 while the device is suspended. Otherwise it holds 0. Signed-off-by: Peter Rajnoha <prajnoha@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-sysfs.c')
-rw-r--r--drivers/md/dm-sysfs.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/md/dm-sysfs.c b/drivers/md/dm-sysfs.c
index a2a45e6c7c8b..4b045903a4e2 100644
--- a/drivers/md/dm-sysfs.c
+++ b/drivers/md/dm-sysfs.c
@@ -57,12 +57,21 @@ static ssize_t dm_attr_uuid_show(struct mapped_device *md, char *buf)
return strlen(buf);
}
+static ssize_t dm_attr_suspended_show(struct mapped_device *md, char *buf)
+{
+ sprintf(buf, "%d\n", dm_suspended(md));
+
+ return strlen(buf);
+}
+
static DM_ATTR_RO(name);
static DM_ATTR_RO(uuid);
+static DM_ATTR_RO(suspended);
static struct attribute *dm_attrs[] = {
&dm_attr_name.attr,
&dm_attr_uuid.attr,
+ &dm_attr_suspended.attr,
NULL,
};