From: Mike Frysinger <vapier@gentoo.org>
To: x86@kernel.org, Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] x86: make stat/statfs 64-bit for x86_64 kernels
Date: Thu, 9 May 2013 00:00:57 -0400 [thread overview]
Message-ID: <1368072057-7832-1-git-send-email-vapier@gentoo.org> (raw)
When including these headers in the x32 ABI, the structs get declared
with 32bit sizes which is incorrect. Use long long and such to make
it work both with x32 and x86_64.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
arch/x86/include/uapi/asm/stat.h | 38 +++++++++++++++++++-------------------
arch/x86/include/uapi/asm/statfs.h | 5 +++++
2 files changed, 24 insertions(+), 19 deletions(-)
diff --git a/arch/x86/include/uapi/asm/stat.h b/arch/x86/include/uapi/asm/stat.h
index 7b3ddc3..e9d6951 100644
--- a/arch/x86/include/uapi/asm/stat.h
+++ b/arch/x86/include/uapi/asm/stat.h
@@ -78,26 +78,26 @@ struct stat64 {
#else /* __i386__ */
struct stat {
- unsigned long st_dev;
- unsigned long st_ino;
- unsigned long st_nlink;
-
- unsigned int st_mode;
- unsigned int st_uid;
- unsigned int st_gid;
- unsigned int __pad0;
- unsigned long st_rdev;
- long st_size;
- long st_blksize;
- long st_blocks; /* Number 512-byte blocks allocated. */
+ unsigned long long st_dev;
+ unsigned long long st_ino;
+ unsigned long long st_nlink;
- unsigned long st_atime;
- unsigned long st_atime_nsec;
- unsigned long st_mtime;
- unsigned long st_mtime_nsec;
- unsigned long st_ctime;
- unsigned long st_ctime_nsec;
- long __unused[3];
+ unsigned int st_mode;
+ unsigned int st_uid;
+ unsigned int st_gid;
+ unsigned int __pad0;
+ unsigned long long st_rdev;
+ long long st_size;
+ long long st_blksize;
+ long long st_blocks; /* Number 512-byte blocks allocated. */
+
+ unsigned long long st_atime;
+ unsigned long long st_atime_nsec;
+ unsigned long long st_mtime;
+ unsigned long long st_mtime_nsec;
+ unsigned long long st_ctime;
+ unsigned long long st_ctime_nsec;
+ long long __unused[3];
};
/* We don't need to memset the whole thing just to initialize the padding */
diff --git a/arch/x86/include/uapi/asm/statfs.h b/arch/x86/include/uapi/asm/statfs.h
index 2d0adbf..3cb5744 100644
--- a/arch/x86/include/uapi/asm/statfs.h
+++ b/arch/x86/include/uapi/asm/statfs.h
@@ -8,5 +8,10 @@
*/
#define ARCH_PACK_COMPAT_STATFS64 __attribute__((packed,aligned(4)))
+/* For x86-64, both the 64bit and x32 ABIs have 64bit fields. */
+#ifdef __x86_64__
+#define __statfs_word __u64
+#endif
+
#include <asm-generic/statfs.h>
#endif /* _ASM_X86_STATFS_H */
--
1.8.2.1
next reply other threads:[~2013-05-09 4:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-09 4:00 Mike Frysinger [this message]
2013-05-09 4:04 ` H. Peter Anvin
2013-05-09 4:08 ` Mike Frysinger
2013-05-09 4:18 ` H. Peter Anvin
2013-05-09 5:13 ` Mike Frysinger
2013-05-09 5:44 ` H. Peter Anvin
2013-05-09 4:04 ` H. Peter Anvin
2013-05-09 4:10 ` Mike Frysinger
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=1368072057-7832-1-git-send-email-vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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
all inboxes | Powered by JetHome®