All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phillip Potter <phil@philpotter.co.uk>
To: viro@zeniv.linux.org.uk
Cc: linux-kernel@vger.kernel.org, amir73il@gmail.com,
	linux-fsdevel@vger.kernel.org
Subject: [RFC][PATCH 00/11] common implementation of dirent file types
Date: Tue, 23 Oct 2018 21:19:52 +0100	[thread overview]
Message-ID: <20181023201952.GA15676@pathfinder> (raw)

This cleanup series is a respin of Amir Goldstein's work, created
in late 2016. It removes several instances of duplicated code. Most
of the duplication dates back to git pre-historic era.

The controversial aspect of this cleanup is that it uses common
code to handle file system specific on-disk format bits.
All 7 file systems use a single byte to store dirent file type
on-disk and all of them use the same conversion routines from
i_mode to 4bits DT_* constants to 3bits on-disk FT_* constants.

Patch 1 places a common implementation in file_type.h and
add some useful conversion helpers.

Patches 2-3 make use of some helpers in ufs and hfsplus
without any on-disk implications.

Patches 4-10 replace the specific implementations in ext2, exofs,
ext4, ocfs2, f2fs, nilfs and btrfs with the common implementation.
These patches also now include compile-time checks to ensure that
the file system specific on-disk bits are equivalent to the common
implementation FT_* bits. These compile-time checks are only
included once per file system, as my reasoning is that regardless
of their location, the build will fail/succeed anyway.

In addition, where needed (for patches which no longer apply),
I've rebased them to apply to the newest 4.19 kernel sources.
Each patch is independent of the others, except for the
common implementation itself which they all depend on.

I would love feedback as newish kernel contributor, particularly
from the original author Amir who suggested this task for me. I
hope the various subsystem/fs maintainers will see fit to accept
this work also.

Phillip Potter (10):
  fs: common implementation of file type conversions
  ufs: use fs_umode_to_dtype() helper
  hfsplus: use fs_umode_to_dtype() helper
  ext2: use common file type conversion
  exofs: use common file type conversion
  ext4: use common file type conversion
  ocfs2: use common file type conversion
  f2fs: use common file type conversion
  nilfs2: use common file type conversion
  btrfs: use common file type conversion
---
 MAINTAINERS                        |   1 +
 fs/btrfs/btrfs_inode.h             |   2 -
 fs/btrfs/delayed-inode.c           |   2 +-
 fs/btrfs/inode.c                   |  35 +++++-----
 fs/exofs/dir.c                     |  49 +++++--------
 fs/ext2/dir.c                      |  51 ++++++--------
 fs/ext4/ext4.h                     |  35 +++++-----
 fs/f2fs/dir.c                      |  43 +++++-------
 fs/f2fs/inline.c                   |   2 +-
 fs/hfsplus/dir.c                   |  16 +----
 fs/nilfs2/dir.c                    |  54 +++++----------
 fs/ocfs2/dir.c                     |  32 +++++----
 fs/ocfs2/ocfs2_fs.h                |  13 +---
 fs/ufs/util.h                      |  29 +-------
 include/linux/f2fs_fs.h            |   8 ++-
 include/linux/file_type.h          | 108 +++++++++++++++++++++++++++++
 include/linux/fs.h                 |  17 +----
 include/uapi/linux/btrfs_tree.h    |   2 +
 include/uapi/linux/nilfs2_ondisk.h |   1 +
 19 files changed, 256 insertions(+), 244 deletions(-)
 create mode 100644 include/linux/file_type.h

--
2.17.2


             reply	other threads:[~2018-10-23 20:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-23 20:19 Phillip Potter [this message]
2018-10-23 21:17 ` [RFC][PATCH v2 10/10] btrfs: use common file type conversion Phillip Potter
2018-10-24 10:11   ` David Sterba
2018-10-24 13:28     ` Phillip Potter
2018-10-24  6:43 ` [RFC][PATCH 00/11] common implementation of dirent file types Amir Goldstein
2018-10-25 11:08   ` Jan Kara
2018-10-25 12:48     ` Phillip Potter
  -- strict thread matches above, loose matches on Subject: below --
2016-12-19 20:10 Amir Goldstein

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=20181023201952.GA15676@pathfinder \
    --to=phil@philpotter.co.uk \
    --cc=amir73il@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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.