]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Remove spaces/tabs from ends of lines.
authorNeil Brown <neilb@suse.de>
Fri, 14 Dec 2007 09:13:43 +0000 (20:13 +1100)
committerNeil Brown <neilb@suse.de>
Fri, 14 Dec 2007 09:13:43 +0000 (20:13 +1100)
23 files changed:
Assemble.c
Build.c
Create.c
Detail.c
Examine.c
Grow.c
Kill.c
Manage.c
Monitor.c
Query.c
ReadMe.c
bitmap.c
bitmap.h
config.c
md_p.h
md_u.h
mdadm.c
mdadm.h
mdopen.c
mdstat.c
raid5extend.c
super0.c
util.c

index 0450a47e6a107b4ed6d1f877cd84d5fae613d958..7f673e06847fe5f9d537f5e6a2b4d0110346bb61 100644 (file)
@@ -230,7 +230,7 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
                        free(super);
                        super = NULL;
                }
-               
+
                dfd = dev_open(devname, O_RDONLY|O_EXCL);
                if (dfd < 0) {
                        if ((inargv && verbose >= 0) || verbose > 0)
@@ -918,7 +918,7 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
                                fprintf(stderr, Name ": no uptodate device for slot %d of %s\n",
                                        i, mddev);
                }
-               
+
                if (runstop == 1 ||
                    (runstop <= 0 &&
                     ( enough(info.array.level, info.array.raid_disks,
@@ -1026,7 +1026,7 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
                    fprintf(stderr, Name ": Cannot start array: %s\n",
                            strerror(errno));
                }
-               
+
        }
        if (must_close) close(mdfd);
        return 0;
diff --git a/Build.c b/Build.c
index 1de3596630aa3de9a4bd4e5684039fb0077ea7de..d6e20fb84d6acfa57e69c6a9036d13c10bb2c07b 100644 (file)
--- a/Build.c
+++ b/Build.c
@@ -114,7 +114,7 @@ int Build(char *mddev, int mdfd, int chunk, int level, int layout,
 
 
        vers = md_get_version(mdfd);
-       
+
        /* looks Ok, go for it */
        if (vers >= 9000) {
                mdu_array_info_t array;
@@ -170,7 +170,7 @@ int Build(char *mddev, int mdfd, int chunk, int level, int layout,
                }
                fd = open(dv->devname, O_RDONLY|O_EXCL);
                if (fd < 0) {
-                       fprintf(stderr, Name ": Cannot open %s: %s\n", 
+                       fprintf(stderr, Name ": Cannot open %s: %s\n",
                                dv->devname, strerror(errno));
                        goto abort;
                }
@@ -232,7 +232,7 @@ int Build(char *mddev, int mdfd, int chunk, int level, int layout,
                                                bitmap_file);
                                        return 1;
                                }
-                       }                               
+                       }
                        if (bitmap_fd >= 0) {
                                if (ioctl(mdfd, SET_BITMAP_FILE, bitmap_fd) < 0) {
                                        fprintf(stderr, Name ": Cannot set bitmap file for %s: %s\n",
@@ -273,5 +273,4 @@ int Build(char *mddev, int mdfd, int chunk, int level, int layout,
        else
            ioctl(mdfd, STOP_MD, 0);
        return 1;
-               
 }
index 9cb8b78f9813a4bc32c9da2a1dc91e5a1980f1c7..fec7567f0d1b95219570c233a5bda49066627b35 100644 (file)
--- a/Create.c
+++ b/Create.c
@@ -298,7 +298,7 @@ int Create(struct supertype *st, char *mddev, int mdfd,
                if (level > 0 || level == LEVEL_MULTIPATH || level == LEVEL_FAULTY) {
                        /* size is meaningful */
                        if (minsize > 0x100000000ULL && st->ss->major == 0) {
-                               fprintf(stderr, Name ": devices too large for RAID level %d\n", level); 
+                               fprintf(stderr, Name ": devices too large for RAID level %d\n", level);
                                return 1;
                        }
                        size = minsize;
@@ -348,7 +348,7 @@ int Create(struct supertype *st, char *mddev, int mdfd,
                        Name ": This level does not support missing devices\n");
                return 1;
        }
-       
+
        /* Ok, lets try some ioctls */
 
        array.level = level;
@@ -467,7 +467,7 @@ int Create(struct supertype *st, char *mddev, int mdfd,
                inf.major_version = st->ss->major;
                inf.minor_version = st->minor_version;
                rv = ioctl(mdfd, SET_ARRAY_INFO, &inf);
-       } else 
+       } else
                rv = ioctl(mdfd, SET_ARRAY_INFO, NULL);
        if (rv) {
                fprintf(stderr, Name ": SET_ARRAY_INFO failed for %s: %s\n",
index 46d8ea01230309079f021396c572074e02632d62..22f0e5c0301d594f7a14fc0c0a085bd262ae5ac0 100644 (file)
--- a/Detail.c
+++ b/Detail.c
@@ -233,7 +233,7 @@ int Detail(char *dev, int brief, int export, int test, char *homehost)
                        break;
                default: break;
                }
-       
+
                if (e && e->percent >= 0) {
                        printf(" Re%s Status : %d%% complete\n",
                               (super && info.reshape_active)? "shape":"build",
@@ -301,7 +301,7 @@ This is pretty boring
                }
                if (disk.major == 0 && disk.minor == 0)
                        continue;
-               if (disk.raid_disk >= 0 && disk.raid_disk < array.raid_disks) 
+               if (disk.raid_disk >= 0 && disk.raid_disk < array.raid_disks)
                        disks[disk.raid_disk] = disk;
                else if (next < max_disks)
                        disks[next++] = disk;
@@ -319,13 +319,13 @@ This is pretty boring
                if (!brief) {
                        if (d == array.raid_disks) printf("\n");
                        if (disk.raid_disk < 0)
-                               printf("   %5d   %5d    %5d        -     ", 
+                               printf("   %5d   %5d    %5d        -     ",
                                       disk.number, disk.major, disk.minor);
                        else
-                               printf("   %5d   %5d    %5d    %5d     ", 
+                               printf("   %5d   %5d    %5d    %5d     ",
                                       disk.number, disk.major, disk.minor, disk.raid_disk);
-                       if (disk.state & (1<<MD_DISK_FAULTY)) { 
-                               printf(" faulty"); 
+                       if (disk.state & (1<<MD_DISK_FAULTY)) {
+                               printf(" faulty");
                                if (disk.raid_disk < array.raid_disks &&
                                    disk.raid_disk >= 0)
                                        failed++;
index a7bbbdbe5f892c05583289bb4aec7cff424409be..ba00270e8d9baa5ffd79b0c14bc4a73a7397e6b3 100644 (file)
--- a/Examine.c
+++ b/Examine.c
@@ -55,7 +55,7 @@ int Examine(mddev_dev_t devlist, int brief, int scan,
         * If (brief) gather devices for same array and just print a mdadm.conf line including devices=
         * if devlist==NULL, use conf_get_devs()
         */
-       int fd; 
+       int fd;
        void *super = NULL;
        int rv = 0;
        int err = 0;
diff --git a/Grow.c b/Grow.c
index aec7c56e7a73cef2c095e07f9ef2739598711709..82533dee5fe8d1f39b6c98031a66b0733c14e86e 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -52,7 +52,7 @@ int Grow_Add_device(char *devname, int fd, char *newdev)
        int nfd, fd2;
        int d, nd;
        struct supertype *st = NULL;
-       
+
 
        if (ioctl(fd, GET_ARRAY_INFO, &info.array) < 0) {
                fprintf(stderr, Name ": cannot get array info for %s\n", devname);
@@ -115,7 +115,7 @@ int Grow_Add_device(char *devname, int fd, char *newdev)
        /* Ok, looks good. Lets update the superblock and write it out to
         * newdev.
         */
-       
+
        info.disk.number = d;
        info.disk.major = major(stb.st_rdev);
        info.disk.minor = minor(stb.st_rdev);
@@ -179,7 +179,7 @@ int Grow_Add_device(char *devname, int fd, char *newdev)
 
                st->ss->update_super(&info, super, "linear-grow-update", dv,
                                     0, 0, NULL);
-               
+
                if (st->ss->store_super(st, fd2, super)) {
                        fprintf(stderr, Name ": Cannot store new superblock on %s\n", dv);
                        close(fd2);
@@ -816,7 +816,7 @@ int Grow_reshape(char *devname, int fd, int quiet, char *backup_file,
                                break;
                        sleep(1);
                }
-               
+
                /* invalidate superblocks */
                memset(&bsb, 0, sizeof(bsb));
                for (i=odisks; i<d ; i++) {
diff --git a/Kill.c b/Kill.c
index 3924cc1cbfcdf20445e1587a70163b714034f0be..ce692cea570bd3ee107f20993224fbff953b494e 100644 (file)
--- a/Kill.c
+++ b/Kill.c
@@ -44,7 +44,7 @@ int Kill(char *dev, int force, int quiet)
        void *super;
        int fd, rv = 0;
        struct supertype *st;
-               
+
        fd = open(dev, O_RDWR|O_EXCL);
        if (fd < 0) {
                if (!quiet)
index 8150be3eaf0fdc7d57d278566053df7f2201e28d..af87f79edeb36624612aafa7fbbb5f8de73e2c8b 100644 (file)
--- a/Manage.c
+++ b/Manage.c
@@ -45,7 +45,7 @@ int Manage_ro(char *devname, int fd, int readonly)
         *
         */
        mdu_array_info_t array;
-       
+
        if (md_get_version(fd) < 9000) {
                fprintf(stderr, Name ": need md driver version 0.90.0 or later\n");
                return 1;
@@ -55,7 +55,7 @@ int Manage_ro(char *devname, int fd, int readonly)
                        devname);
                return 1;
        }
-       
+
        if (readonly>0) {
                if (ioctl(fd, STOP_ARRAY_RO, NULL)) {
                        fprintf(stderr, Name ": failed to set readonly for %s: %s\n",
@@ -69,7 +69,7 @@ int Manage_ro(char *devname, int fd, int readonly)
                        return 1;
                }
        }
-       return 0;                       
+       return 0;
 }
 
 #ifndef MDASSEMBLE
@@ -88,7 +88,7 @@ int Manage_runstop(char *devname, int fd, int runstop, int quiet)
                        return 1;
                }
        }
-       
+
        if (md_get_version(fd) < 9000) {
                fprintf(stderr, Name ": need md driver version 0.90.0 or later\n");
                return 1;
@@ -342,7 +342,7 @@ int Manage_subdevs(char *devname, int fd,
                                }
 
                                /* need to find a sample superblock to copy, and
-                                * a spare slot to use 
+                                * a spare slot to use
                                 */
                                for (j=0; j<st->max_devs; j++) {
                                        char *dev;
@@ -507,7 +507,7 @@ int Manage_subdevs(char *devname, int fd,
                }
        }
        return 0;
-       
+
 }
 
 int autodetect(void)
index 8bc3ecc40ec5f3fb53fc7d518de9cc85f70dc495..d43e5531056a531982c28904209ae55acddd187d 100644 (file)
--- a/Monitor.c
+++ b/Monitor.c
@@ -38,7 +38,7 @@
 static void alert(char *event, char *dev, char *disc, char *mailaddr, char *mailfrom,
                  char *cmd, int dosyslog);
 
-static char *percentalerts[] = { 
+static char *percentalerts[] = {
        "RebuildStarted",
        "Rebuild20",
        "Rebuild40",
@@ -291,11 +291,11 @@ int Monitor(mddev_dev_t devlist,
                                alert("DegradedArray", dev, NULL, mailaddr, mailfrom, alert_cmd, dosyslog);
 
                        if (st->utime == 0 && /* new array */
-                           st->expected_spares > 0 && 
-                           array.spare_disks < st->expected_spares) 
+                           st->expected_spares > 0 &&
+                           array.spare_disks < st->expected_spares)
                                alert("SparesMissing", dev, NULL, mailaddr, mailfrom, alert_cmd, dosyslog);
                        if (mse &&
-                           st->percent == -1 && 
+                           st->percent == -1 &&
                            mse->percent >= 0)
                                alert("RebuildStarted", dev, NULL, mailaddr, mailfrom, alert_cmd, dosyslog);
                        if (mse &&
@@ -401,7 +401,7 @@ int Monitor(mddev_dev_t devlist,
                /* now check if there are any new devices found in mdstat */
                if (scan) {
                        struct mdstat_ent *mse;
-                       for (mse=mdstat; mse; mse=mse->next) 
+                       for (mse=mdstat; mse; mse=mse->next)
                                if (mse->devnum != INT_MAX &&
                                    (strcmp(mse->level, "raid0")!=0 &&
                                     strcmp(mse->level, "linear")!=0)
@@ -467,7 +467,7 @@ int Monitor(mddev_dev_t devlist,
                                                        }
                                                }
                                                if (dev > 0) {
-                                                       if (ioctl(fd2, HOT_REMOVE_DISK, 
+                                                       if (ioctl(fd2, HOT_REMOVE_DISK,
                                                                  (unsigned long)dev) == 0) {
                                                                if (ioctl(fd1, HOT_ADD_DISK,
                                                                          (unsigned long)dev) == 0) {
@@ -504,7 +504,7 @@ static void alert(char *event, char *dev, char *disc, char *mailaddr, char *mail
 
        if (!cmd && !mailaddr) {
                time_t now = time(0);
-              
+
                printf("%1.15s: %s on %s %s\n", ctime(&now)+4, event, dev, disc?disc:"unknown device");
        }
        if (cmd) {
@@ -520,8 +520,8 @@ static void alert(char *event, char *dev, char *disc, char *mailaddr, char *mail
                        exit(2);
                }
        }
-       if (mailaddr && 
-           (strncmp(event, "Fail", 4)==0 || 
+       if (mailaddr &&
+           (strncmp(event, "Fail", 4)==0 ||
             strncmp(event, "Test", 4)==0 ||
             strncmp(event, "Spares", 6)==0 ||
             strncmp(event, "Degrade", 7)==0)) {
diff --git a/Query.c b/Query.c
index 4cfcf5789b9b9e2901f1b009036d83dac182d68b..e1743ef3685e7d79233b71b4315dd2ccfdbf1fa2 100644 (file)
--- a/Query.c
+++ b/Query.c
@@ -34,7 +34,7 @@
 int Query(char *dev)
 {
        /* Give a brief description of the device,
-        * whether it is an md device and whether it has 
+        * whether it is an md device and whether it has
         * a superblock
         */
        int fd = open(dev, O_RDONLY, 0);
@@ -62,7 +62,7 @@ int Query(char *dev)
        if (ioctl(fd, GET_ARRAY_INFO, &array)<0)
                ioctlerr = errno;
        else ioctlerr = 0;
+
        fstat(fd, &stb);
 
        if (vers>=9000 && !ioctlerr) {
@@ -70,7 +70,7 @@ int Query(char *dev)
                        larray_size = 0;
        }
 
-       if (vers < 0) 
+       if (vers < 0)
                printf("%s: is not an md array\n", dev);
        else if (vers < 9000)
                printf("%s: is an md device, but kernel cannot provide details\n", dev);
@@ -91,7 +91,7 @@ int Query(char *dev)
        if (st) {
                superror = st->ss->load_super(st, fd, &super, dev);
                superrno = errno;
-       } else 
+       } else
                superror = -1;
        close(fd);
        if (superror == 0) {
@@ -102,7 +102,7 @@ int Query(char *dev)
                        disc.number = info.disk.number;
                        activity = "undetected";
                        if (mddev && (fd = open(mddev, O_RDONLY))>=0) {
-                               if (md_get_version(fd) >= 9000 &&       
+                               if (md_get_version(fd) >= 9000 &&
                                    ioctl(fd, GET_ARRAY_INFO, &array)>= 0) {
                                        if (ioctl(fd, GET_DISK_INFO, &disc) >= 0 &&
                                            makedev((unsigned)disc.major,(unsigned)disc.minor) == stb.st_rdev)
@@ -117,7 +117,7 @@ int Query(char *dev)
                        mddev = "array";
                }
                printf("%s: device %d in %d device %s %s %s.  Use mdadm --examine for more detail.\n",
-                      dev, 
+                      dev,
                       info.disk.number, info.array.raid_disks,
                       activity,
                       map_num(pers, info.array.level),
@@ -128,4 +128,3 @@ int Query(char *dev)
        return 0;
 }
 
-       
index d07ad7988d2f5a8f0b39ca243b8c28a216e57d5d..cb3290e2e68922ef0758ff0688187b8573cf6ec1 100644 (file)
--- a/ReadMe.c
+++ b/ReadMe.c
@@ -110,7 +110,7 @@ struct option long_options[] = {
 
     /* synonyms */
     {"monitor",   0, 0, 'F'},
-           
+
     /* after those will normally come the name of the md device */
     {"help",      0, 0, 'h'},
     {"help-options",0,0,'h'},
index dcea26337dccaaaf9e27f5b2e0583245bd4e1e19..db2342bd636f904c500a8722f5c11406814601dd 100644 (file)
--- a/bitmap.c
+++ b/bitmap.c
@@ -152,7 +152,7 @@ bitmap_info_t *bitmap_fd_read(int fd, int brief)
        skip = sizeof(info->sb);
 
        sb_le_to_cpu(&info->sb); /* convert superblock to CPU byte ordering */
-       
+
        if (brief || info->sb.sync_size == 0)
                goto out;
 
@@ -219,7 +219,7 @@ bitmap_info_t *bitmap_file_read(char *filename, int brief, struct supertype **st
                if (!st) {
                        /* just look at device... */
                        lseek(fd, 0, 0);
-               } else {        
+               } else {
                        st->ss->locate_bitmap(st, fd, NULL);
                }
                ioctl(fd, BLKFLSBUF, 0); /* make sure we read current data */
@@ -398,7 +398,7 @@ int CreateBitmap(char *filename, int force, char uuid[16],
                }
                bytes -= sizeof(block);
        }
-       
+
        rv = 0;
        fflush(fp);
        /* make the file be the right size (well, to the nearest byte) */
index 055661d1da81f8f91f861c5c031b05090493a786..c8725a30eb338602ea37e56fe1a2dc6a4c731a07 100644 (file)
--- a/bitmap.h
+++ b/bitmap.h
@@ -162,7 +162,7 @@ typedef struct bitmap_super_s {
  * (1) This event counter is updated before the eventcounter in the md superblock
  *    When a bitmap is loaded, it is only accepted if this event counter is equal
  *    to, or one greater than, the event counter in the superblock.
- * (2) This event counter is updated when the other one is *if*and*only*if* the 
+ * (2) This event counter is updated when the other one is *if*and*only*if* the
  *    array is not degraded.  As bits are not cleared when the array is degraded,
  *    this represents the last time that any bits were cleared.
  *    If a device is being added that has an event count with this value or
@@ -187,7 +187,7 @@ struct bitmap_page {
        unsigned int hijacked;
        /*
         * count of dirty bits on the page
-        */ 
+        */
        int count;
 };
 
index 68c1507e821443d1c6687da42cfb0366811d3638..29eadc5927c06816593f0f7c9d1d744a27a1e7a5 100644 (file)
--- a/config.c
+++ b/config.c
@@ -100,7 +100,7 @@ int match_keyword(char *word)
 {
        int len = strlen(word);
        int n;
-    
+
        if (len < 3) return -1;
        for (n=0; keywords[n]; n++) {
                if (strncasecmp(word, keywords[n], len)==0)
@@ -173,7 +173,7 @@ char *conf_word(FILE *file, int allow_key)
        }
        return word;
 }
-       
+
 /*
  * conf_line reads one logical line from the conffile.
  * It skips comments and continues until it finds a line that starts
@@ -237,7 +237,7 @@ mddev_dev_t load_partitions(void)
                if (buf[0] != ' ')
                        continue;
                major = strtoul(buf, &mp, 10);
-               if (mp == buf || *mp != ' ') 
+               if (mp == buf || *mp != ' ')
                        continue;
                minor = strtoul(mp, NULL, 10);
 
@@ -379,7 +379,7 @@ static void createline(char *line)
        }
 }
 
-void devline(char *line) 
+void devline(char *line)
 {
        char *w;
        struct conf_dev *cd;
@@ -494,7 +494,7 @@ void arrayline(char *line)
                } else if (strncasecmp(w, "metadata=", 9) == 0) {
                        /* style of metadata on the devices. */
                        int i;
-                       
+
                        for(i=0; superlist[i] && !mis.st; i++)
                                mis.st = superlist[i]->match_metadata_desc(w+9);
 
@@ -657,7 +657,7 @@ void load_conffile(void)
                }
                free_line(line);
        }
-    
+
        fclose(f);
 
 /*    printf("got file\n"); */
@@ -717,7 +717,7 @@ mddev_dev_t conf_get_devs()
                free(t->devname);
                free(t);
        }
-    
+
        load_conffile();
 
        if (cdevlist == NULL)
diff --git a/md_p.h b/md_p.h
index ed2e5fd92dd66f7c6977ca88a8b4cd52473f410f..a9f0204c754a4ab9ac12d02ff5e182910b45cca1 100644 (file)
--- a/md_p.h
+++ b/md_p.h
@@ -1,15 +1,15 @@
 /*
    md_p.h : physical layout of Linux RAID devices
           Copyright (C) 1996-98 Ingo Molnar, Gadi Oxman
-         
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2, or (at your option)
    any later version.
-   
+
    You should have received a copy of the GNU General Public License
    (for example /usr/src/linux/COPYING); if not, write to the Free
-   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
+   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
 #ifndef _MD_P_H
@@ -80,7 +80,7 @@
 #define MD_DISK_REMOVED                3 /* disk is in sync with the raid set */
 
 #define        MD_DISK_WRITEMOSTLY     9 /* disk is "write-mostly" is RAID1 config.
-                                  * read requests will only be sent here in 
+                                  * read requests will only be sent here in
                                   * dire need
                                   */
 
@@ -190,5 +190,5 @@ static inline __u64 md_event(mdp_super_t *sb) {
        return (ev<<32)| sb->events_lo;
 }
 
-#endif 
+#endif
 
diff --git a/md_u.h b/md_u.h
index 6b067c6ae34859fa55b756d8265651cd9c003f69..a874cec1c2c2d12f68099ee9e72814e848554a05 100644 (file)
--- a/md_u.h
+++ b/md_u.h
@@ -1,15 +1,15 @@
 /*
    md_u.h : user <=> kernel API between Linux raidtools and RAID drivers
           Copyright (C) 1998 Ingo Molnar
-         
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2, or (at your option)
    any later version.
-   
+
    You should have received a copy of the GNU General Public License
    (for example /usr/src/linux/COPYING); if not, write to the Free
-   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
+   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
 #ifndef _MD_U_H
@@ -119,5 +119,5 @@ typedef struct mdu_param_s
        int                     max_fault;      /* unused for now */
 } mdu_param_t;
 
-#endif 
+#endif
 
diff --git a/mdadm.c b/mdadm.c
index 40fdccf758f87c51ade57d2d637d4e845ef60642..b4b503dd288b1b70ec27419350d0b9d385aaf284 100644 (file)
--- a/mdadm.c
+++ b/mdadm.c
@@ -26,7 +26,7 @@
  *           Sydney, 2052
  *           Australia
  *
- *    Additions for bitmap and write-behind RAID options, Copyright (C) 2003-2004, 
+ *    Additions for bitmap and write-behind RAID options, Copyright (C) 2003-2004,
  *    Paul Clements, SteelEye Technology, Inc.
  */
 
@@ -133,7 +133,7 @@ int main(int argc, char *argv[])
                /* firstly, some mode-independant options */
                switch(opt) {
                case 'h':
-                       if (option_index > 0 && 
+                       if (option_index > 0 &&
                            strcmp(long_options[option_index].name, "help-options")==0)
                                print_help = 2;
                        else
@@ -174,7 +174,7 @@ int main(int argc, char *argv[])
                }
                /* second, figure out the mode.
                 * Some options force the mode.  Others
-                * set the mode if it isn't already 
+                * set the mode if it isn't already
                 */
 
                switch(opt) {
@@ -232,7 +232,7 @@ int main(int argc, char *argv[])
                        mode = newmode;
                } else {
                        /* special case of -c --help */
-                       if (opt == 'c' && 
+                       if (opt == 'c' &&
                            ( strncmp(optarg, "--h", 3)==0 ||
                              strncmp(optarg, "-h", 2)==0)) {
                                fputs(Help_config, stdout);
@@ -255,7 +255,7 @@ int main(int argc, char *argv[])
                                        dv->next = NULL;
                                        *devlistend = dv;
                                        devlistend = &dv->next;
-                       
+
                                        devs_found++;
                                        continue;
                                }
@@ -307,7 +307,7 @@ int main(int argc, char *argv[])
                        dv->next = NULL;
                        *devlistend = dv;
                        devlistend = &dv->next;
-                       
+
                        devs_found++;
                        continue;
                }
@@ -342,7 +342,7 @@ int main(int argc, char *argv[])
                                fprintf(stderr, Name ": metadata information already given\n");
                                exit(2);
                        }
-                       for(i=0; !ss && superlist[i]; i++) 
+                       for(i=0; !ss && superlist[i]; i++)
                                ss = superlist[i]->match_metadata_desc(optarg);
 
                        if (!ss) {
@@ -451,7 +451,7 @@ int main(int argc, char *argv[])
                        case -5: /* Faulty
                                  * modeNNN
                                  */
-                                   
+
                        {
                                int ln = strcspn(optarg, "0123456789");
                                char *m = strdup(optarg);
@@ -584,7 +584,7 @@ int main(int argc, char *argv[])
                                exit(2);
                        }
                        update = optarg;
-                       if (strcmp(update, "sparc2.2")==0) 
+                       if (strcmp(update, "sparc2.2")==0)
                                continue;
                        if (strcmp(update, "super-minor") == 0)
                                continue;
@@ -605,7 +605,7 @@ int main(int argc, char *argv[])
                                        fprintf(stderr, Name ": must not set metadata type with --update=byteorder.\n");
                                        exit(2);
                                }
-                               for(i=0; !ss && superlist[i]; i++) 
+                               for(i=0; !ss && superlist[i]; i++)
                                        ss = superlist[i]->match_metadata_desc("0.swap");
                                if (!ss) {
                                        fprintf(stderr, Name ": INTERNAL ERROR cannot find 0.swap\n");
@@ -941,7 +941,7 @@ int main(int argc, char *argv[])
                        exit(2);
                }
                if ((int)ident.super_minor == -2 && autof) {
-                       fprintf(stderr, Name ": --super-minor=dev is incompatible with --auto\n");      
+                       fprintf(stderr, Name ": --super-minor=dev is incompatible with --auto\n");
                        exit(2);
                }
                if (mode == MANAGE || mode == GROW)
@@ -1010,7 +1010,7 @@ int main(int argc, char *argv[])
                                        devlist->devname);
                                rv |= 1;
                        } else {
-                               mdfd = open_mddev(devlist->devname, 
+                               mdfd = open_mddev(devlist->devname,
                                                  array_ident->autof ? array_ident->autof : autof);
                                if (mdfd < 0)
                                        rv |= 1;
@@ -1042,7 +1042,7 @@ int main(int argc, char *argv[])
                                        rv |= 1;
                                        continue;
                                }
-                               mdfd = open_mddev(dv->devname, 
+                               mdfd = open_mddev(dv->devname,
                                                  array_ident->autof ?array_ident->autof : autof);
                                if (mdfd < 0) {
                                        rv |= 1;
@@ -1310,7 +1310,7 @@ int main(int argc, char *argv[])
 
        case GROW:
                if (devs_found > 1) {
-                       
+
                        /* must be '-a'. */
                        if (size >= 0 || raiddisks) {
                                fprintf(stderr, Name ": --size, --raiddisks, and --add are exclusing in --grow mode\n");
diff --git a/mdadm.h b/mdadm.h
index dba09f0f838ee8f61f69c63a573e9e250097b0de..5e9eeee71a78b808be34f2d46c858844b18fd648 100644 (file)
--- a/mdadm.h
+++ b/mdadm.h
@@ -195,7 +195,7 @@ enum special_options {
 #define UnSet (0xfffe)
 typedef struct mddev_ident_s {
        char    *devname;
-       
+
        int     uuid_set;
        int     uuid[4];
        char    name[33];
index ebaba950705bb2dc2ca7dab30b582b2dc453b0e5..55252dc10fcb36898f733ccd4319d5c02a02b353 100644 (file)
--- a/mdopen.c
+++ b/mdopen.c
@@ -193,7 +193,7 @@ int open_mddev(char *dev, int autof)
                 * If the device name is in a 'standard' format,
                 * intuit the minor from that, else
                 * easiest to read /proc/mdstat, and hunt through for
-                * an unused number 
+                * an unused number
                 */
                if (num < 0) {
                        /* need to pick an unused number */
index 335e1e58b78aac7b12fb6137e4479db8b0ae928d..a8f7ce7576eb1d017acfe962a1dea48084cde5d2 100644 (file)
--- a/mdstat.c
+++ b/mdstat.c
@@ -161,7 +161,7 @@ struct mdstat_ent *mdstat_read(int hold, int start)
 
                ent->dev = strdup(line);
                ent->devnum = devnum;
-               
+
                for (w=dl_next(line); w!= line ; w=dl_next(w)) {
                        int l = strlen(w);
                        char *eq;
@@ -209,7 +209,7 @@ struct mdstat_ent *mdstat_read(int hold, int start)
                                   strncmp(w, "resync", 4)==0) {
                                ent->resync = 1;
                        } else if (ent->percent == -1 &&
-                                  w[0] >= '0' && 
+                                  w[0] >= '0' &&
                                   w[0] <= '9' &&
                                   w[l-1] == '%') {
                                ent->percent = atoi(w);
index 98615a696df3cff0cbf65bfd69226cd91baaad48..d8e62c2ce993ed7b0bc84c4d857f06afa8e60543 100644 (file)
@@ -52,7 +52,7 @@ raid5_extend(unsigned long len, int chunksize, int layout, int n, int m, int rfd
     unsigned int blocksperchunk= chunksize/4096;
 
     unsigned long b;
-    
+
     for (b=0; b<blocks; b++) {
        unsigned long stripe = b / blocksperchunk;
        unsigned int offset = b - (stripe*blocksperchunk);
index 0396c2cd81b4e26074de176c00444d1f818e45c9..2a2938dfdd8c4aa0253059e25e8849660745d3e4 100644 (file)
--- a/super0.c
+++ b/super0.c
@@ -38,7 +38,7 @@
  *   - initialising a new superblock
  *   - printing the superblock for --examine
  *   - printing part of the superblock for --detail
- * .. other stuff 
+ * .. other stuff
  */
 
 
@@ -56,7 +56,7 @@ static unsigned long calc_sb0_csum(mdp_super_t *super)
 void super0_swap_endian(struct mdp_superblock_s *sb)
 {
        /* as super0 superblocks are host-endian, it is sometimes
-        * useful to be able to swap the endianness 
+        * useful to be able to swap the endianness
         * as (almost) everything is u32's we byte-swap every 4byte
         * number.
         * We then also have to swap the events_hi and events_lo
@@ -403,14 +403,14 @@ static int update_super0(struct mdinfo *info, void *sbv, char *update,
        if (strcmp(update, "summaries") == 0) {
                int i;
                /* set nr_disks, active_disks, working_disks,
-                * failed_disks, spare_disks based on disks[] 
+                * failed_disks, spare_disks based on disks[]
                 * array in superblock.
                 * Also make sure extra slots aren't 'failed'
                 */
                sb->nr_disks = sb->active_disks =
                        sb->working_disks = sb->failed_disks =
                        sb->spare_disks = 0;
-               for (i=0; i < MD_SB_DISKS ; i++) 
+               for (i=0; i < MD_SB_DISKS ; i++)
                        if (sb->disks[i].major ||
                            sb->disks[i].minor) {
                                int state = sb->disks[i].state;
@@ -727,7 +727,7 @@ static int load_super0(struct supertype *st, int fd, void **sbp, char *devname)
        mdp_super_t *super;
        int uuid[4];
        struct bitmap_super_s *bsb;
-    
+
        if (!get_dev_size(fd, devname, &dsize))
                return 1;
 
@@ -910,7 +910,7 @@ int write_bitmap0(struct supertype *st, int fd, void *sbv)
        unsigned long long dsize;
        unsigned long long offset;
        mdp_super_t *sb = sbv;
-    
+
        int rv = 0;
 
        int towrite, n;
@@ -938,7 +938,7 @@ int write_bitmap0(struct supertype *st, int fd, void *sbv)
        memset(buf, 0xff, sizeof(buf));
        while (towrite > 0) {
                n = towrite;
-               if (n > sizeof(buf)) 
+               if (n > sizeof(buf))
                        n = sizeof(buf);
                n = write(fd, buf, n);
                if (n > 0)
diff --git a/util.c b/util.c
index f57613f533a993f4e72b9aeea6bbb52cc451eb8c..4a751aaf1350f8db0c96d62ab5bcf69a3f6c7916 100644 (file)
--- a/util.c
+++ b/util.c
@@ -73,33 +73,32 @@ struct blkpg_partition {
  */
 int parse_uuid(char *str, int uuid[4])
 {
-    int hit = 0; /* number of Hex digIT */
-    int i;
-    char c;
-    for (i=0; i<4; i++) uuid[i]=0;
-
-    while ((c= *str++)) {
-       int n;
-       if (c>='0' && c<='9')
-           n = c-'0';
-       else if (c>='a' && c <= 'f')
-           n = 10 + c - 'a';
-       else if (c>='A' && c <= 'F')
-           n = 10 + c - 'A';
-       else if (strchr(":. -", c))
-           continue;
-       else return 0;
-
-       if (hit<32) {
-           uuid[hit/8] <<= 4;
-           uuid[hit/8] += n;
+       int hit = 0; /* number of Hex digIT */
+       int i;
+       char c;
+       for (i=0; i<4; i++) uuid[i]=0;
+
+       while ((c= *str++)) {
+               int n;
+               if (c>='0' && c<='9')
+                       n = c-'0';
+               else if (c>='a' && c <= 'f')
+                       n = 10 + c - 'a';
+               else if (c>='A' && c <= 'F')
+                       n = 10 + c - 'A';
+               else if (strchr(":. -", c))
+                       continue;
+               else return 0;
+
+               if (hit<32) {
+                       uuid[hit/8] <<= 4;
+                       uuid[hit/8] += n;
+               }
+               hit++;
        }
-       hit++;
-    }
-    if (hit == 32)
-       return 1;
-    return 0;
-    
+       if (hit == 32)
+               return 1;
+       return 0;
 }
 
 
@@ -132,7 +131,6 @@ int md_get_version(int fd)
     return -1;
 }
 
-    
 int get_linux_version()
 {
        struct utsname name;
@@ -224,7 +222,7 @@ int same_uuid(int a[4], int b[4], int swapuuid)
        if (swapuuid) {
                /* parse uuids are hostendian.
                 * uuid's from some superblocks are big-ending
-                * if there is a difference, we need to swap.. 
+                * if there is a difference, we need to swap..
                 */
                unsigned char *ac = (unsigned char *)a;
                unsigned char *bc = (unsigned char *)b;
@@ -318,7 +316,7 @@ int check_reiser(int fd, char *name)
        fprintf(stderr, Name ": %s appears to contain a reiserfs file system\n",name);
        size = sb[0]|(sb[1]|(sb[2]|sb[3]<<8)<<8)<<8;
        fprintf(stderr, "    size = %luK\n", size*4);
-               
+
        return 1;
 }
 
@@ -391,7 +389,7 @@ int is_standard(char *dev, int *nump)
 {
        /* tests if dev is a "standard" md dev name.
         * i.e if the last component is "/dNN" or "/mdNN",
-        * where NN is a string of digits 
+        * where NN is a string of digits
         */
        char *d = strrchr(dev, '/');
        int type=0;
@@ -546,7 +544,7 @@ unsigned long calc_csum(void *super, int bytes)
                newcsum+= superc[i];
        csum = (newcsum& 0xffffffff) + (newcsum>>32);
 #ifdef __alpha__
-/* The in-kernel checksum calculation is always 16bit on 
+/* The in-kernel checksum calculation is always 16bit on
  * the alpha, though it is 32 bit on i386...
  * I wonder what it is elsewhere... (it uses and API in
  * a way that it shouldn't).
@@ -592,7 +590,6 @@ char *human_size(long long bytes)
 char *human_size_brief(long long bytes)
 {
        static char buf[30];
-       
 
        if (bytes < 5000*1024)
                snprintf(buf, sizeof(buf), "%ld.%02ldKiB",
@@ -753,7 +750,7 @@ struct supertype *guess_super(int fd)
        struct supertype *st;
        unsigned long besttime = 0;
        int bestsuper = -1;
-       
+
        void *sbp = NULL;
        int i;