#define _GNU_SOURCE
#include <unistd.h>
-#ifndef __dietlibc__
+#if !defined(__dietlibc__) && !defined(__KLIBC__)
extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence));
#else
-# ifdef __NO_STAT64
+# if defined(__NO_STAT64) || __WORDSIZE != 32
# define lseek64 lseek
# endif
#endif
((x) & 0x00000000ff000000ULL) << 8 | \
((x) & 0x000000ff00000000ULL) >> 8)
+#if !defined(__KLIBC__)
#if BYTE_ORDER == LITTLE_ENDIAN
#define __cpu_to_le16(_x) (_x)
#define __cpu_to_le32(_x) (_x)
#else
# error "unknown endianness."
#endif
+#endif /* __KLIBC__ */
MONITOR,
GROW,
INCREMENTAL,
+ AUTODETECT,
};
extern char short_options[];
+extern char short_bitmap_options[];
extern char short_bitmap_auto_options[];
extern struct option long_options[];
extern char Version[], Usage[], Help[], OptionHelp[],
HomeHost,
AutoHomeHost,
Symlinks,
+ AutoDetect,
};
/* structures read from config file */
#define UnSet (0xfffe)
typedef struct mddev_ident_s {
char *devname;
-
+
int uuid_set;
int uuid[4];
char name[33];
extern struct superswitch {
- void (*examine_super)(void *sbv, char *homehost);
- void (*brief_examine_super)(void *sbv);
- void (*detail_super)(void *sbv, char *homehost);
- void (*brief_detail_super)(void *sbv);
- void (*uuid_from_super)(int uuid[4], void *sbv);
- void (*getinfo_super)(struct mdinfo *info, void *sbv);
- int (*match_home)(void *sbv, char *homehost);
- int (*update_super)(struct mdinfo *info, void *sbv, char *update,
+ void (*examine_super)(struct supertype *st, void *sbv, char *homehost);
+ void (*brief_examine_super)(struct supertype *st, void *sbv);
+ void (*detail_super)(struct supertype *st, void *sbv, char *homehost);
+ void (*export_super)(struct supertype *st, void *sbv);
+ void (*brief_detail_super)(struct supertype *st, void *sbv);
+ void (*uuid_from_super)(struct supertype *st, int uuid[4], void *sbv);
+ void (*getinfo_super)(struct supertype *st, struct mdinfo *info, void *sbv);
+ int (*match_home)(struct supertype *st, void *sbv, char *homehost);
+ int (*update_super)(struct supertype *st, struct mdinfo *info,
+ void *sbv, char *update,
char *devname, int verbose,
int uuid_set, char *homehost);
int (*init_super)(struct supertype *st, void **sbp, mdu_array_info_t *info, unsigned long long size, char *name, char *homehost, int *uuid);
- void (*add_to_super)(void *sbv, mdu_disk_info_t *dinfo);
+ void (*add_to_super)(struct supertype *st, void *sbv, mdu_disk_info_t *dinfo);
int (*store_super)(struct supertype *st, int fd, void *sbv);
int (*write_init_super)(struct supertype *st, void *sbv, mdu_disk_info_t *dinfo, char *devname);
int (*compare_super)(void **firstp, void *secondv);
unsigned long long size, int may_change, int major);
void (*locate_bitmap)(struct supertype *st, int fd, void *sbv);
int (*write_bitmap)(struct supertype *st, int fd, void *sbv);
+ void (*free_super)(struct supertype *st, void *super);
int major;
int swapuuid; /* true if uuid is bigending rather than hostendian */
} super0, super1, *superlist[];
# undef HAVE_NFTW
#endif
+#if defined(__KLIBC__)
+# undef HAVE_NFTW
+# undef HAVE_FTW
+#endif
+
#ifndef HAVE_NFTW
# define FTW_PHYS 1
# ifndef HAVE_FTW
extern int Manage_reconfig(char *devname, int fd, int layout);
extern int Manage_subdevs(char *devname, int fd,
mddev_dev_t devlist, int verbose);
+extern int autodetect(void);
extern int Grow_Add_device(char *devname, int fd, char *newdev);
extern int Grow_addbitmap(char *devname, int fd, char *file, int chunk, int delay, int write_behind, int force);
extern int Grow_reshape(char *devname, int fd, int quiet, char *backup_file,
int runstop, int verbose, int force, int assume_clean,
char *bitmap_file, int bitmap_chunk, int write_behind, int delay);
-extern int Detail(char *dev, int brief, int test, char *homehost);
+extern int Detail(char *dev, int brief, int export, int test, char *homehost);
extern int Query(char *dev);
extern int Examine(mddev_dev_t devlist, int brief, int scan, int SparcAdjust,
struct supertype *forcest, char *homehost);