xfs
[Top] [All Lists]

RE: [PATCH 10/14] repair: cleanup helpers for tracking block usage

To: "Christoph Hellwig" <hch@xxxxxxxxxxxxx>
Subject: RE: [PATCH 10/14] repair: cleanup helpers for tracking block usage
From: "Alex Elder" <aelder@xxxxxxx>
Date: Wed, 21 Oct 2009 14:33:05 -0500
Cc: "Barry Naujok" <bnaujok@xxxxxxx>, <xfs@xxxxxxxxxxx>
In-reply-to: <20090902175841.479553130@xxxxxxxxxxxxxxxxxxxxxx>
Thread-index: Acor+RDI6AR3SMpvRr2R8Dya/Y9vCgmiWvxA
Thread-topic: [PATCH 10/14] repair: cleanup helpers for tracking block usage
Christoph Hellwig wrote:
> Rename get_agbno_state/set_agbno_state to get_bmap/set_bmap because
> those names are more self-descriptive.  Remove the superblous mount
> argument to the as the current filesystem is a global in repair.
> Remove the fsbno taking variant as they just complicated the code.
> Bring all uses of them into the canonical form.

Another big pile o' whitespace changes here, wish they were
separated so it was clearer to see what *really* changed...

One bad bug indicated in comments below, but easy to fix.

But this looks good otherwise.

> Signed-off-by: Barry Naujok <bnaujok@xxxxxxx>
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Reviewed-by: Alex Elder <aelder@xxxxxxx>


> Index: xfsprogs-dev/repair/scan.c
> ===================================================================
> --- xfsprogs-dev.orig/repair/scan.c   2009-08-21 19:05:32.000000000 +0000
> +++ xfsprogs-dev/repair/scan.c        2009-08-21 19:06:51.000000000 +0000

. . .

> @@ -476,19 +480,15 @@ scanfunc_allocbt(
>       /*
>        * check for btree blocks multiply claimed
>        */
> -     state = get_agbno_state(mp, agno, bno);
> -
> -     switch (state)  {
> -     case XR_E_UNKNOWN:
> -             set_agbno_state(mp, agno, bno, XR_E_FS_MAP);
> -             break;
> -     default:
> -             set_agbno_state(mp, agno, bno, XR_E_MULT);
> +     state = get_bmap(agno, bno);
> +     switch (state != XR_E_UNKNOWN)  {

BUG.      You mean "if (state != XR_E_UNKNOWN)"???

> +             set_bmap(agno, bno, XR_E_MULT);
>               do_warn(
>  _("%s freespace btree block claimed (state %d), agno %d, bno %d, suspect 
> %d\n"),
>                               name, state, agno, bno, suspect);
>               return;
>       }
> +     set_bmap(agno, bno, XR_E_FS_MAP);
> 
>       numrecs = be16_to_cpu(block->bb_numrecs);
> 

<Prev in Thread] Current Thread [Next in Thread>
  • RE: [PATCH 10/14] repair: cleanup helpers for tracking block usage, Alex Elder <=