public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: Siddhartha Swaroop <siddhartha.swaroop@greenturtles.in>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: Is this function used?
Date: Wed, 22 Apr 2009 09:23:26 -0400	[thread overview]
Message-ID: <1240406606.4731.41.camel@think.oraclecorp.com> (raw)
In-Reply-To: <d853ebb60904220409w20ed0e55y6834cd5de0d06a2@mail.gmail.com>

On Wed, 2009-04-22 at 16:39 +0530, Siddhartha Swaroop wrote:
> Hello ,
> 
> Inside the file ctree.c at line 762 there is a function called
> check_block( ). The source code of that function is as follows
> 
> static noinline int check_block(struct btrfs_root *root,
>                                 struct btrfs_path *path, int level)
> {
>         return 0;
>         if (level == 0)
>                 return check_leaf(root, path, level);
>         return check_node(root, path, level);
> }
> 
> This function is called by balance_level and btrfs_search_slot
> functions.
> 
> By seeing this check_block function u may come to know that this
> function will not work if it is called,it will just return zero (means
> success) without doing anyother work.
>  I need to know why this code is written?

We should put the return 0 inside  CONFIG option for more extensive
metadata checking.  I enable check_block when I'm making changes that
are likely to cause corruptions in the btree code.  It tends to find
them more quickly.

-chris



           reply	other threads:[~2009-04-22 13:23 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <d853ebb60904220409w20ed0e55y6834cd5de0d06a2@mail.gmail.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1240406606.4731.41.camel@think.oraclecorp.com \
    --to=chris.mason@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=siddhartha.swaroop@greenturtles.in \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox