@@ -140,6 +140,7 @@ PCFLAGS+= -DHAVE_FSETXATTR
endif
ifeq ($(ENABLE_BLKID),yes)
PCFLAGS+= -DENABLE_BLKID
+HAVE_BLKID_DAX = @have_blkid_dax@
endif
ifeq ($(NEED_INTERNAL_FSXATTR),yes)
PCFLAGS+= -DOVERRIDE_SYSTEM_FSXATTR
@@ -56,6 +56,10 @@ ifeq ($(HAVE_GETMNTENT),yes)
LCFLAGS += -DHAVE_GETMNTENT
endif
+ifeq ($(HAVE_BLKID_DAX),yes)
+LCFLAGS += -DHAVE_BLKID_DAX
+endif
+
LDIRT = gen_crc32table crc32table.h crc32selftest
default: crc32selftest ltdepend $(LTLIBRARY)
@@ -180,6 +180,7 @@ static void blkid_get_topology(
int *swidth,
int *lsectorsize,
int *psectorsize,
+ int *dax,
int force_overwrite)
{
@@ -212,6 +213,10 @@ static void blkid_get_topology(
*sunit = val;
val = blkid_topology_get_optimal_io_size(tp);
*swidth = val;
+#if defined(HAVE_BLKID_DAX)
+ val = blkid_topology_get_dax(tp);
+ *dax = val;
+#endif
/*
* If the reported values are the same as the physical sector size
@@ -275,6 +280,7 @@ static void blkid_get_topology(
int *swidth,
int *lsectorsize,
int *psectorsize,
+ int *dax,
int force_overwrite)
{
/*
@@ -320,13 +326,14 @@ void get_topology(
} else {
blkid_get_topology(dfile, &ft->dsunit, &ft->dswidth,
&ft->lsectorsize, &ft->psectorsize,
- force_overwrite);
+ &ft->dax, force_overwrite);
}
if (xi->rtname && !xi->risfile) {
int sunit, lsectorsize, psectorsize;
blkid_get_topology(xi->rtname, &sunit, &ft->rtswidth,
- &lsectorsize, &psectorsize, force_overwrite);
+ &lsectorsize, &psectorsize, &ft->dax,
+ force_overwrite);
}
}
@@ -16,6 +16,7 @@ typedef struct fs_topology {
int rtswidth; /* stripe width - rt subvolume */
int lsectorsize; /* logical sector size &*/
int psectorsize; /* physical sector size */
+ int dax; /* dax support */
} fs_topology_t;
extern void
@@ -14,5 +14,10 @@ AC_DEFUN([AC_HAVE_BLKID_TOPO],
echo 'Install the Block device ID development package.'
exit 1
fi
+ AC_CHECK_FUNCS(blkid_topology_get_dax)
+ if test $ac_cv_func_blkid_topology_get_dax = yes; then
+ have_blkid_dax=yes
+ AC_SUBST(have_blkid_dax)
+ fi
AC_SUBST(libblkid)
])
Detect support for blkid_topology_get_dax in libblkid which was introduced in util-linux v2.36, and use it to obtain if the underlying block device is dax-capable. This can be used to issue warnings for incompatible configurations during mkfs. Signed-off-by: Anthony Iliopoulos <ailiop@suse.com> --- include/builddefs.in | 1 + libfrog/Makefile | 4 ++++ libfrog/topology.c | 11 +++++++++-- libfrog/topology.h | 1 + m4/package_blkid.m4 | 5 +++++ 5 files changed, 20 insertions(+), 2 deletions(-)