xfs
[Top] [All Lists]

Re: xfs: encapsulate a block of debug code

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: xfs: encapsulate a block of debug code
From: Alex Elder <aelder@xxxxxxx>
Date: Tue, 19 Jul 2011 14:49:12 -0500
Cc: <xfs@xxxxxxxxxxx>
In-reply-to: <20110719171028.GA31088@xxxxxxxxxxxxx>
References: <201107181814.p6IIEAZm028909@xxxxxxxxxxxxxxxxxxxxxx> <20110719171028.GA31088@xxxxxxxxxxxxx>
Reply-to: <aelder@xxxxxxx>
On Tue, 2011-07-19 at 13:10 -0400, Christoph Hellwig wrote:
> On Mon, Jul 18, 2011 at 01:14:09PM -0500, Alex Elder wrote:
> > Pull into a helper function some debug-only code that validates a
> > xfs_da_blkinfo structure that's been read from disk.
> > 
> > Signed-off-by: Alex Elder <aelder@xxxxxxx>
> > 
> > ---
> >  fs/xfs/xfs_da_btree.c |   31 ++++++++++++++++++++-----------
> >  1 file changed, 20 insertions(+), 11 deletions(-)
> > 
> > Index: b/fs/xfs/xfs_da_btree.c
> > ===================================================================
> > --- a/fs/xfs/xfs_da_btree.c
> > +++ b/fs/xfs/xfs_da_btree.c
> > @@ -692,6 +692,24 @@ xfs_da_join(xfs_da_state_t *state)
> >     return(error);
> >  }
> >  
> > +#ifdef     DEBUG
> > +static void
> > +xfs_da_blkinfo_validate(struct xfs_da_blkinfo *blkinfo, __u16 level)
> 
> I'm not sure the name is a good one.  E.g. the forw/backw pointers
> really rely on this node not having any siblings.  Which they shoudn't
> have here, but that's not generally true of any blkinfo.
> 
> Otherwise looks fine.
> 

What about xfs_da_blkinfo_onlychild_validate()?

It's pushing the limits of acceptable name length
as far as I'm concerned though.  Let me know if
this is good enough, or if you have another idea.
Thanks.

                                        -Alex

<Prev in Thread] Current Thread [Next in Thread>