linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>,
	Jan Kara <jack@suse.com>, Theodore Ts'o <tytso@mit.edu>,
	Chris Mason <clm@fb.com>, Boaz Harrosh <boaz@plexistor.com>,
	Jaegeuk Kim <jaegeuk@kernel.org>,
	Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>,
	Mark Fasheh <mfasheh@versity.com>,
	Evgeniy Dushistov <dushistov@mail.ru>,
	Miklos Szeredi <miklos@szeredi.hu>,
	Al Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: [RFC][PATCH 11/11] xfs: use common file type conversion
Date: Wed, 21 Dec 2016 16:23:17 +1100	[thread overview]
Message-ID: <20161221052317.GA4758@dastard> (raw)
In-Reply-To: <CAOQ4uxj3hpuuADiTv0q6BBvhUvmpi=2mkVdk=1pXO2cCdT05Qg@mail.gmail.com>

On Tue, Dec 20, 2016 at 07:20:22AM +0200, Amir Goldstein wrote:
> On Tue, Dec 20, 2016 at 2:28 AM, Darrick J. Wong
> <darrick.wong@oracle.com> wrote:
> > On Mon, Dec 19, 2016 at 10:11:08PM +0200, Amir Goldstein wrote:
> > Note: We did this all this work a short time ago so that ext4 and XFS
> > could present the same FSGETXATTR ioctl to user programs (major benefit)
> > but it was kind of a pain to get right.  I don't see an upside to ceding
> > control of this part of the disk format to the VFS.
> >
> 
> The answer "this is not wanted for XFS" is perfectly valid :)
> The common implementation can be used by the small fs, which never
> want anymore than the basic ext2 implementation.
> 
> However, since the DT_ values and  XFS_DIR3_FT_ values of 0..7
> are already carved in stone, as long as comments in both common code
> and libxfs code makes that clear, I see no harm in using the common
> implementation in xfs, besides the need to yank more code from fs.h to
> libxfs, but it's your decision.

It's a philoophical and architectural issue. We currently have a
distinct separation between generic functionality and per-filesystem
specific definitions. The on-disk definitions are owned by the
filesystem not the generic code, and the generic code /never/ sees
what the filesystem stores on disk. THe VFS is supposed to be
completely independent of what the filesystems store on disk - it's
an abstract concept - so that it can morph into whatever is required
to support the functionality the different filesystem provides.

The way we normally handle this is a method callout of some kind
into the filesystem to do the filesystem specific function, and
if there are multiple filesystems that do the same thing, they use a
common function. So that part of the patchset - providing common
helpers to inode mode/filesytem d_type conversion - is fine.

The part that isn't fine, IMO, is defining the filesystem d_type
values in generic code. They should be defined by the filesystem and
passed to the generic conversion functions as a constant. It may
require a different structure to do this cleanly (i.e. something
other than a sparse array keyed on S_IFMT), but I think that having
the VFS define on-disk formats like this is a slippery slope that
only leads to long term pain and ossification.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2016-12-21  5:23 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-19 20:10 [RFC][PATCH 00/11] common implementation of dirent file types Amir Goldstein
2016-12-19 20:10 ` [RFC][PATCH 01/11] fs: common implementation of file type conversions Amir Goldstein
2016-12-19 21:13   ` Darrick J. Wong
2016-12-20  5:01     ` Amir Goldstein
2016-12-20  7:37   ` [RFC][PATCH v2 " Amir Goldstein
2016-12-19 20:10 ` [RFC][PATCH 02/11] ufs: use fs_umode_to_dtype() helper Amir Goldstein
2016-12-19 20:11 ` [RFC][PATCH 03/11] hfsplus: " Amir Goldstein
2016-12-19 20:11 ` [RFC][PATCH 04/11] ext2: use common file type conversion Amir Goldstein
2016-12-19 20:11 ` [RFC][PATCH 05/11] exofs: " Amir Goldstein
2016-12-19 21:50   ` Boaz Harrosh
2016-12-19 20:11 ` [RFC][PATCH 06/11] ext4: " Amir Goldstein
2016-12-19 20:11 ` [RFC][PATCH 07/11] ocfs2: " Amir Goldstein
2016-12-19 20:11 ` [RFC][PATCH 08/11] f2fs: " Amir Goldstein
2016-12-19 20:11 ` [RFC][PATCH 09/11] nilfs2: " Amir Goldstein
2016-12-19 20:11 ` [RFC][PATCH 10/11] btrfs: " Amir Goldstein
2016-12-19 20:11 ` [RFC][PATCH 11/11] xfs: " Amir Goldstein
2016-12-19 21:55   ` Darrick J. Wong
2016-12-20  6:17     ` Amir Goldstein
2016-12-20 14:07       ` Amir Goldstein
2016-12-20  0:28   ` Darrick J. Wong
2016-12-20  5:20     ` Amir Goldstein
2016-12-21  5:23       ` Dave Chinner [this message]
2016-12-21  6:37         ` Amir Goldstein
2016-12-21 10:12           ` [RFC][PATCH v2 " Amir Goldstein
2016-12-21 18:01             ` [PATCH v3 " Amir Goldstein
2016-12-22 21:07               ` [PATCH v4] xfs: fix the size of xfs_mode_to_ftype table Amir Goldstein
2016-12-23 21:01                 ` Darrick J. Wong
2016-12-24  7:31                   ` Amir Goldstein
2016-12-24 14:11                 ` Brian Foster
2016-12-21 15:06         ` [RFC][PATCH 11/11] xfs: use common file type conversion Theodore Ts'o
2016-12-21 16:37           ` Amir Goldstein
2016-12-21 22:56             ` Theodore Ts'o
2016-12-22  5:54               ` Amir Goldstein
2016-12-22 20:30                 ` Amir Goldstein
2016-12-21 16:59           ` Miklos Szeredi

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=20161221052317.GA4758@dastard \
    --to=david@fromorbit.com \
    --cc=amir73il@gmail.com \
    --cc=boaz@plexistor.com \
    --cc=clm@fb.com \
    --cc=darrick.wong@oracle.com \
    --cc=dushistov@mail.ru \
    --cc=jack@suse.com \
    --cc=jaegeuk@kernel.org \
    --cc=konishi.ryusuke@lab.ntt.co.jp \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mfasheh@versity.com \
    --cc=miklos@szeredi.hu \
    --cc=tytso@mit.edu \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).