linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Liu Bo <bo.li.liu@oracle.com>
Cc: linux-btrfs@vger.kernel.org, Chris Mason <clm@fb.com>,
	Jan Kara <jack@suse.cz>, David Sterba <dsterba@suse.cz>
Subject: Re: [PATCH 1/6] Btrfs: add mount option for dax
Date: Sat, 10 Dec 2016 08:58:52 +1100	[thread overview]
Message-ID: <20161209215852.GQ4219@dastard> (raw)
In-Reply-To: <20161209184134.GB28006@localhost.localdomain>

On Fri, Dec 09, 2016 at 10:41:34AM -0800, Liu Bo wrote:
> On Fri, Dec 09, 2016 at 03:47:20PM +1100, Dave Chinner wrote:
> > On Wed, Dec 07, 2016 at 01:45:05PM -0800, Liu Bo wrote:
> > > Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
> > > ---
> > >  fs/btrfs/ctree.h |  1 +
> > >  fs/btrfs/super.c | 40 +++++++++++++++++++++++++++++++++++++++-
> > >  2 files changed, 40 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
> > > index 0b8ce2b..e54c6e6 100644
> > > --- a/fs/btrfs/ctree.h
> > > +++ b/fs/btrfs/ctree.h
> > > @@ -1317,6 +1317,7 @@ static inline u32 BTRFS_MAX_XATTR_SIZE(const struct btrfs_root *root)
> > >  #define BTRFS_MOUNT_FRAGMENT_METADATA	(1 << 25)
> > >  #define BTRFS_MOUNT_FREE_SPACE_TREE	(1 << 26)
> > >  #define BTRFS_MOUNT_NOLOGREPLAY		(1 << 27)
> > > +#define BTRFS_MOUNT_DAX		(1 << 28)
> > >  
> > >  #define BTRFS_DEFAULT_COMMIT_INTERVAL	(30)
> > >  #define BTRFS_DEFAULT_MAX_INLINE	(2048)
> > > diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> > > index 74ed5aa..9b18f3d 100644
> > > --- a/fs/btrfs/super.c
> > > +++ b/fs/btrfs/super.c
> > > @@ -323,7 +323,7 @@ enum {
> > >  	Opt_commit_interval, Opt_barrier, Opt_nodefrag, Opt_nodiscard,
> > >  	Opt_noenospc_debug, Opt_noflushoncommit, Opt_acl, Opt_datacow,
> > >  	Opt_datasum, Opt_treelog, Opt_noinode_cache, Opt_usebackuproot,
> > > -	Opt_nologreplay, Opt_norecovery,
> > > +	Opt_nologreplay, Opt_norecovery, Opt_dax,
> > 
> > Can we please not create more filesystems with a DAX mount option?
> > This was only even an enabler, and not meant to be a permanent
> > thing. The permanent functionality for DAX is supposed to be
> > per-inode inheritable DAX flags - not mount options - so that
> > applications can choose on a per file basis to enable/disable DAX
> > access as they see fit.
> > 
> > This also enables the filesystem to reject the attempt to turn on
> > DAX if the set of contexts for the file are not DAX compatible....
> 
> Sounds good, I'll try to update it to use inode DAX flag directly.

xfs_io already has chattr/lsattr support (+/-x) for the FS_XFLAG_DAX
flag in FS_IOC_FS{GS}ETXATTR, and you can have a look at the XFS
code in xfs_ioctl.c for the operations that are needed to
dynamically change the S_DAX flag on an inode (e.g
xfs_ioctl_setattr_dax_invalidate())

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2016-12-09 21:58 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-07 21:45 [PATCH 0/6] btrfs dax IO Liu Bo
2016-12-07 21:45 ` [PATCH 1/6] Btrfs: add mount option for dax Liu Bo
2016-12-08  2:44   ` kbuild test robot
2016-12-09  4:47   ` Dave Chinner
2016-12-09 18:41     ` Liu Bo
2016-12-09 21:58       ` Dave Chinner [this message]
2016-12-07 21:45 ` [PATCH 2/6] Btrfs: set single device limit for dax usecase Liu Bo
2016-12-08 13:35   ` David Sterba
2016-12-08 15:19     ` Liu Bo
2016-12-07 21:45 ` [PATCH 3/6] Btrfs: refactor btrfs_file_write_iter Liu Bo
2016-12-08  0:44   ` kbuild test robot
2016-12-07 21:45 ` [PATCH 4/6] Btrfs: add DAX support for nocow btrfs Liu Bo
2016-12-07 22:15   ` Chris Mason
2016-12-07 22:51     ` Liu Bo
2016-12-08 10:47     ` Jan Kara
2016-12-08 16:45       ` Liu Bo
2016-12-09 12:31         ` Jan Kara
2016-12-09 18:38           ` Liu Bo
2016-12-08  1:16   ` kbuild test robot
2016-12-08  2:19     ` Janos Toth F.
2016-12-08  2:30   ` kbuild test robot
2016-12-09  5:13   ` Dave Chinner
2016-12-09 14:23     ` Chris Mason
2016-12-07 21:45 ` [PATCH 5/6] Btrfs: add mmap_sem to avoid race between page faults and truncate/hole_punch Liu Bo
2016-12-07 21:45 ` [PATCH 6/6] Btrfs: add tracepoint for btrfs_get_blocks_dax_fault Liu Bo

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=20161209215852.GQ4219@dastard \
    --to=david@fromorbit.com \
    --cc=bo.li.liu@oracle.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.cz \
    --cc=jack@suse.cz \
    --cc=linux-btrfs@vger.kernel.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 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).