aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac2
-rw-r--r--mkfs/Makefile.am2
-rw-r--r--mkfs/f2fs_format_utils.c6
3 files changed, 7 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index c2dafb0..0111e72 100644
--- a/configure.ac
+++ b/configure.ac
@@ -56,7 +56,7 @@ AC_PATH_PROG([LDCONFIG], [ldconfig],
PKG_CHECK_MODULES([libuuid], [uuid])
# Checks for header files.
-AC_CHECK_HEADERS([fcntl.h mntent.h stdlib.h string.h \
+AC_CHECK_HEADERS([linux/fs.h fcntl.h mntent.h stdlib.h string.h \
sys/ioctl.h sys/mount.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
diff --git a/mkfs/Makefile.am b/mkfs/Makefile.am
index ff136a7..fa48699 100644
--- a/mkfs/Makefile.am
+++ b/mkfs/Makefile.am
@@ -1,7 +1,7 @@
## Makefile.am
AM_CPPFLAGS = ${libuuid_CFLAGS} -I$(top_srcdir)/include
-AM_CFLAGS = -Wall -DBLKDISCARD
+AM_CFLAGS = -Wall -DWITH_BLKDISCARD
sbin_PROGRAMS = mkfs.f2fs
mkfs_f2fs_SOURCES = f2fs_format_main.c f2fs_format.c f2fs_format_utils.c
mkfs_f2fs_LDADD = ${libuuid_LIBS} $(top_builddir)/lib/libf2fs.la
diff --git a/mkfs/f2fs_format_utils.c b/mkfs/f2fs_format_utils.c
index 8f7e094..9892a8f 100644
--- a/mkfs/f2fs_format_utils.c
+++ b/mkfs/f2fs_format_utils.c
@@ -15,6 +15,10 @@
#include "f2fs_fs.h"
+#ifdef HAVE_LINUX_FS_H
+#include <linux/fs.h>
+#endif
+
int f2fs_trim_device()
{
unsigned long long range[2];
@@ -31,7 +35,7 @@ int f2fs_trim_device()
return -1;
}
-#if defined(BLKDISCARD)
+#if defined(WITH_BLKDISCARD) && defined(BLKDISCARD)
MSG(0, "Info: Discarding device\n");
if (S_ISREG(stat_buf.st_mode))
return 0;