public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: Filipe Manana <fdmanana@kernel.org>, dsterba@suse.cz
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 2/9] btrfs: move csum related functions from ctree.c into fs.c
Date: Thu, 19 Dec 2024 07:58:16 +1030	[thread overview]
Message-ID: <c4daaaf6-110e-426f-aa8d-edbc375663ae@suse.com> (raw)
In-Reply-To: <CAL3q7H5ScfeKwWXndwWP6DjhxC5MvqTKxyikQMCcmEUyfF9Gpg@mail.gmail.com>



在 2024/12/19 07:15, Filipe Manana 写道:
> On Wed, Dec 18, 2024 at 8:21 PM David Sterba <dsterba@suse.cz> wrote:
>>
>> On Mon, Dec 16, 2024 at 05:17:17PM +0000, fdmanana@kernel.org wrote:
>>> From: Filipe Manana <fdmanana@suse.com>
>>>
>>> The ctree module is about the implementation of the btree data structure
>>> and not a place holder for generic filesystem things like the csum
>>> algorithm details. Move the functions related to the csum algorithm
>>> details away from ctree.c and into fs.c, which is a far better place for
>>> them. Also fix missing punctuation in comments and change one multiline
>>> comment to a single line comment since everything fits in under 80
>>> characters.
>>>
>>> For some reason this also sligthly reduces the module's size.
>>>
>>> Before this change:
>>>
>>>    $ size fs/btrfs/btrfs.ko
>>>       text        data     bss     dec     hex filename
>>>    1782126      161045   16920 1960091  1de89b fs/btrfs/btrfs.ko
>>>
>>> After this change:
>>>
>>>    $ size fs/btrfs/btrfs.ko
>>>       text        data     bss     dec     hex filename
>>>    1782094      161045   16920 1960059  1de87b fs/btrfs/btrfs.ko
>>>
>>> Signed-off-by: Filipe Manana <fdmanana@suse.com>
>>> ---
>>>   fs/btrfs/ctree.c | 51 ------------------------------------------------
>>>   fs/btrfs/ctree.h |  6 ------
>>>   fs/btrfs/fs.c    | 49 ++++++++++++++++++++++++++++++++++++++++++++++
>>>   fs/btrfs/fs.h    |  6 ++++++
>>
>> Can you please create a new file for checksums? Moving everything to
>> fs.c looks like we're going to have another ctree.c.
> 
> Is it really worth it? After this patchset fs.c is only 229 lines and
> the csum related functions are just a few and very short.
> My idea would be to do such a thing either when fs.c gets a lot larger
> or we get more csum functions (and/or they get larger).
> 
> But sure, why not, I can do that on top or send a new version of this patch.

Personally speaking, I'm not a huge fan of a lot of small files/headers.

It makes the include path less clear, and make the path completion 
easier to hit conflicts.
(That's also why I hate the "mode-" prefix in btrfs-progs check/ directory)

The current fs.[ch] is definitely acceptable, thus I'm pretty happy with 
the current move.

Thanks,
Qu

> 
> Thanks.
> 


  reply	other threads:[~2024-12-18 21:28 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-16 17:17 [PATCH 0/9] btrfs: some header cleanups and move things around fdmanana
2024-12-16 17:17 ` [PATCH 1/9] btrfs: move abort_should_print_stack() to transaction.h fdmanana
2024-12-16 17:17 ` [PATCH 2/9] btrfs: move csum related functions from ctree.c into fs.c fdmanana
2024-12-17  0:26   ` Qu Wenruo
2024-12-17  8:55     ` Filipe Manana
2024-12-18 20:14       ` David Sterba
2024-12-18 20:21   ` David Sterba
2024-12-18 20:45     ` Filipe Manana
2024-12-18 21:28       ` Qu Wenruo [this message]
2024-12-23 19:36         ` David Sterba
2024-12-23 19:26       ` David Sterba
2024-12-16 17:17 ` [PATCH 3/9] btrfs: move the exclusive operation functions " fdmanana
2024-12-16 17:17 ` [PATCH 4/9] btrfs: move btrfs_is_empty_uuid() from ioctl.c " fdmanana
2024-12-17  0:31   ` Qu Wenruo
2024-12-17  7:53     ` Johannes Thumshirn
2024-12-17  8:06       ` Qu Wenruo
2024-12-17  8:57     ` Filipe Manana
2024-12-17  9:03       ` Qu Wenruo
2024-12-16 17:17 ` [PATCH 5/9] btrfs: move the folio ordered helpers from ctree.h into fs.h fdmanana
2024-12-16 17:17 ` [PATCH 6/9] btrfs: move BTRFS_BYTES_TO_BLKS() " fdmanana
2024-12-16 17:17 ` [PATCH 7/9] btrfs: move btrfs_alloc_write_mask() " fdmanana
2024-12-16 17:17 ` [PATCH 8/9] btrfs: move extent-tree function declarations out of ctree.h fdmanana
2024-12-16 17:17 ` [PATCH 9/9] btrfs: remove pointless comment from ctree.h fdmanana
2024-12-17  4:08 ` [PATCH 0/9] btrfs: some header cleanups and move things around Qu Wenruo
2024-12-17 11:57 ` Johannes Thumshirn
2024-12-18 20:23 ` David Sterba

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=c4daaaf6-110e-426f-aa8d-edbc375663ae@suse.com \
    --to=wqu@suse.com \
    --cc=dsterba@suse.cz \
    --cc=fdmanana@kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    /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