public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 10/14] xfs: minimize impact to non-reflink files via reflink per-inode flag
Date: Thu, 2 Jul 2015 17:07:11 +1000	[thread overview]
Message-ID: <20150702070711.GY22807@dastard> (raw)
In-Reply-To: <20150702023208.GE10043@birch.djwong.org>

On Wed, Jul 01, 2015 at 07:32:08PM -0700, Darrick J. Wong wrote:
> On Wed, Jul 01, 2015 at 11:58:43AM +1000, Dave Chinner wrote:
> > On Thu, Jun 25, 2015 at 04:40:16PM -0700, Darrick J. Wong wrote:
> > > Gate all the reflink functions (which generally involve an expensive
> > > trip to the reflink btree) on an inode flag which is applied to both
> > > inodes at reflink time.  This minimizes reflink's impact on non-CoW
> > > files.
> > 
> > Ah, I see you do this reflink inode flag here. This should be one of
> > the first patches, not the last.  i.e. the patch series should
> > build up all the supporting infrastructure in individual patches
> > before adding any of the actual reflink implementation....
> > 
> > Also, the flag needs to go into the di_flags2 field, as the last
> > flag in the di_flags field is reserved for a "more flags" flag if we
> > ever need to add more flags to a v2 inode in a v4 filesystem...
> 
> It looks to me like di_flags2 only exists in a v3 inode, and v3 inodes
> only exist on v5 filesystems.  I don't really mind using di_flags2 for
> reflink (on the off chance you want to use bit 15 of di_flags for a
> v2 inode) but I'm wondering how is it possible to have di_flags on a v4 fs?

You mean how is it possible to have di_flags2 on a v4 fs?

Internally when inodes are read off disk, they are converted to v3
format in memory. i.e. the struct xfs_icdinode is a v3 format
structure. Hence when reading in v2 inodes, the di_flags2 field is
present in the structure and it gets initialised to zero. When we
format the in-memory inode to disk (in xfs_iflush_int()), we don't
ever write the v3 fields back to the on disk inode structure, and
hence the in-memory value of the di_flags2 field doesn't ever get
written to disk.

So while the various v3 inode fields are always present in the
in-memory inode, if di_version = 2 then the v3 fields will be
initialised to zero on read and will never be written back to
disk...

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2015-07-02  7:07 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-25 23:39 [RFC(RAP) 00/14] xfs: add reflink and dedupe support Darrick J. Wong
2015-06-25 23:39 ` [PATCH 01/14] xfs: create a per-AG btree to track reference counts Darrick J. Wong
2015-07-01  0:13   ` Dave Chinner
2015-07-01 22:52     ` Darrick J. Wong
2015-07-01 23:30       ` Dave Chinner
2015-06-25 23:39 ` [PATCH 02/14] libxfs: adjust refcounts in reflink btree Darrick J. Wong
2015-07-01  1:06   ` Dave Chinner
2015-07-01 23:10     ` Darrick J. Wong
2015-07-01 23:32       ` Dave Chinner
2015-06-25 23:39 ` [PATCH 03/14] libxfs: support unmapping reflink blocks Darrick J. Wong
2015-07-01  1:26   ` Dave Chinner
2015-07-02  2:27     ` Darrick J. Wong
2015-06-25 23:39 ` [PATCH 04/14] libxfs: block-mapper changes to support reflink Darrick J. Wong
2015-06-25 23:39 ` [PATCH 05/14] xfs: add reflink functions and ioctl Darrick J. Wong
2015-06-25 23:39 ` [PATCH 06/14] xfs: implement copy-on-write for reflinked blocks Darrick J. Wong
2015-06-25 23:39 ` [PATCH 07/14] xfs: handle directio " Darrick J. Wong
2015-06-25 23:40 ` [PATCH 08/14] xfs: teach fiemap about reflink'd extents Darrick J. Wong
2015-06-25 23:40 ` [PATCH 09/14] xfs: copy-on-write reflinked blocks when zeroing ranges of blocks Darrick J. Wong
2015-06-25 23:40 ` [PATCH 10/14] xfs: minimize impact to non-reflink files via reflink per-inode flag Darrick J. Wong
2015-07-01  1:58   ` Dave Chinner
2015-07-01 22:59     ` Darrick J. Wong
2015-07-01 23:49       ` Dave Chinner
2015-07-02  2:32     ` Darrick J. Wong
2015-07-02  7:07       ` Dave Chinner [this message]
2015-06-25 23:40 ` [PATCH 11/14] xfs: emulate the btrfs dedupe extent same ioctl Darrick J. Wong
2015-06-25 23:40 ` [PATCH 12/14] xfs: support XFS_XFLAG_REFLINK (and FS_NOCOW_FL) on reflink filesystems Darrick J. Wong
2015-06-25 23:40 ` [PATCH 13/14] xfs: add reflink btree root when expanding the filesystem Darrick J. Wong
2015-06-25 23:40 ` [PATCH 14/14] xfs: add reflink btree block detection to log recovery Darrick J. Wong

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=20150702070711.GY22807@dastard \
    --to=david@fromorbit.com \
    --cc=darrick.wong@oracle.com \
    --cc=xfs@oss.sgi.com \
    /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