]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Grow: replace '1' with 'INVALID_SECTORS' where appropriate.
authorNeilBrown <neilb@suse.de>
Tue, 21 May 2013 01:32:57 +0000 (11:32 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 21 May 2013 01:32:57 +0000 (11:32 +1000)
Here are some '1's which missed the introduction of INVALID_SECTORS
as a useful #define.

Signed-off-by: NeilBrown <neilb@suse.de>
Grow.c

diff --git a/Grow.c b/Grow.c
index 948fc8d9ee915e5293832905ed408c742f86befc..f972f22e5a024439378e9427edfaf68bd2484c1a 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -2237,7 +2237,7 @@ static int raid10_reshape(char *container, int fd, char *devname,
                        /* Don't need any space as array is shrinking
                         * just move data_offset up by min
                         */
-                       if (data_offset == 1)
+                       if (data_offset == INVALID_SECTORS)
                                info2.new_data_offset = info2.data_offset + min;
                        else {
                                if ((unsigned long long)data_offset
@@ -2255,7 +2255,7 @@ static int raid10_reshape(char *container, int fd, char *devname,
                                        dn);
                                goto release;
                        }
-                       if (data_offset == 1)
+                       if (data_offset == INVALID_SECTORS)
                                info2.new_data_offset = info2.data_offset - min;
                        else {
                                if ((unsigned long long)data_offset
@@ -2272,7 +2272,7 @@ static int raid10_reshape(char *container, int fd, char *devname,
                                 * might guide us, otherwise choose
                                 * direction with most space
                                 */
-                               if (data_offset == 1) {
+                               if (data_offset == INVALID_SECTORS) {
                                        if (info2.space_before > info2.space_after)
                                                dir = -1;
                                        else
@@ -2291,13 +2291,13 @@ static int raid10_reshape(char *container, int fd, char *devname,
                                                dn);
                                        goto release;
                                }
-                               if (data_offset != 1 &&
+                               if (data_offset != INVALID_SECTORS &&
                                    data_offset < info2.data_offset + min) {
                                        fprintf(stderr, Name ": --data-offset too small on %s\n",
                                                dn);
                                        goto release;
                                }
-                               if (data_offset != 1)
+                               if (data_offset != INVALID_SECTORS)
                                        info2.new_data_offset = data_offset;
                                else {
                                        unsigned long long off =
@@ -2315,13 +2315,13 @@ static int raid10_reshape(char *container, int fd, char *devname,
                                                dn);
                                        goto release;
                                }
-                               if (data_offset != 1 &&
+                               if (data_offset != INVALID_SECTORS &&
                                    data_offset < info2.data_offset - min) {
                                        fprintf(stderr, Name ": --data-offset too small on %s\n",
                                                dn);
                                        goto release;
                                }
-                               if (data_offset != 1)
+                               if (data_offset != INVALID_SECTORS)
                                        info2.new_data_offset = data_offset;
                                else {
                                        unsigned long long off =