Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Josef Bacik <jbacik@fb.com>
To: Zach Brown <zab@redhat.com>
Cc: <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] Btrfs: add a extent ref verify tool V2
Date: Fri, 9 May 2014 16:45:05 -0400	[thread overview]
Message-ID: <536D3E51.80209@fb.com> (raw)
In-Reply-To: <20140508233414.GC12210@lenny.home.zabbo.net>

On 05/08/2014 07:34 PM, Zach Brown wrote:
>> +#ifdef CONFIG_BTRFS_FS_REF_VERIFY
>> +int btrfs_build_ref_tree(struct btrfs_fs_info *fs_info);
>> +void btrfs_free_ref_cache(struct btrfs_fs_info *fs_info);
>> +int btrfs_ref_tree_mod(struct btrfs_root *root, u64 bytenr, u64 num_bytes,
>> +		       u64 parent, u64 ref_root, u64 owner, u64 offset,
>> +		       int action);
>> +void btrfs_free_ref_tree_range(struct btrfs_fs_info *fs_info, u64 start,
>> +			       u64 len);
>> +#else
>> +
>> +#define btrfs_free_ref_cache(fs_info) do { } while (0)
>> +#define btrfs_ref_tree_mod(root, bytenr, num_bytes, parent, ref_root,	\
>> +			   owner, offset, action) do { } while (0)
>> +#define btrfs_free_ref_tree_range(fs_info, start, len) do { } while (0)
>> +
>> +#endif /* CONFIG_BTRFS_FS_REF_VERIFY */
>> +#endif /* _REF_VERIFY__ */
>
> Don't just omit the arguments when the config isn't enabled.  That can
> let these calls bit rot over time as everyone build tests their changes
> with the config disabled, as they will.
>
> 	int derp;
>
> 	...
>
> 	btrfs_free_ref_cache(derp);
>
> 	...
>
> -	derp++;
>
>
> Will have gcc warn that derp is unused.  They'll delete it and send out
> the patch.  You'll later turn on the config and get undefined derp
> warnings.
>
> inline stubs are the best way out.  They'll still warn if the arg is
> used undefined.  Putting (void)arg; in the macros doesn't warn in that
> case.

Gcc doesn't complain when I build with it off but I can switch to inline 
stubs if that makes you feel better.  Thanks,

Josef


  reply	other threads:[~2014-05-09 20:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-08 20:55 [PATCH] Btrfs: add a extent ref verify tool V2 Josef Bacik
2014-05-08 23:34 ` Zach Brown
2014-05-09 20:45   ` Josef Bacik [this message]
2014-05-09 20:53     ` Zach Brown
  -- strict thread matches above, loose matches on Subject: below --
2014-03-28 20:20 Josef Bacik

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=536D3E51.80209@fb.com \
    --to=jbacik@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=zab@redhat.com \
    /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