Re: [PATCH 2/2] mkfs: pass a custom cowextsize into the created filesystem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> ---
>  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?

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



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux