]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Replace a lot of leading spaces with tabs.
authorNeilBrown <neilb@suse.de>
Wed, 10 Oct 2012 07:33:26 +0000 (18:33 +1100)
committerNeilBrown <neilb@suse.de>
Wed, 10 Oct 2012 07:33:26 +0000 (18:33 +1100)
Signed-off-by: NeilBrown <neilb@suse.de>
Create.c
ReadMe.c
config.c
lib.c
platform-intel.c
policy.c
super-ddf.c
super-intel.c
super1.c
util.c

index d6dcdbf3d66262eeed6f10932bef8eca0d4f2e03..afcf1a53abef74f67fca09fcf1f2bbdc54f9c907 100644 (file)
--- a/Create.c
+++ b/Create.c
@@ -655,7 +655,7 @@ int Create(struct supertype *st, char *mddev,
         *          including spares
         * failed_disks is the number of disks marked failed
         *
-         * Ideally, the kernel would keep these (except raid_disks)
+        * Ideally, the kernel would keep these (except raid_disks)
         * up-to-date as we ADD_NEW_DISK, but it doesn't (yet).
         * So for now, we assume that all raid and spare
         * devices will be given.
index def75ec6c802f8a9575f63cc6aa4e93625a0dbd1..2fde2ac5747eb9f52ed3fe15e542d415c5bbe51a 100644 (file)
--- a/ReadMe.c
+++ b/ReadMe.c
@@ -71,9 +71,9 @@ char Version[] = Name " - v3.2.5 - 18th May 2012\n";
 
 char short_options[]="-ABCDEFGIQhVXYWZ:vqbc:i:l:p:m:n:x:u:c:d:z:U:N:sarfRSow1tye:";
 char short_bitmap_options[]=
-                   "-ABCDEFGIQhVXYWZ:vqb:c:i:l:p:m:n:x:u:c:d:z:U:N:sarfRSow1tye:";
+               "-ABCDEFGIQhVXYWZ:vqb:c:i:l:p:m:n:x:u:c:d:z:U:N:sarfRSow1tye:";
 char short_bitmap_auto_options[]=
-                   "-ABCDEFGIQhVXYWZ:vqb:c:i:l:p:m:n:x:u:c:d:z:U:N:sa:rfRSow1tye:";
+               "-ABCDEFGIQhVXYWZ:vqb:c:i:l:p:m:n:x:u:c:d:z:U:N:sa:rfRSow1tye:";
 
 struct option long_options[] = {
     {"manage",    0, 0, ManageOpt},
index 9875d3e7ca49a9eecfff65a8df068f9f65035e43..656d4e2f4189115d182195653a8931aeadbaa96c 100644 (file)
--- a/config.c
+++ b/config.c
@@ -149,8 +149,8 @@ void free_line(char *line)
 
 
 struct conf_dev {
-    struct conf_dev *next;
-    char *name;
+       struct conf_dev *next;
+       char *name;
 } *cdevlist = NULL;
 
 struct mddev_dev *load_partitions(void)
@@ -940,26 +940,26 @@ int conf_test_metadata(const char *version, struct dev_policy *pol, int is_homeh
 
 int match_oneof(char *devices, char *devname)
 {
-    /* check if one of the comma separated patterns in devices
-     * matches devname
-     */
-
-    while (devices && *devices) {
-       char patn[1024];
-       char *p = devices;
-       devices = strchr(devices, ',');
-       if (!devices)
-           devices = p + strlen(p);
-       if (devices-p < 1024) {
-               strncpy(patn, p, devices-p);
-               patn[devices-p] = 0;
-               if (fnmatch(patn, devname, FNM_PATHNAME)==0)
-                       return 1;
+       /* check if one of the comma separated patterns in devices
+        * matches devname
+        */
+
+       while (devices && *devices) {
+               char patn[1024];
+               char *p = devices;
+               devices = strchr(devices, ',');
+               if (!devices)
+                       devices = p + strlen(p);
+               if (devices-p < 1024) {
+                       strncpy(patn, p, devices-p);
+                       patn[devices-p] = 0;
+                       if (fnmatch(patn, devname, FNM_PATHNAME)==0)
+                               return 1;
+               }
+               if (*devices == ',')
+                       devices++;
        }
-       if (*devices == ',')
-               devices++;
-    }
-    return 0;
+       return 0;
 }
 
 int devname_matches(char *name, char *match)
diff --git a/lib.c b/lib.c
index dc32c561faa9b9b63978981195ee35bc6ef684c3..1c856541c9cc538ea2f142af75ef8f7fa81e9c2a 100644 (file)
--- a/lib.c
+++ b/lib.c
@@ -133,9 +133,9 @@ int fd2devnum(int fd)
  * Put them in a simple linked listfor now.
  */
 struct devmap {
-    int major, minor;
-    char *name;
-    struct devmap *next;
+       int major, minor;
+       char *name;
+       struct devmap *next;
 } *devlist = NULL;
 int devlist_ready = 0;
 
index d6698c7af1c3aab8f3b75593edc928c26557eb00..0dcf07c298e51ec753078b3f52d3f686d76ff96d 100644 (file)
@@ -297,7 +297,7 @@ static const struct imsm_orom *find_imsm_hba_orom(enum sys_dev_type hba_id)
        }
        if (check_env("IMSM_TEST_OROM")) {
                dprintf("OROM CAP: %p,  pid: %d pop: %d\n",
-                     &imsm_orom[hba_id], (int) getpid(), populated_orom[hba_id]);
+                       &imsm_orom[hba_id], (int) getpid(), populated_orom[hba_id]);
                return imsm_platform_test(hba_id, &populated_orom[hba_id], &imsm_orom[hba_id]);
        }
        /* return empty OROM capabilities in EFI test mode */
@@ -381,7 +381,7 @@ int read_efi_variable(void *buffer, ssize_t buf_size, char *variable_name, struc
        errno = 0;
        var_data_len = strtoul(buf, NULL, 16);
        if ((errno == ERANGE && (var_data_len == LONG_MAX))
-            || (errno != 0 && var_data_len == 0))
+           || (errno != 0 && var_data_len == 0))
                return 1;
 
        /* get data */
index 8ee6a6c815b358f8b3e791d385324a18c4d70b46..c3de692e79ced9e2d894e81ffa4f1240a6b685f8 100644 (file)
--- a/policy.c
+++ b/policy.c
@@ -791,13 +791,13 @@ char udev_template_start[] =
 /* find rule named rule_type and return its value */
 char *find_rule(struct rule *rule, char *rule_type)
 {
-       while (rule) {
-               if (rule->name == rule_type)
-                       return rule->value;
+       while (rule) {
+               if (rule->name == rule_type)
+                       return rule->value;
 
-               rule = rule->next;
-       }
-       return NULL;
+               rule = rule->next;
+       }
+       return NULL;
 }
 
 #define UDEV_RULE_FORMAT \
@@ -834,44 +834,44 @@ int write_rule(struct rule *rule, int fd, int force_part)
  */
 int generate_entries(int fd)
 {
-       struct pol_rule *loop, *dup;
-       char *loop_value, *dup_value;
-       int duplicate;
-
-       for (loop = config_rules; loop; loop = loop->next) {
-               if (loop->type != rule_policy && loop->type != rule_part)
-                       continue;
-               duplicate = 0;
-
-               /* only policies with paths and with actions supporting
-                * bare disks are considered */
-               loop_value = find_rule(loop->rule, pol_act);
-               if (!loop_value || map_act(loop_value) < act_spare_same_slot)
-                       continue;
-               loop_value = find_rule(loop->rule, rule_path);
-               if (!loop_value)
-                       continue;
-               for (dup = config_rules; dup != loop; dup = dup->next) {
-                       if (dup->type != rule_policy && loop->type != rule_part)
-                               continue;
-                       dup_value = find_rule(dup->rule, pol_act);
-                       if (!dup_value || map_act(dup_value) < act_spare_same_slot)
-                               continue;
-                       dup_value = find_rule(dup->rule, rule_path);
-                       if (!dup_value)
-                               continue;
-                       if (strcmp(loop_value, dup_value) == 0) {
-                               duplicate = 1;
-                               break;
-                       }
-               }
-
-               /* not a dup or first occurrence */
-               if (!duplicate)
-                       if (!write_rule(loop->rule, fd, loop->type == rule_part) )
-                               return 0;
-       }
-       return 1;
+       struct pol_rule *loop, *dup;
+       char *loop_value, *dup_value;
+       int duplicate;
+
+       for (loop = config_rules; loop; loop = loop->next) {
+               if (loop->type != rule_policy && loop->type != rule_part)
+                       continue;
+               duplicate = 0;
+
+               /* only policies with paths and with actions supporting
+                * bare disks are considered */
+               loop_value = find_rule(loop->rule, pol_act);
+               if (!loop_value || map_act(loop_value) < act_spare_same_slot)
+                       continue;
+               loop_value = find_rule(loop->rule, rule_path);
+               if (!loop_value)
+                       continue;
+               for (dup = config_rules; dup != loop; dup = dup->next) {
+                       if (dup->type != rule_policy && loop->type != rule_part)
+                               continue;
+                       dup_value = find_rule(dup->rule, pol_act);
+                       if (!dup_value || map_act(dup_value) < act_spare_same_slot)
+                               continue;
+                       dup_value = find_rule(dup->rule, rule_path);
+                       if (!dup_value)
+                               continue;
+                       if (strcmp(loop_value, dup_value) == 0) {
+                               duplicate = 1;
+                               break;
+                       }
+               }
+
+               /* not a dup or first occurrence */
+               if (!duplicate)
+                       if (!write_rule(loop->rule, fd, loop->type == rule_part) )
+                               return 0;
+       }
+       return 1;
 }
 
 /* Write_rules routine creates dynamic udev rules used to handle
@@ -879,40 +879,40 @@ int generate_entries(int fd)
  */
 int Write_rules(char *rule_name)
 {
-       int fd;
-       char udev_rule_file[PATH_MAX];
-
-       if (rule_name) {
-              strncpy(udev_rule_file, rule_name, sizeof(udev_rule_file) - 6);
-              udev_rule_file[sizeof(udev_rule_file) - 6] = '\0';
-              strcat(udev_rule_file, ".temp");
-               fd = creat(udev_rule_file,
-                          S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
-              if (fd == -1)
-                      return 1;
-       } else
-               fd = 1;
-
-       /* write static invocation */
-       if (write(fd, udev_template_start,
-                sizeof(udev_template_start) - 1)
-          != (int)sizeof(udev_template_start)-1)
-              goto abort;
-
-       /* iterate, if none created or error occurred, remove file */
-       if (generate_entries(fd) < 0)
-              goto abort;
-
-       fsync(fd);
-       if (rule_name) {
-              close(fd);
-              rename(udev_rule_file, rule_name);
-       }
-       return 0;
+       int fd;
+       char udev_rule_file[PATH_MAX];
+
+       if (rule_name) {
+               strncpy(udev_rule_file, rule_name, sizeof(udev_rule_file) - 6);
+               udev_rule_file[sizeof(udev_rule_file) - 6] = '\0';
+               strcat(udev_rule_file, ".temp");
+               fd = creat(udev_rule_file,
+                          S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+               if (fd == -1)
+                       return 1;
+       } else
+               fd = 1;
+
+       /* write static invocation */
+       if (write(fd, udev_template_start,
+                 sizeof(udev_template_start) - 1)
+           != (int)sizeof(udev_template_start)-1)
+               goto abort;
+
+       /* iterate, if none created or error occurred, remove file */
+       if (generate_entries(fd) < 0)
+               goto abort;
+
+       fsync(fd);
+       if (rule_name) {
+               close(fd);
+               rename(udev_rule_file, rule_name);
+       }
+       return 0;
 abort:
-       if (rule_name) {
-              close(fd);
-              unlink(udev_rule_file);
-       }
-       return 1;
+       if (rule_name) {
+               close(fd);
+               unlink(udev_rule_file);
+       }
+       return 1;
 }
index 4a6f623709d7316f374a7d3fb65388ccfe839193..3b3c1f0ff8aac8205d10565894fc9dacf25c2f84 100644 (file)
@@ -3189,8 +3189,8 @@ static int ddf_set_array_state(struct active_array *a, int consistent)
 }
 
 #define container_of(ptr, type, member) ({                      \
-        const typeof( ((type *)0)->member ) *__mptr = (ptr);    \
-        (type *)( (char *)__mptr - offsetof(type,member) );})
+       const typeof( ((type *)0)->member ) *__mptr = (ptr); \
+       (type *)( (char *)__mptr - offsetof(type,member) );})
 /*
  * The state of each disk is stored in the global phys_disk structure
  * in phys_disk.entries[n].state.
index 80c0f8de77567c6cfa00bb407100587f7d213a7e..452fae4ce4ce81272ac688a500bf3ec00be8cc6a 100644 (file)
@@ -685,12 +685,12 @@ static __u32 __gen_imsm_checksum(struct imsm_super *mpb)
        __u32 *p = (__u32 *) mpb;
        __u32 sum = 0;
 
-        while (end--) {
-                sum += __le32_to_cpu(*p);
+       while (end--) {
+               sum += __le32_to_cpu(*p);
                p++;
        }
 
-        return sum - __le32_to_cpu(mpb->check_sum);
+       return sum - __le32_to_cpu(mpb->check_sum);
 }
 
 static size_t sizeof_imsm_map(struct imsm_map *map)
@@ -3062,11 +3062,11 @@ static int compare_super_imsm(struct supertype *st, struct supertype *tst)
        struct intel_super *first = st->sb;
        struct intel_super *sec = tst->sb;
 
-        if (!first) {
-                st->sb = tst->sb;
-                tst->sb = NULL;
-                return 0;
-        }
+       if (!first) {
+               st->sb = tst->sb;
+               tst->sb = NULL;
+               return 0;
+       }
        /* in platform dependent environment test if the disks
         * use the same Intel hba
         */
