On Wed, Nov 14, 2018 at 11:05:16PM +0200, Nikolay Borisov wrote:
> 
> 
> On 14.11.18 г. 21:53 ч., David Sterba wrote:
> > On Wed, Nov 14, 2018 at 02:54:37PM +0100, Johannes Thumshirn wrote:
> >> On 14/11/2018 14:52, Nikolay Borisov wrote:
> >>> I agree with this patch, however you go into the gray area of
> >>> "everything which is exported should have btrfs_ prefix". It's up to
> >>> David to see if he is content with this change.
> >>
> >> Yep you're right. I think I should change it, but I'll wait for David's
> >> response first.
> > 
> > There's one prior example of the conditionally exported functions:
> > btrfs_find_lock_delalloc_range . This function declaration and
> > definition are under the ifdef and it's a simple wrapper around a static
> > function find_lock_delalloc_range.
> 
> I have a patch which actually simplifies this somewhat because,
> frankly I find it stupid and redundant to do this frickin' dance for
> functions which are used only in debugging. Here is the diff (still
> not submitted since it's waiting for some other cleanups to be
> merged): 
> 
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -1556,10 +1556,13 @@ static noinline int lock_delalloc_pages(struct inode 
> *inode,
>   *
>   * 1 is returned if we find something, 0 if nothing was in the tree
>   */
> -static noinline_for_stack u64 find_lock_delalloc_range(struct inode *inode,
> -                                   struct extent_io_tree *tree,
> -                                   struct page *locked_page, u64 *start,
> -                                   u64 *end)
> +#ifndef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
> +static
> +#endif
> +noinline_for_stack u64 find_lock_delalloc_range(struct inode *inode,
> +                                               struct extent_io_tree *tree,
> +                                               struct page *locked_page,
> +                                               u64 *start, u64 *end)

If there's nostatic_for_tests or export_for_tests (possibly all caps),
then ok.

Reply via email to