summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2008-11-04 20:51:12 +1100
committerNeilBrown <neilb@suse.de>2008-11-04 20:51:12 +1100
commit9008ed1c9623b7c11775ea8a7be17eb1bde5fd09 (patch)
treeb0eb548c1b07a77878d0e0020942eddd51902997 /util.c
parent52437b4f089d397fa84e22be54e1d6cdef60bea4 (diff)
Assemble: allow members of containers to be assembled and auto-assembled.
Try to treat members of containers much like other arrays for assembly. We still look through the list of devices for a match (it will be the container), then find the relevant 'info' and try to assemble the array. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'util.c')
-rw-r--r--util.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/util.c b/util.c
index f15ba43d..1736d707 100644
--- a/util.c
+++ b/util.c
@@ -828,6 +828,20 @@ int open_dev_excl(int devnum)
return -1;
}
+int same_dev(char *one, char *two)
+{
+ struct stat st1, st2;
+ if (stat(one, &st1) != 0)
+ return 0;
+ if (stat(two, &st2) != 0)
+ return 0;
+ if ((st1.st_mode & S_IFMT) != S_IFBLK)
+ return 0;
+ if ((st2.st_mode & S_IFMT) != S_IFBLK)
+ return 0;
+ return st1.st_rdev == st2.st_rdev;
+}
+
struct superswitch *superlist[] = { &super0, &super1, &super_ddf, &super_imsm, NULL };
#if !defined(MDASSEMBLE) || defined(MDASSEMBLE) && defined(MDASSEMBLE_AUTO)