linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Eric Sandeen <sandeen@redhat.com>, xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH 2/2] mkfs: pass a custom cowextsize into the created filesystem
Date: Sun, 3 Sep 2017 08:35:25 -0700	[thread overview]
Message-ID: <20170903153525.GF4073@magnolia> (raw)
In-Reply-To: <20170903083857.GB32385@infradead.org>

On Sun, Sep 03, 2017 at 01:38:57AM -0700, Christoph Hellwig wrote:
> On Fri, Sep 01, 2017 at 09:40:35AM -0700, Darrick J. Wong wrote:
> > Create a -d option to mkfs.xfs that enables administrators to set
> > the CoW extent size hint on the created files.
> > 
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> >  libxfs/util.c       |   26 ++++++++++++++++++++++++--
> >  man/man8/mkfs.xfs.8 |    7 +++++++
> >  mkfs/xfs_mkfs.c     |   20 ++++++++++++++++++++
> >  3 files changed, 51 insertions(+), 2 deletions(-)
> > 
> > diff --git a/libxfs/util.c b/libxfs/util.c
> > index 0e2f29e..4f82d7f 100644
> > --- a/libxfs/util.c
> > +++ b/libxfs/util.c
> > @@ -175,6 +175,26 @@ libxfs_trans_ichgtime(
> >  	}
> >  }
> >  
> > +static inline uint16_t
> > +xflags_to_diflags(
> > +	__u32		xflags)
> > +{
> > +	/* bottom 15 xflag bits correspond to diflag bits */
> > +	return xflags & 0x7FFF;
> 
> Do we really want to rely on that fact?
> 
> > +}
> > +
> > +static inline uint64_t
> > +xflags_to_diflags2(
> > +	__u32		xflags)
> > +{
> > +	uint64_t	ret = 0;
> > +
> > +	if (xflags & FS_XFLAG_COWEXTSIZE)
> > +		ret |= XFS_DIFLAG2_COWEXTSIZE;
> > +
> > +	return ret;
> > +}
> 
> It seems like we should just lift the kernels xfs_flags2diflags and
> xfs_flags2diflags2 to libxfs and use them here?

Once that they exist upstream, sure! :)

--D

> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2017-09-03 15:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-01 16:40 [PATCH 2/2] mkfs: pass a custom cowextsize into the created filesystem Darrick J. Wong
2017-09-03  8:38 ` Christoph Hellwig
2017-09-03 15:35   ` Darrick J. Wong [this message]
2017-09-04 17:45 ` [PATCH v2 " Darrick J. Wong
2017-09-08 18:02   ` Eric Sandeen
2017-09-18 17:22     ` Darrick J. Wong
2017-09-18 17:37       ` Eric Sandeen

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=20170903153525.GF4073@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=hch@infradead.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@redhat.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;
as well as URLs for NNTP newsgroup(s).