On Tue, Oct 25, 2016 at 04:05:23PM -0700, Darrick J. Wong wrote: > Enable administrators to get or set the CoW extent size hint. > Report the hint when we run stat. This also requires some > autoconf magic to detect whether or not fsx_cowextsize exists. .... > +++ b/include/builddefs.in > @@ -109,6 +109,7 @@ HAVE_MNTENT = @have_mntent@ > HAVE_FLS = @have_fls@ > HAVE_FSETXATTR = @have_fsetxattr@ > HAVE_MREMAP = @have_mremap@ > +HAVE_FSXATTR_COWEXTSIZE = @have_fsxattr_cowextsize@ > ENABLE_INTERNAL_FSXATTR = @enable_internal_fsxattr@ We really need a comment here that states that ENABLE_INTERNAL_FSXATTR=yes implies HAVE_FSXATTR_COWEXTSIZE=yes because of the autoconf magic we do.... > diff --git a/m4/package_libcdev.m4 b/m4/package_libcdev.m4 > index 7a847e9..45954c2 100644 > --- a/m4/package_libcdev.m4 > +++ b/m4/package_libcdev.m4 > @@ -265,3 +265,29 @@ AC_DEFUN([AC_HAVE_MREMAP], > ) > AC_SUBST(have_mremap) > ]) > + > +# > +# Check if we have a struct fsxattr with a fsx_cowextsize field. > +# If linux/fs.h has a struct with that field, then we're ok. > +# If we can't find fsxattr in linux/fs.h at all, the internal > +# definitions provide it, and we're ok. > +# > +# The only way we won't have this is if the kernel headers don't > +# have the field. > +# > +AC_DEFUN([AC_HAVE_FSXATTR_COWEXTSIZE], > + [ AM_CONDITIONAL([INTERNAL_FSXATTR], [test "x$enable_internal_fsxattr" = xyes]) > + AM_COND_IF([INTERNAL_FSXATTR], > + [have_fsxattr_cowextsize=yes], Ok, so here we set the value. I think this needs a better/more generic comment because we're going to have to repeat this pattern in future. i.e. explain the basic construct, then as a separate statement say "apply it to detection of the fsx_cowextsize field". > + [ AC_CHECK_TYPE(struct fsxattr, > + [AC_CHECK_MEMBER(struct fsxattr.fsx_cowextsize, > + have_fsxattr_cowextsize=yes, > + have_fsxattr_cowextsize=no, > + [#include <linux/fs.h>] > + )], > + have_fsxattr_cowextsize=yes, > + [#include <linux/fs.h>] > + ) > + ]) > + AC_SUBST(have_fsxattr_cowextsize) > + ]) Cheers, Dave. -- Dave Chinner david@xxxxxxxxxxxxx -- 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