Fix FreeBSD support

* Fix dep calculation in Makefile.FreeBSD to ignore other os specific
   header files, avoid blowing up on includes in os-solaris.h
 * Mark FreeBSD as not supporting fdatasync()
 * Add documentation note about FreeBSD not supporting fsyncdata=
 * Add warning if fsyncdata= is used on os that doesn't support, fall
   back to fsync()

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/HOWTO b/HOWTO
index 91a1ec3..886515b 100644
--- a/HOWTO
+++ b/HOWTO
@@ -568,6 +568,8 @@
 
 fsyncdata=int	Like fsync= but uses fdatasync() to only sync data and not
 		metadata blocks.
+		In FreeBSD there is no fdatasync(), this falls back to
+		using fsync()
 
 overwrite=bool	If true, writes to a file will always overwrite existing
 		data. If the file doesn't already exist, it will be
diff --git a/Makefile.FreeBSD b/Makefile.FreeBSD
index 947bb85..b499893 100644
--- a/Makefile.FreeBSD
+++ b/Makefile.FreeBSD
@@ -30,7 +30,8 @@
 	 io_u.c log.c memory.c mutex.c options.c parse.c rbtree.c smalloc.c \
 	 stat.c parse.c crc/*.c engines/cpu.c engines/mmap.c \
 	 engines/posixaio.c engines/sync.c engines/null.c engines/net.c \
-	 *.h */*.h
+	 *.h arch/*.h compiler/*.h crc/*.h lib/*.h \
+	 os/indirect.h os/kcompat.h os/os-freebsd.h os/os.h os/syslet.h
 
 ifneq ($(findstring $(MAKEFLAGS),s),s)
 ifndef V
diff --git a/init.c b/init.c
index b5ced88..af83757 100644
--- a/init.c
+++ b/init.c
@@ -382,6 +382,17 @@
 				 " that isn't seekable. Pre-read disabled.\n");
 	}
 
+#ifndef FIO_HAVE_FDATASYNC
+	if (td->o.fdatasync_blocks) {
+		log_info("fio: this platform does not support fdatasync()"
+			 " falling back to using fsync().  Use the 'fsync'"
+			 " option instead of 'fdatasync' to get rid of"
+			 " this warning\n");
+		td->o.fsync_blocks = td->o.fdatasync_blocks;
+		td->o.fdatasync_blocks = 0;
+	}
+#endif
+
 	return 0;
 }
 
diff --git a/os/os-freebsd.h b/os/os-freebsd.h
index 062c44c..8d965aa 100644
--- a/os/os-freebsd.h
+++ b/os/os-freebsd.h
@@ -8,7 +8,6 @@
 #define FIO_HAVE_ODIRECT
 #define FIO_USE_GENERIC_BDEV_SIZE
 #define FIO_USE_GENERIC_RAND
-#define FIO_HAVE_FDATASYNC
 
 #define OS_MAP_ANON		MAP_ANON