diff options
author | Milan Broz <mbroz@redhat.com> | 2009-01-05 22:05:12 -0500 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2009-01-05 22:05:12 -0500 |
commit | 784aae735d9b0bba3f8b9faef4c8b30df3bf0128 (patch) | |
tree | 7e2e956c395b27f63569d7a6adc1098f116cc3a4 /drivers/md/dm.h | |
parent | d58168763f74d1edbc296d7038c60efe6493fdd4 (diff) |
dm: add name and uuid to sysfs
Implement simple read-only sysfs entry for device-mapper block device.
This patch adds a simple sysfs directory named "dm" under block device
properties and implements
- name attribute (string containing mapped device name)
- uuid attribute (string containing UUID, or empty string if not set)
The kobject is embedded in mapped_device struct, so no additional
memory allocation is needed for initializing sysfs entry.
During the processing of sysfs attribute we need to lock mapped device
which is done by a new function dm_get_from_kobj, which returns the md
associated with kobject and increases the usage count.
Each 'show attribute' function is responsible for its own locking.
Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm.h')
-rw-r--r-- | drivers/md/dm.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/md/dm.h b/drivers/md/dm.h index bbbe9110f3bf..20194e000c5a 100644 --- a/drivers/md/dm.h +++ b/drivers/md/dm.h | |||
@@ -74,6 +74,14 @@ int dm_interface_init(void); | |||
74 | void dm_interface_exit(void); | 74 | void dm_interface_exit(void); |
75 | 75 | ||
76 | /* | 76 | /* |
77 | * sysfs interface | ||
78 | */ | ||
79 | int dm_sysfs_init(struct mapped_device *md); | ||
80 | void dm_sysfs_exit(struct mapped_device *md); | ||
81 | struct kobject *dm_kobject(struct mapped_device *md); | ||
82 | struct mapped_device *dm_get_from_kobject(struct kobject *kobj); | ||
83 | |||
84 | /* | ||
77 | * Targets for linear and striped mappings | 85 | * Targets for linear and striped mappings |
78 | */ | 86 | */ |
79 | int dm_linear_init(void); | 87 | int dm_linear_init(void); |