Skip to contentSkip to conversation

Detect broken system linux/fiemap.h

PATCH Applied Jim Schutt 2 participants 2 messages Nov 17, 2010

lore
Share & tools
lore

Jim Schutt

author
#0 lore raw

PATCH 1/1 Detect broken system linux/fiemap.h

RedHat 5.5 has a /usr/include/linux/fiemap.h, but it is broken because it does not itself include linux/types.h. As a result, __u64 and friends are not defined.

We have a Ceph-local copy of fiemap.h, so use it if the system version is broken.

While we're at it, fix up the configure message to note we're using a local copy.

---
 configure.ac |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
configure.ac +3 -2
index 000e892..e00cdbf 100644
@@ -162,9 +162,10 @@ AC_CHECK_HEADER([openssl/md5.h],
 	[AC_MSG_ERROR([Sorry you need openssl dev files (libssl-dev on debian)])])
 PKG_CHECK_MODULES([OPENSSL], [openssl])
 
-AC_CHECK_HEADER([linux/fiemap.h],
+AC_CHECK_MEMBER([struct fiemap_extent.fe_logical],
 	[AC_DEFINE([HAVE_FIEMAP_H], [], [linux/fiemap.h was found, fiemap ioctl will be used])],
-	[AC_MSG_NOTICE([linux/fiemap.h was not found, fiemap ioctl will not be used])])
+	[AC_MSG_NOTICE([linux/fiemap.h was not found or not usable; using local Ceph copy])],
+	[[#include <linux/fiemap.h>]])
 
 AC_CHECK_HEADERS([sys/xattr.h arpa/inet.h netdb.h netinet/in.h sys/file.h sys/ioctl.h sys/mount.h sys/param.h sys/socket.h sys/statvfs.h sys/time.h sys/vfs.h syslog.h utime.h])
 
Signature · 1 line
1.6.6
Applied
#1 lore raw

Applied.

sage

Quoted 42 lines · Jim Schutt

RedHat 5.5 has a /usr/include/linux/fiemap.h, but it is broken because it does not itself include linux/types.h. As a result, __u64 and friends are not defined.

We have a Ceph-local copy of fiemap.h, so use it
if the system version is broken.

While we're at it, fix up the configure message to note we're using a local copy.

---
 configure.ac |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
configure.ac +3 -2
index 000e892..e00cdbf 100644
@@ -162,9 +162,10 @@ AC_CHECK_HEADER([openssl/md5.h],
 	[AC_MSG_ERROR([Sorry you need openssl dev files (libssl-dev on debian)])])
 PKG_CHECK_MODULES([OPENSSL], [openssl])
 
-AC_CHECK_HEADER([linux/fiemap.h],
+AC_CHECK_MEMBER([struct fiemap_extent.fe_logical],
 	[AC_DEFINE([HAVE_FIEMAP_H], [], [linux/fiemap.h was found, fiemap ioctl will be used])],
-	[AC_MSG_NOTICE([linux/fiemap.h was not found, fiemap ioctl will not be used])])
+	[AC_MSG_NOTICE([linux/fiemap.h was not found or not usable; using local Ceph copy])],
+	[[#include <linux/fiemap.h>]])
 
 AC_CHECK_HEADERS([sys/xattr.h arpa/inet.h netdb.h netinet/in.h sys/file.h sys/ioctl.h sys/mount.h sys/param.h sys/socket.h sys/statvfs.h sys/time.h sys/vfs.h syslog.h utime.h])
 
Signature · 7 lines
1.6.6


--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html