Re: [PATCH 1/2] super1: replace hard-coded values with bit definitions
Gioh Kimwrites: > Some hard-coded values for disk status are replaced > with bit definitions. > > Signed-off-by: Gioh Kim > --- > super1.c | 7 --- > 1 file changed, 4 insertions(+), 3 deletions(-) Applied! Please use --cover-letter when you send out multi-commit patch sets, which includes a short description of what the set includes. That way I can just respond to the cover letter if all the patches are applied. Thanks, Jes
Re: [PATCH 1/2] super1: replace hard-coded values with bit definitions
Gioh Kim writes: > Some hard-coded values for disk status are replaced > with bit definitions. > > Signed-off-by: Gioh Kim > --- > super1.c | 7 --- > 1 file changed, 4 insertions(+), 3 deletions(-) Applied! Please use --cover-letter when you send out multi-commit patch sets, which includes a short description of what the set includes. That way I can just respond to the cover letter if all the patches are applied. Thanks, Jes
[PATCH 1/2] super1: replace hard-coded values with bit definitions
Some hard-coded values for disk status are replaced with bit definitions. Signed-off-by: Gioh Kim--- super1.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/super1.c b/super1.c index f3520ac..e8b9f61 100644 --- a/super1.c +++ b/super1.c @@ -1010,7 +1010,7 @@ static void getinfo_super1(struct supertype *st, struct mdinfo *info, char *map) info->disk.state = 0; /* spare: not active, not sync, not faulty */ break; case MD_DISK_ROLE_FAULTY: - info->disk.state = 1; /* faulty */ + info->disk.state = (1 << MD_DISK_FAULTY); /* faulty */ break; case MD_DISK_ROLE_JOURNAL: info->disk.state = (1 << MD_DISK_JOURNAL); @@ -1503,11 +1503,12 @@ static int add_to_super1(struct supertype *st, mdu_disk_info_t *dk, } dk_state = dk->state & ~(1< raid_disk); else if (dk_state & (1< spare */ + else if ((dk_state & ~(1< spare */ *rp = MD_DISK_ROLE_SPARE; else *rp = MD_DISK_ROLE_FAULTY; -- 2.5.0
[PATCH 1/2] super1: replace hard-coded values with bit definitions
Some hard-coded values for disk status are replaced with bit definitions. Signed-off-by: Gioh Kim --- super1.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/super1.c b/super1.c index f3520ac..e8b9f61 100644 --- a/super1.c +++ b/super1.c @@ -1010,7 +1010,7 @@ static void getinfo_super1(struct supertype *st, struct mdinfo *info, char *map) info->disk.state = 0; /* spare: not active, not sync, not faulty */ break; case MD_DISK_ROLE_FAULTY: - info->disk.state = 1; /* faulty */ + info->disk.state = (1 << MD_DISK_FAULTY); /* faulty */ break; case MD_DISK_ROLE_JOURNAL: info->disk.state = (1 << MD_DISK_JOURNAL); @@ -1503,11 +1503,12 @@ static int add_to_super1(struct supertype *st, mdu_disk_info_t *dk, } dk_state = dk->state & ~(1