- void (*examine_super)(void *sbv);
- void (*brief_examine_super)(void *sbv);
- void (*detail_super)(void *sbv);
- void (*brief_detail_super)(void *sbv);
- void (*uuid_from_super)(int uuid[4], void *sbv);
- void (*getinfo_super)(struct mdinfo *info, void *sbv);
- int (*update_super)(struct mdinfo *info, void *sbv, char *update, char *devname, int verbose);
- __u64 (*event_super)(void *sbv);
- void (*init_super)(void **sbp, mdu_array_info_t *info);
- void (*add_to_super)(void *sbv, mdu_disk_info_t *dinfo);
- int (*store_super)(int fd, void *sbv);
- int (*write_init_super)(void *sbv, mdu_disk_info_t *dinfo, char *devname);
- int (*compare_super)(void **firstp, void *secondv);
- int (*load_super)(int fd, void **sbp, char *devname);
- int (*match_metadata_desc)(char *arg);
-} super0, *superlist[];
-
-extern struct superswitch *super_by_version(int vers);
-extern struct superswitch *guess_super(int fd, char *dev);
+ void (*examine_super)(struct supertype *st, char *homehost);
+ void (*brief_examine_super)(struct supertype *st);
+ void (*export_examine_super)(struct supertype *st);
+ void (*detail_super)(struct supertype *st, char *homehost);
+ void (*brief_detail_super)(struct supertype *st);
+ void (*export_detail_super)(struct supertype *st);
+ void (*uuid_from_super)(struct supertype *st, int uuid[4]);
+ void (*getinfo_super)(struct supertype *st, struct mdinfo *info);
+ int (*match_home)(struct supertype *st, char *homehost);
+ int (*update_super)(struct supertype *st, struct mdinfo *info,
+ char *update,
+ char *devname, int verbose,
+ int uuid_set, char *homehost);
+ int (*init_super)(struct supertype *st, mdu_array_info_t *info,
+ unsigned long long size, char *name,
+ char *homehost, int *uuid);
+ void (*add_to_super)(struct supertype *st, mdu_disk_info_t *dinfo,
+ int fd, char *devname);
+ int (*store_super)(struct supertype *st, int fd);
+ int (*write_init_super)(struct supertype *st);
+ int (*compare_super)(struct supertype *st, struct supertype *tst);
+ int (*load_super)(struct supertype *st, int fd, char *devname);
+ struct supertype * (*match_metadata_desc)(char *arg);
+ __u64 (*avail_size)(struct supertype *st, __u64 size);
+ int (*add_internal_bitmap)(struct supertype *st, int *chunkp,
+ int delay, int write_behind,
+ unsigned long long size, int may_change, int major);
+ void (*locate_bitmap)(struct supertype *st, int fd);
+ int (*write_bitmap)(struct supertype *st, int fd);
+ void (*free_super)(struct supertype *st);
+ int (*validate_geometry)(struct supertype *st, int level, int layout,
+ int raiddisks,
+ int chunk, unsigned long long size,
+ char *subdev, unsigned long long *freesize);
+ int major;
+ int swapuuid; /* true if uuid is bigending rather than hostendian */
+} super0, super1, *superlist[];
+
+struct supertype {
+ struct superswitch *ss;
+ int minor_version;
+ int max_devs;
+ void *sb;
+ void *info;
+};
+
+extern struct supertype *super_by_fd(int fd);
+extern struct supertype *guess_super(int fd);
+extern struct supertype *dup_super(struct supertype *st);
+extern int get_dev_size(int fd, char *dname, unsigned long long *sizep);
+extern void get_one_disk(int mdfd, mdu_array_info_t *ainf,
+ mdu_disk_info_t *disk);
+
+#if __GNUC__ < 3
+struct stat64;
+#endif
+
+#define HAVE_NFTW we assume
+#define HAVE_FTW
+
+#ifdef UCLIBC
+# include <features.h>
+# ifndef __UCLIBC_HAS_FTW__
+# undef HAVE_FTW
+# undef HAVE_NFTW
+# endif
+#endif
+
+#ifdef __dietlibc__
+# undef HAVE_NFTW
+#endif
+
+#if defined(__KLIBC__)
+# undef HAVE_NFTW
+# undef HAVE_FTW
+#endif
+
+#ifndef HAVE_NFTW
+# define FTW_PHYS 1
+# ifndef HAVE_FTW
+ struct FTW {};
+# endif
+#endif
+
+#ifdef HAVE_FTW
+# include <ftw.h>
+#endif
+
+extern int add_dev(const char *name, const struct stat *stb, int flag, struct FTW *s);