From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: "Darrick J. Wong" <djwong@kernel.org>,
Dave Chinner <dchinner@redhat.com>,
linux-xfs@vger.kernel.org, allison.henderson@oracle.com
Subject: Re: [PATCH 1/5] xfs: convert XFS_IFORK_PTR to a static inline helper
Date: Tue, 12 Jul 2022 16:25:16 +1000 [thread overview]
Message-ID: <20220712062516.GK3861211@dread.disaster.area> (raw)
In-Reply-To: <Ysz+SbVRh5yTWzXS@infradead.org>
On Mon, Jul 11, 2022 at 09:53:29PM -0700, Christoph Hellwig wrote:
> On Mon, Jul 11, 2022 at 06:20:40PM -0700, Darrick J. Wong wrote:
> > I personally am not that bothered by shouty function names, but Dave
> > has asked for shout-reduction in the past, so every time I convert
> > something I also change the case.
> >
> > AFAIK it /is/ sort of a C custom that macros get loud names and
> > functions do not so that you ALWAYS KNOW, erm, when you're dealing with
> > a macro that could rain bad coding conventions down on your head.
>
> It is a bit of a historic custom, but not really followed strictly.
> I tend to think of trivial container_of and similar addressing inline
> functions just as macros with a saner implementation, and so does a
> big part of the kernel community. Where exactly that border is is not
> clear, though. And in doubt I think avoiding too much churn in changing
> things unless there is a clear benefit is a good idea. So maybe we
> would have picked a lower case name for XFS_IFORK_PTR when adding it
> new, but i don't really see any benefit in changing it now.
/me shrugs
All I really want is the macros converted to static inlines so that
we get proper type checking. I'm not concerned by upper/lower case
that much, and for stuff like XFS_I/VFS_I I agree that it makes
sense because they are really short and it makes the type
conversions of related embedded objects stand out in the code
nicely.
But for longer stuff like xfs_ifork_ptr(), I think it makes more
sense to follow the "UPPER == macro, lower == static inline"
conventions, especially in the dense forest of similar macro
definitions surrounding XFS_IFORK_... and XFS_DFORK...
Yes, it does mean there's a little bit of eye retraining to be done
for long term developers, but I think the end result is much more
easier to understand especially for people new to the XFS code....
> The same is true for some of the other patches later in the series,
> except for maybe XFS_IFORK_Q, which has been really grossly and
> confusingly misnamed.
One of many. :/
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2022-07-12 6:25 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-09 22:48 [PATCHSET v2 0/5] xfs: make attr forks permanent Darrick J. Wong
2022-07-09 22:48 ` [PATCH 1/5] xfs: convert XFS_IFORK_PTR to a static inline helper Darrick J. Wong
2022-07-11 5:26 ` Christoph Hellwig
2022-07-12 1:20 ` Darrick J. Wong
2022-07-12 4:53 ` Christoph Hellwig
2022-07-12 6:25 ` Dave Chinner [this message]
2022-07-09 22:48 ` [PATCH 2/5] xfs: make inode attribute forks a permanent part of struct xfs_inode Darrick J. Wong
2022-07-09 22:48 ` [PATCH 3/5] xfs: use XFS_IFORK_Q to determine the presence of an xattr fork Darrick J. Wong
2022-07-11 1:29 ` Dave Chinner
2022-07-09 22:48 ` [PATCH 4/5] xfs: replace XFS_IFORK_Q with a proper predicate function Darrick J. Wong
2022-07-09 22:49 ` [PATCH 5/5] xfs: replace inode fork size macros with functions Darrick J. Wong
2022-07-11 5:25 ` [PATCHSET v2 0/5] xfs: make attr forks permanent Christoph Hellwig
2022-07-12 1:53 ` Darrick J. Wong
2022-07-12 4:50 ` Christoph Hellwig
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=20220712062516.GK3861211@dread.disaster.area \
--to=david@fromorbit.com \
--cc=allison.henderson@oracle.com \
--cc=dchinner@redhat.com \
--cc=djwong@kernel.org \
--cc=hch@infradead.org \
--cc=linux-xfs@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