Re: [PATCH 00/67] btrfs-progs: add the stack prefix for the set/get

2018-01-23 Thread Lu Fengqi
On Tue, Jan 23, 2018 at 03:29:50PM +0100, David Sterba wrote:
>On Thu, Jan 11, 2018 at 01:08:32PM +0800, Lu Fengqi wrote:
>> These set/get functions defined by BTRFS_SETGET_STACK_FUNCS macro is
>> missing the prefix stack. I can't add an extent buffer version set/get
>> function as the result of the function name conflict.
>
>Why do you need to add the extent buffer set/get helpers?

I just want to use the extent_buffer version set helper to set the
refs/flags of root_item. Of course, I can read_extent_buffer at first,
then use the stack version set helper, and write_extent_buffer at last.

>
>The function names will become quite long after adding the _stack
>string, so I'd rather be sure we really need it before changing the
>names everywhere.

Personally, I think we should follow the naming scheme to differentiate
between the stack version helper and the extent_buffer version helper
since we already have such a naming scheme.

>--
>To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
>the body of a message to majord...@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>

-- 
Thanks,
Lu


--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 00/67] btrfs-progs: add the stack prefix for the set/get

2018-01-23 Thread David Sterba
On Thu, Jan 11, 2018 at 01:08:32PM +0800, Lu Fengqi wrote:
> These set/get functions defined by BTRFS_SETGET_STACK_FUNCS macro is
> missing the prefix stack. I can't add an extent buffer version set/get
> function as the result of the function name conflict.

Why do you need to add the extent buffer set/get helpers?

The function names will become quite long after adding the _stack
string, so I'd rather be sure we really need it before changing the
names everywhere.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 00/67] btrfs-progs: add the stack prefix for the set/get

2018-01-10 Thread Lu Fengqi
These set/get functions defined by BTRFS_SETGET_STACK_FUNCS macro is
missing the prefix stack. I can't add an extent buffer version set/get
function as the result of the function name conflict.

To settle a matter once and for all, I have written a script to rename
these functions. And, I will attach this script generated this patchset to
make review easier. At the beginning I forget renaming these functions will
bring on a ton of warning like "WARNING: line over 80 characters".
Consequently, you know I have to split those lines manually. This step is
too boring and stupid.

I'm not sure how to split this patchset appropriately. If this bunch of
patches is annoying, I'm OK with squashing these patches. At last, If this
btrfs-progs version patchset is acceptable, I can send the kernel version
as well.

#!/bin/bash
funcs=$(grep -oP '(?<=^BTRFS_SETGET_STACK_FUNCS\()(?!stack)\w+(?=,)' ctree.h)

for func in ${funcs}; do
echo $func
files=$(grep -PIRwl 'btrfs_(set_)?'${func})
sed -i 's/'"\(btrfs_\(set_\)\?\)\(${func}(\)"'/\1stack_\3/g' ${files}
sed -i 's/'"^\(BTRFS_SETGET_STACK_FUNCS(\)\(${func},\)"'/\1stack_\2/g' 
ctree.h
if ! make; then
break;
fi
git commit -as -F <(cat