]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
dm: sysfs add suspended attribute
authorPeter Rajnoha <prajnoha@redhat.com>
Mon, 22 Jun 2009 09:12:29 +0000 (10:12 +0100)
committerAlasdair G Kergon <agk@redhat.com>
Mon, 22 Jun 2009 09:12:29 +0000 (10:12 +0100)
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>
drivers/md/dm-sysfs.c

index a2a45e6c7c8bb540fc0b3d28ab8c2795cca00c8c..4b045903a4e21e6ce6e0c06593c7ed7e867a13b1 100644 (file)
@@ -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,
 };