From: Phillip Potter <phil@philpotter.co.uk>
To: Amir Goldstein <amir73il@gmail.com>
Cc: willy@infradead.org, dushistov@mail.ru, viro@zeniv.linux.org.uk,
David.Laight@aculab.com, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] fs: ufs: Remove switch statement from ufs_set_de_type function
Date: Mon, 22 Oct 2018 09:20:03 +0100 [thread overview]
Message-ID: <20181022082003.GA3318@pathfinder> (raw)
In-Reply-To: <CAOQ4uxg2Vb4fKUcN1nHUtYuapBmUNFNiMZYJaPsjKf5z4EAEuA@mail.gmail.com>
On Sun, Oct 21, 2018 at 02:02:57PM +0300, Amir Goldstein wrote:
> Yes. If you are looking for a cleanup task, you can
> apply relevant patches from my series, starting with:
> https://patchwork.kernel.org/patch/9481237/
> (Leave the xfs patch [11/11] out)
>
> But besides verifying that patches still apply and build,
> you will need to address the concerns of fs maintainers.
> Take for example the btrfs patch:
> https://patchwork.kernel.org/patch/9480725/
>
> It says:
> + *
> + * Values 0..7 should match common file type values in file_type.h.
> */
> #define BTRFS_FT_UNKNOWN 0
> #define BTRFS_FT_REG_FILE 1
>
> But that is not enough.
> When converting code to use the generic defines FT_*, instead of
> filesystem defined we need to leave in the code build time assertions
> that will catch an attempt to change fs contancts in the future, e.g.:
>
> static inline u8 btrfs_inode_type(struct inode *inode)
> {
> - return btrfs_type_by_mode[(inode->i_mode & S_IFMT) >> S_SHIFT];
> + BUILD_BUG_ON(BTRFS_FT_UNKNOWN != FT_UNKNOWN);
> + BUILD_BUG_ON(BTRFS_FT_REG_FILE != FT_REG_FILE);
> ...
> + return fs_umode_to_ftype(inode->i_mode);
> }
>
> Same should be done for all relevant filesystems.
> Then you need to hope that fs maintainers will like this cleanup and
> want to take the patches ;-)
>
> Cheers,
> Amir.
Dear Amir,
I will give it a go and see how far I get :-)
Regards,
Phil
next prev parent reply other threads:[~2018-10-22 16:37 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-20 22:09 [PATCH] fs: ufs: Remove switch statement from ufs_set_de_type function Phillip Potter
2018-10-20 22:26 ` Matthew Wilcox
2018-10-20 23:07 ` Al Viro
2018-10-21 5:30 ` Amir Goldstein
2018-10-21 9:57 ` Phillip Potter
2018-10-21 11:02 ` Amir Goldstein
2018-10-22 8:20 ` Phillip Potter [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-10-17 12:34 Phillip Potter
2018-10-17 10:08 Phillip Potter
2018-10-17 10:11 ` David Laight
2018-10-17 23:33 ` Al Viro
2018-10-18 10:19 ` Phillip Potter
2018-10-09 13:16 Phillip Potter
2018-10-02 16:41 Phillip Potter
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=20181022082003.GA3318@pathfinder \
--to=phil@philpotter.co.uk \
--cc=David.Laight@aculab.com \
--cc=amir73il@gmail.com \
--cc=dushistov@mail.ru \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.