From: Dave Chinner <david@fromorbit.com>
To: Eric Biggers <ebiggers3@gmail.com>
Cc: linux-fscrypt@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-ext4@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net,
linux-mtd@lists.infradead.org,
"Theodore Y . Ts'o" <tytso@mit.edu>,
Jaegeuk Kim <jaegeuk@kernel.org>,
Michael Halcrow <mhalcrow@google.com>,
Eric Biggers <ebiggers@google.com>
Subject: Re: [PATCH 00/25] fscrypt: add some higher-level helper functions
Date: Fri, 22 Sep 2017 06:48:14 +1000 [thread overview]
Message-ID: <20170921204814.GA7716@dastard> (raw)
In-Reply-To: <20170921174705.GA29643@gmail.com>
On Thu, Sep 21, 2017 at 10:47:05AM -0700, Eric Biggers wrote:
> Hi Dave,
>
> On Thu, Sep 21, 2017 at 04:45:02PM +1000, Dave Chinner wrote:
> > fscrypto: clean up include file mess
> >
> > From: Dave Chinner <dchinner@redhat.com>
> >
> > Filesystems have to include different header files based on whether
> > they are compiled with encryption support or not. That's nasty and
> > messy.
> >
> > Instead, rationalise the headers so we have a single include
> > fscrypt.h and let it decide what internal implementation to include
> > based on the __FS_HAS_ENCRYPTION define. Filesystems set
> > __FS_HAS_ENCRYPTION before including linux/fscrypt.h if they are
> > built with encryption support.
> >
> > Add guards to prevent fscrypt_supp.h and fscrypt_notsupp.h from
> > being directly included by filesystems.
>
> This looks good; we probably should have done it that way originally. This will
> allow us to have the inline functions like fscrypt_prepare_rename() defined in
> fscrypt.h, and then have supp/notsupp versions of __fscrypt_prepare_rename()
> instead --- so common checks like for IS_ENCRYPTED() will be in one place only.
*nod*
> One nit:
>
> > +#ifdef CONFIG_EXT4_FS_ENCRYPTION
> > +#define __FS_HAS_ENCRYPTION 1
> > +#endif
> > +#include <linux/fscrypt.h>
>
> How about doing
>
> #define __FS_HAS_ENCRYPTION IS_ENABLED(CONFIG_EXT4_FS_ENCRYPTION)
>
> (and likewise for f2fs and ubifs), then checking '#if __FS_HAS_ENCRYPTION'
> rather than '#ifdef __FS_HAS_ENCRYPTION'?
Yeah, that's cleaner. I'll modify it and resend as a standalone
patch.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2017-09-21 20:48 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-20 22:45 [PATCH 00/25] fscrypt: add some higher-level helper functions Eric Biggers
2017-09-20 22:45 ` [PATCH 01/25] fs, fscrypt: add an S_ENCRYPTED inode flag Eric Biggers
2017-09-20 22:45 ` [PATCH 02/25] fscrypt: switch from ->is_encrypted() to IS_ENCRYPTED() Eric Biggers
2017-09-20 22:45 ` Eric Biggers
2017-09-20 22:45 ` [PATCH 03/25] fscrypt: remove ->is_encrypted() Eric Biggers
2017-09-20 22:45 ` Eric Biggers
2017-09-20 22:45 ` [PATCH 04/25] fscrypt: remove unneeded empty fscrypt_operations structs Eric Biggers
2017-09-20 22:45 ` Eric Biggers
2017-09-20 22:45 ` [PATCH 05/25] fscrypt: new helper function - fscrypt_require_key() Eric Biggers
2017-09-20 22:45 ` Eric Biggers
2017-09-20 22:45 ` [PATCH 06/25] fscrypt: new helper function - fscrypt_file_open() Eric Biggers
2017-09-20 22:45 ` Eric Biggers
2017-09-20 22:45 ` [PATCH 07/25] fscrypt: new helper function - fscrypt_prepare_link() Eric Biggers
2017-09-20 22:45 ` [PATCH 08/25] fscrypt: new helper function - fscrypt_prepare_rename() Eric Biggers
2017-09-20 22:45 ` [PATCH 09/25] fscrypt: new helper function - fscrypt_prepare_lookup() Eric Biggers
2017-09-20 22:45 ` Eric Biggers
2017-09-20 22:45 ` [PATCH 10/25] fscrypt: new helper function - fscrypt_prepare_setattr() Eric Biggers
2017-09-20 22:45 ` Eric Biggers
2017-09-20 22:45 ` [PATCH 11/25] ext4: switch to fscrypt_file_open() Eric Biggers
2017-09-20 22:45 ` Eric Biggers
2017-09-20 22:45 ` [PATCH 12/25] ext4: switch to fscrypt_prepare_link() Eric Biggers
2017-09-20 22:45 ` Eric Biggers
2017-09-20 22:45 ` [PATCH 13/25] ext4: switch to fscrypt_prepare_rename() Eric Biggers
2017-09-20 22:45 ` Eric Biggers
2017-09-20 22:45 ` [PATCH 14/25] ext4: switch to fscrypt_prepare_lookup() Eric Biggers
2017-09-20 22:45 ` Eric Biggers
2017-09-20 22:45 ` [PATCH 15/25] ext4: switch to fscrypt_prepare_setattr() Eric Biggers
2017-09-20 22:45 ` Eric Biggers
2017-09-20 22:45 ` [PATCH 16/25] f2fs: switch to fscrypt_file_open() Eric Biggers
2017-09-20 22:45 ` [PATCH 17/25] f2fs: switch to fscrypt_prepare_link() Eric Biggers
2017-09-20 22:45 ` Eric Biggers
2017-09-20 22:45 ` [PATCH 18/25] f2fs: switch to fscrypt_prepare_rename() Eric Biggers
2017-09-20 22:45 ` [PATCH 19/25] f2fs: switch to fscrypt_prepare_lookup() Eric Biggers
2017-09-20 22:45 ` Eric Biggers
2017-09-20 22:46 ` [PATCH 20/25] f2fs: switch to fscrypt_prepare_setattr() Eric Biggers
2017-09-20 22:46 ` Eric Biggers
2017-09-20 22:46 ` [PATCH 21/25] ubifs: switch to fscrypt_file_open() Eric Biggers
2017-09-20 22:46 ` Eric Biggers
2017-09-20 22:46 ` [PATCH 22/25] ubifs: switch to fscrypt_prepare_link() Eric Biggers
2017-09-20 22:46 ` Eric Biggers
2017-09-20 22:46 ` [PATCH 23/25] ubifs: switch to fscrypt_prepare_rename() Eric Biggers
2017-09-20 22:46 ` Eric Biggers
2017-09-20 22:46 ` [PATCH 24/25] ubifs: switch to fscrypt_prepare_lookup() Eric Biggers
2017-09-20 22:46 ` [PATCH 25/25] ubifs: switch to fscrypt_prepare_setattr() Eric Biggers
2017-09-21 6:45 ` [PATCH 00/25] fscrypt: add some higher-level helper functions Dave Chinner
2017-09-21 17:47 ` Eric Biggers
2017-09-21 20:48 ` Dave Chinner [this message]
2017-09-21 14:19 ` [f2fs-dev] " Chao Yu
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=20170921204814.GA7716@dastard \
--to=david@fromorbit.com \
--cc=ebiggers3@gmail.com \
--cc=ebiggers@google.com \
--cc=jaegeuk@kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fscrypt@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=mhalcrow@google.com \
--cc=tytso@mit.edu \
/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.