mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 22:26:55 +00:00
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>
This commit is contained in:
parent
1b6da75459
commit
486d220fe4
1 changed files with 9 additions and 0 deletions
|
@ -57,12 +57,21 @@ static ssize_t dm_attr_uuid_show(struct mapped_device *md, char *buf)
|
||||||
return strlen(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(name);
|
||||||
static DM_ATTR_RO(uuid);
|
static DM_ATTR_RO(uuid);
|
||||||
|
static DM_ATTR_RO(suspended);
|
||||||
|
|
||||||
static struct attribute *dm_attrs[] = {
|
static struct attribute *dm_attrs[] = {
|
||||||
&dm_attr_name.attr,
|
&dm_attr_name.attr,
|
||||||
&dm_attr_uuid.attr,
|
&dm_attr_uuid.attr,
|
||||||
|
&dm_attr_suspended.attr,
|
||||||
NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue