]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdadm.h
mdadm: replace container level checking with inline
[thirdparty/mdadm.git] / mdadm.h
diff --git a/mdadm.h b/mdadm.h
index 163f4a49fbafeebfbe0e48262fc73a6dd12502e4..3673494e560b9624b95e3d854ca8a95ee28a1104 100644 (file)
--- a/mdadm.h
+++ b/mdadm.h
@@ -394,7 +394,6 @@ struct createinfo {
        int     gid;
        int     autof;
        int     mode;
-       int     symlinks;
        int     names;
        int     bblist;
        struct supertype *supertype;
@@ -442,7 +441,6 @@ enum special_options {
        BackupFile,
        HomeHost,
        AutoHomeHost,
-       Symlinks,
        AutoDetect,
        Waitclean,
        DetailPlatform,
@@ -597,6 +595,7 @@ struct shape {
        int     assume_clean;
        int     write_behind;
        unsigned long long size;
+       unsigned long long data_offset;
        int     consistency_policy;
 };
 
@@ -1433,7 +1432,6 @@ extern int Grow_addbitmap(char *devname, int fd,
                          struct context *c, struct shape *s);
 extern int Grow_reshape(char *devname, int fd,
                        struct mddev_dev *devlist,
-                       unsigned long long data_offset,
                        struct context *c, struct shape *s);
 extern int Grow_restart(struct supertype *st, struct mdinfo *info,
                        int *fdlist, int cnt, char *backup_file, int verbose);
@@ -1464,8 +1462,7 @@ extern int Create(struct supertype *st, char *mddev,
                  char *name, int *uuid,
                  int subdevs, struct mddev_dev *devlist,
                  struct shape *s,
-                 struct context *c,
-                 unsigned long long data_offset);
+                 struct context *c);
 
 extern int Detail(char *dev, struct context *c);
 extern int Detail_Platform(struct superswitch *ss, int scan, int verbose, int export, char *controller_path);
@@ -1542,6 +1539,7 @@ extern int stat_is_blkdev(char *devname, dev_t *rdev);
 extern bool is_dev_alive(char *path);
 extern int get_mdp_major(void);
 extern int get_maj_min(char *dev, int *major, int *minor);
+extern bool is_bit_set(int *val, unsigned char index);
 extern int dev_open(char *dev, int flags);
 extern int open_dev(char *devnm);
 extern void reopen_mddev(int mdfd);
@@ -1675,6 +1673,7 @@ void *super1_make_v0(struct supertype *st, struct mdinfo *info, mdp_super_t *sb0
 extern char *stat2kname(struct stat *st);
 extern char *fd2kname(int fd);
 extern char *stat2devnm(struct stat *st);
+bool stat_is_md_dev(struct stat *st);
 extern char *fd2devnm(int fd);
 extern void udev_block(char *devnm);
 extern void udev_unblock(void);
@@ -1720,6 +1719,10 @@ extern int cluster_get_dlmlock(void);
 extern int cluster_release_dlmlock(void);
 extern void set_dlm_hooks(void);
 
+#define MSEC_TO_NSEC(msec) ((msec) * 1000000)
+#define USEC_TO_NSEC(usec) ((usec) * 1000)
+extern void sleep_for(unsigned int sec, long nsec, bool wake_after_interrupt);
+
 #define _ROUND_UP(val, base)   (((val) + (base) - 1) & ~(base - 1))
 #define ROUND_UP(val, base)    _ROUND_UP(val, (typeof(val))(base))
 #define ROUND_UP_PTR(ptr, base)        ((typeof(ptr)) \
@@ -1921,3 +1924,17 @@ enum r0layout {
  * This is true for native and DDF, IMSM allows 16.
  */
 #define MD_NAME_MAX 32
+
+/**
+ * is_container() - check if @level is &LEVEL_CONTAINER
+ * @level: level value
+ *
+ * return:
+ * 1 if level is equal to &LEVEL_CONTAINER, 0 otherwise.
+ */
+static inline int is_container(const int level)
+{
+       if (level == LEVEL_CONTAINER)
+               return 1;
+       return 0;
+}