Re: [PATCH 04/10] Show all bitmaps while examining bitmap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 30 Apr 2015 11:17:28 +0800 Guoqing Jiang <gqJiang@xxxxxxxx> wrote:

> NeilBrown wrote:
> > On Fri, 24 Apr 2015 15:30:35 +0800 gqjiang@xxxxxxxx wrote:
> >
> >   
> >> From: Guoqing Jiang <gqjiang@xxxxxxxx>
> >>
> >> This adds capability of exmining bitmaps corresponding to all
> >> nodes/slots on the device.
> >>
> >> Signed-off-by: Goldwyn Rodrigues <rgoldwyn@xxxxxxxx>
> >> Signed-off-by: Guoqing Jiang <gqjiang@xxxxxxxx>
> >> ---
> >>  bitmap.c | 35 ++++++++++++++++++++++++++---------
> >>  1 file changed, 26 insertions(+), 9 deletions(-)
> >>
> >> diff --git a/bitmap.c b/bitmap.c
> >> index b1d54a6..ab83f4e 100644
> >> --- a/bitmap.c
> >> +++ b/bitmap.c
> >> @@ -258,7 +258,7 @@ int ExamineBitmap(char *filename, int brief, struct supertype *st)
> >>  	int rv = 1;
> >>  	char buf[64];
> >>  	int swap;
> >> -	int fd;
> >> +	int fd, i;
> >>  	__u32 uuid32[4];
> >>  
> >>  	fd = bitmap_file_open(filename, &st);
> >> @@ -315,9 +315,6 @@ int ExamineBitmap(char *filename, int brief, struct supertype *st)
> >>  		       uuid32[2],
> >>  		       uuid32[3]);
> >>  
> >> -	printf("          Events : %llu\n", (unsigned long long)sb->events);
> >> -	printf("  Events Cleared : %llu\n", (unsigned long long)sb->events_cleared);
> >> -	printf("           State : %s\n", bitmap_state(sb->state));
> >>     
> >
> > Can we please leave this where it is in the case where there is only one node?
> > Only move it down if there are multiple nodes to report on.
> >
> >   
> Yes, it could be possible. Just to make sure understand you correctly,
> what about the below?
> 
> if (sb->nodes == 0) {
>     /* code for more than one node */
> } else {
>    /* original code */
> }
> 

Something a bit like that, though !=0 of course.

The original code put some info at the top.  When there are multiple nodes
that makes more sense  at the bottom.
So:

 if (sb->nodes == 0) {
    original code that will be moved
 }
 more original code that isn't changing
 if (sb->nodes == 0) {
    other original code
 } else {
    new code
 }

or something like that.

Thanks,
NeilBrown


> Thanks,
> Guoqing
> 
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Attachment: pgpIAHqfWtPyZ.pgp
Description: OpenPGP digital signature


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux