summaryrefslogtreecommitdiff
path: root/fs/hostfs/hostfs.h
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2018-06-12 16:31:17 +0300
committerArnd Bergmann <arnd@arndb.de>2019-12-18 20:07:32 +0300
commitbca302651af496615829be13165552a2c160a1a1 (patch)
tree57e77738a2f94df8af441e5c9a6893fd7f0b4ac2 /fs/hostfs/hostfs.h
parentd413fcb436f79b6305201494ec13099171ba33a6 (diff)
downloadlinux-bca302651af496615829be13165552a2c160a1a1.tar.xz
hostfs: pass 64-bit timestamps to/from user space
The use of 'struct timespec' is deprecated in the kernel, so we want to avoid the conversions from/to the proper timespec64 structure. On the user space side, we have a 'struct timespec' that is defined by the C library and that will be incompatible with the kernel's view on 32-bit architectures once they move to a 64-bit time_t, breaking the shared binary layout of hostfs_iattr and hostfs_stat. This changes the two structures to use a new hostfs_timespec structure with fixed 64-bit seconds/nanoseconds for passing the timestamps between hostfs_kern.c and hostfs_user.c. With a new enough user space side, this will allow timestamps beyond year 2038. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'fs/hostfs/hostfs.h')
-rw-r--r--fs/hostfs/hostfs.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/fs/hostfs/hostfs.h b/fs/hostfs/hostfs.h
index f4295aa19350..69cb796f6270 100644
--- a/fs/hostfs/hostfs.h
+++ b/fs/hostfs/hostfs.h
@@ -37,16 +37,20 @@
* is on, and remove the appropriate bits from attr->ia_mode (attr is a
* "struct iattr *"). -BlaisorBlade
*/
+struct hostfs_timespec {
+ long long tv_sec;
+ long long tv_nsec;
+};
struct hostfs_iattr {
- unsigned int ia_valid;
- unsigned short ia_mode;
- uid_t ia_uid;
- gid_t ia_gid;
- loff_t ia_size;
- struct timespec ia_atime;
- struct timespec ia_mtime;
- struct timespec ia_ctime;
+ unsigned int ia_valid;
+ unsigned short ia_mode;
+ uid_t ia_uid;
+ gid_t ia_gid;
+ loff_t ia_size;
+ struct hostfs_timespec ia_atime;
+ struct hostfs_timespec ia_mtime;
+ struct hostfs_timespec ia_ctime;
};
struct hostfs_stat {
@@ -56,7 +60,7 @@ struct hostfs_stat {
unsigned int uid;
unsigned int gid;
unsigned long long size;
- struct timespec atime, mtime, ctime;
+ struct hostfs_timespec atime, mtime, ctime;
unsigned int blksize;
unsigned long long blocks;
unsigned int maj;