From: Felix Janda <felix.janda@posteo.de>
To: xfs@oss.sgi.com
Subject: [PATCH 1/4] Remove off64_t from linux.h
Date: Sat, 18 Jun 2016 16:52:38 +0200 [thread overview]
Message-ID: <20160618145238.GA17768@nyan> (raw)
The off64_t type is usually only conditionally exposed under the
feature test macro _LARGEFILE64_SOURCE (also defined by _GNU_SOURCE).
To make the public xfs headers more standalone therefore off64_t should
be avoided.
Enable transparent large file support via configure so that the
standard off_t is the same as off64_t. Make compilation of linux
programs using libxfs but without large file support fail. Now off64_t
can safely be replaced by off_t in linux.h.
Signed-off-by: Felix Janda <felix.janda@posteo.de>
---
configure.ac | 2 ++
include/linux.h | 7 ++++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index a4a6cfa..2ea3e50 100644
--- a/configure.ac
+++ b/configure.ac
@@ -107,6 +107,8 @@ AC_PACKAGE_UTILITIES(xfsprogs)
AC_MULTILIB($enable_lib64)
AC_RT($enable_librt)
+AC_SYS_LARGEFILE
+
AC_PACKAGE_NEED_UUID_H
AC_PACKAGE_NEED_UUIDCOMPARE
diff --git a/include/linux.h b/include/linux.h
index cc0f70c..b94de81 100644
--- a/include/linux.h
+++ b/include/linux.h
@@ -142,7 +142,12 @@ platform_discard_blocks(int fd, uint64_t start, uint64_t len)
#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
#define EFSBADCRC EBADMSG /* Bad CRC detected */
-typedef off64_t xfs_off_t;
+/* Make compilation fail when off_t has 32 bits */
+struct __xfs_assert_64bit_off_t {
+ int assert_64bit_off_t[sizeof(off_t)-8];
+};
+
+typedef off_t xfs_off_t;
typedef __uint64_t xfs_ino_t;
typedef __uint32_t xfs_dev_t;
typedef __int64_t xfs_daddr_t;
--
2.7.3
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next reply other threads:[~2016-06-18 14:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-18 14:52 Felix Janda [this message]
2016-06-20 2:04 ` [PATCH 1/4] Remove off64_t from linux.h Dave Chinner
2016-06-20 6:53 ` Felix Janda
2016-06-20 23:18 ` Dave Chinner
2016-06-21 20:07 ` Felix Janda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160618145238.GA17768@nyan \
--to=felix.janda@posteo.de \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox