aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-06-01 19:37:23 +1000
committerNeilBrown <neilb@suse.de>2010-07-21 13:27:53 +1000
commit00bcb4ac7ee7e557a491b614219142cea0ef16f4 (patch)
tree992cfa1d0e653aa3de8f0865c5e1a5a0fee4f935 /drivers/md/md.h
parentd0c6f6258478e1dba532bf7c28e2cd6e1047d3a4 (diff)
downloadkernel_samsung_aries-00bcb4ac7ee7e557a491b614219142cea0ef16f4.zip
kernel_samsung_aries-00bcb4ac7ee7e557a491b614219142cea0ef16f4.tar.gz
kernel_samsung_aries-00bcb4ac7ee7e557a491b614219142cea0ef16f4.tar.bz2
md: reduce dependence on sysfs.
We will want md devices to live as dm targets where sysfs is not visible. So allow md to not connect to sysfs. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.h')
-rw-r--r--drivers/md/md.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/md/md.h b/drivers/md/md.h
index 10597bf..1e64059 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -382,6 +382,18 @@ struct md_sysfs_entry {
};
extern struct attribute_group md_bitmap_group;
+static inline struct sysfs_dirent *sysfs_get_dirent_safe(struct sysfs_dirent *sd, char *name)
+{
+ if (sd)
+ return sysfs_get_dirent(sd, NULL, name);
+ return sd;
+}
+static inline void sysfs_notify_dirent_safe(struct sysfs_dirent *sd)
+{
+ if (sd)
+ sysfs_notify_dirent(sd);
+}
+
static inline char * mdname (mddev_t * mddev)
{
return mddev->gendisk ? mddev->gendisk->disk_name : "mdX";