@@ -5850,7 +5850,7 @@ validate_geometry_imsm_orom(struct intel_super *super, int level, int layout,
                return 0;
        }
 
-        /* capabilities of OROM tested - copied from validate_geometry_imsm_volume */
+       /* capabilities of OROM tested - copied from validate_geometry_imsm_volume */
        if (!is_raid_level_supported(super->orom, level, raiddisks)) {
                pr_vrb(": platform does not support raid%d with %d disk%s\n",
                        level, raiddisks, raiddisks > 1 ? "s" : "");
index d6b69fbe93bc80f9d0c7cd617d2e9005e12a9a66..9993386383f90c39f259440a5af3e99eb50d9432 100644 (file)
--- a/super1.c
+++ b/super1.c
@@ -71,7 +71,7 @@ struct mdp_superblock_1 {
        __u32   dev_number;     /* permanent identifier of this  device - not role in raid */
        __u32   cnt_corrected_read; /* number of read errors that were corrected by re-writing */
        __u8    device_uuid[16]; /* user-space setable, ignored by kernel */
-        __u8    devflags;        /* per-device flags.  Only one defined...*/
+       __u8    devflags;        /* per-device flags.  Only one defined...*/
 #define WriteMostly1    1        /* mask for writemostly flag in above */
        /* bad block log.  If there are any bad blocks the feature flag is set.
         * if offset and size are non-zero, that space is reserved and available.
diff --git a/util.c b/util.c
index 5e653f49e0076014e857b8d1c02796a9177268ce..687a2ce22b887c943b180257c535896485965883 100644 (file)
--- a/util.c
+++ b/util.c
@@ -43,10 +43,10 @@ int __offroot;
 
 /* The argument structure */
 struct blkpg_ioctl_arg {
-        int op;
-        int flags;
-        int datalen;
-        void *data;
+       int op;
+       int flags;
+       int datalen;
+       void *data;
 };
 
 /* The subfunctions (for the op field) */
@@ -127,21 +127,21 @@ int parse_uuid(char *str, int uuid[4])
 
 int md_get_version(int fd)
 {
-    struct stat stb;
-    mdu_version_t vers;
+       struct stat stb;
+       mdu_version_t vers;
 
-    if (fstat(fd, &stb)<0)
-       return -1;
-    if ((S_IFMT&stb.st_mode) != S_IFBLK)
-       return -1;
+       if (fstat(fd, &stb)<0)
+               return -1;
+       if ((S_IFMT&stb.st_mode) != S_IFBLK)
+               return -1;
 
-    if (ioctl(fd, RAID_VERSION, &vers) == 0)
-       return  (vers.major*10000) + (vers.minor*100) + vers.patchlevel;
-    if (errno == EACCES)
-           return -1;
-    if (major(stb.st_rdev) == MD_MAJOR)
-       return (3600);
-    return -1;
+       if (ioctl(fd, RAID_VERSION, &vers) == 0)
+               return  (vers.major*10000) + (vers.minor*100) + vers.patchlevel;
+       if (errno == EACCES)
+               return -1;
+       if (major(stb.st_rdev) == MD_MAJOR)
+               return (3600);
+       return -1;
 }
 
 int get_linux_version()