summaryrefslogtreecommitdiff
path: root/Grow.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2013-05-21 11:32:57 +1000
committerNeilBrown <neilb@suse.de>2013-05-21 11:32:57 +1000
commit5582b118c6ddfcd2851ccd5c0027d44c79916cbd (patch)
treef4c9eb84ae3d3b9c1c5a099fb1dc2e5a4178b59c /Grow.c
parent74db60b00a43a5ae636477c10c24e923e76049ce (diff)
Grow: replace '1' with 'INVALID_SECTORS' where appropriate.
Here are some '1's which missed the introduction of INVALID_SECTORS as a useful #define. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Grow.c')
-rw-r--r--Grow.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/Grow.c b/Grow.c
index 948fc8d9..f972f22e 100644
--- 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 =