History

Merge branch 'vfs_timespec64' of https://github.com/deepa-hub/vfs into vfs-timespec64

Pull the timespec64 conversion from Deepa Dinamani: "The series aims to switch vfs timestamps to use struct timespec64. Currently vfs uses struct timespec, which is not y2038 safe. The flag patch applies cleanly. I've not seen the timestamps update logic change often. The series applies cleanly on 4.17-rc6 and linux-next tip (top commit: next-20180517). I'm not sure how to merge this kind of a series with a flag patch. We are targeting 4.18 for this. Let me know if you have other suggestions. The series involves the following: 1. Add vfs helper functions for supporting struct timepec64 timestamps. 2. Cast prints of vfs timestamps to avoid warnings after the switch. 3. Simplify code using vfs timestamps so that the actual replacement becomes easy. 4. Convert vfs timestamps to use struct timespec64 using a script. This is a flag day patch. I've tried to keep the conversions with the script simple, to aid in the reviews. I've kept all the internal filesystem data structures and function signatures the same. Next steps: 1. Convert APIs that can handle timespec64, instead of converting timestamps at the boundaries. 2. Update internal data structures to avoid timestamp conversions." I've pulled it into a branch based on top of the NFS changes that are now in mainline, so I could resolve the non-obvious conflict between the two while merging.

Arnd Bergmann committed 8 years ago

Commit 15eefe22 parents 93b7f7a 95582b090 files · +563 −439Browse files

Showing the changes to include/linux (3 of 90 files). Show all

Unified · Split

3 files
  1. include/linux/fs.h +13 −11
  2. include/linux/pstore.h +1 −1
  3. include/linux/stat.h +4 −4
include/linux/fs.h+13−11
@@ -206,9 +206,9 @@ struct iattr { · 205 unmodified lines
206 kuid_t ia_uid;206 kuid_t ia_uid;
207 kgid_t ia_gid;207 kgid_t ia_gid;
208 loff_t ia_size;208 loff_t ia_size;
209 struct timespec ia_atime;209 struct timespec64 ia_atime;
210 struct timespec ia_mtime;210 struct timespec64 ia_mtime;
211 struct timespec ia_ctime;211 struct timespec64 ia_ctime;
212 212
213 /*213 /*
214 * Not an attribute, but an auxiliary info for filesystems wanting to214 * Not an attribute, but an auxiliary info for filesystems wanting to
@@ -602,9 +602,9 @@ struct inode { · 387 unmodified lines
602 };602 };
603 dev_t i_rdev;603 dev_t i_rdev;
604 loff_t i_size;604 loff_t i_size;
605 struct timespec i_atime;605 struct timespec64 i_atime;
606 struct timespec i_mtime;606 struct timespec64 i_mtime;
607 struct timespec i_ctime;607 struct timespec64 i_ctime;
608 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */608 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
609 unsigned short i_bytes;609 unsigned short i_bytes;
610 unsigned int i_blkbits;610 unsigned int i_blkbits;
@@ -1091,7 +1091,7 @@ extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct · 480 unmodified lines
1091extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl);1091extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl);
1092extern int locks_lock_inode_wait(struct inode *inode, struct file_lock *fl);1092extern int locks_lock_inode_wait(struct inode *inode, struct file_lock *fl);
1093extern int __break_lease(struct inode *inode, unsigned int flags, unsigned int type);1093extern int __break_lease(struct inode *inode, unsigned int flags, unsigned int type);
1094extern void lease_get_mtime(struct inode *, struct timespec *time);1094extern void lease_get_mtime(struct inode *, struct timespec64 *time);
1095extern int generic_setlease(struct file *, long, struct file_lock **, void **priv);1095extern int generic_setlease(struct file *, long, struct file_lock **, void **priv);
1096extern int vfs_setlease(struct file *, long, struct file_lock **, void **);1096extern int vfs_setlease(struct file *, long, struct file_lock **, void **);
1097extern int lease_modify(struct file_lock *, int, struct list_head *);1097extern int lease_modify(struct file_lock *, int, struct list_head *);
@@ -1206,7 +1206,8 @@ static inline int __break_lease(struct inode *inode, unsigned int mode, unsigned · 108 unmodified lines
1206 return 0;1206 return 0;
1207}1207}
1208 1208
1209static inline void lease_get_mtime(struct inode *inode, struct timespec *time)1209static inline void lease_get_mtime(struct inode *inode,
1210 struct timespec64 *time)
1210{1211{
1211 return;1212 return;
1212}1213}
@@ -1476,7 +1477,8 @@ static inline void i_gid_write(struct inode *inode, gid_t gid) · 263 unmodified lines
1476 inode->i_gid = make_kgid(inode->i_sb->s_user_ns, gid);1477 inode->i_gid = make_kgid(inode->i_sb->s_user_ns, gid);
1477}1478}
1478 1479
1479extern struct timespec current_time(struct inode *inode);1480extern struct timespec64 timespec64_trunc(struct timespec64 t, unsigned gran);
1481extern struct timespec64 current_time(struct inode *inode);
1480 1482
1481/*1483/*
1482 * Snapshotting support.1484 * Snapshotting support.
@@ -1764,7 +1766,7 @@ struct inode_operations { · 281 unmodified lines
1764 ssize_t (*listxattr) (struct dentry *, char *, size_t);1766 ssize_t (*listxattr) (struct dentry *, char *, size_t);
1765 int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start,1767 int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start,
1766 u64 len);1768 u64 len);
1767 int (*update_time)(struct inode *, struct timespec *, int);1769 int (*update_time)(struct inode *, struct timespec64 *, int);
1768 int (*atomic_open)(struct inode *, struct dentry *,1770 int (*atomic_open)(struct inode *, struct dentry *,
1769 struct file *, unsigned open_flag,1771 struct file *, unsigned open_flag,
1770 umode_t create_mode, int *opened);1772 umode_t create_mode, int *opened);
@@ -2198,7 +2200,7 @@ extern int current_umask(void); · 427 unmodified lines
2198 2200
2199extern void ihold(struct inode * inode);2201extern void ihold(struct inode * inode);
2200extern void iput(struct inode *);2202extern void iput(struct inode *);
2201extern int generic_update_time(struct inode *, struct timespec *, int);2203extern int generic_update_time(struct inode *, struct timespec64 *, int);
2202 2204
2203/* /sys/fs */2205/* /sys/fs */
2204extern struct kobject *fs_kobj;2206extern struct kobject *fs_kobj;
include/linux/pstore.h+1−1
@@ -71,7 +71,7 @@ struct pstore_record { · 70 unmodified lines
71 struct pstore_info *psi;71 struct pstore_info *psi;
72 enum pstore_type_id type;72 enum pstore_type_id type;
73 u64 id;73 u64 id;
74 struct timespec time;74 struct timespec64 time;
75 char *buf;75 char *buf;
76 ssize_t size;76 ssize_t size;
77 ssize_t ecc_notice_size;77 ssize_t ecc_notice_size;
include/linux/stat.h+4−4
@@ -41,10 +41,10 @@ struct kstat { · 40 unmodified lines
41 kuid_t uid;41 kuid_t uid;
42 kgid_t gid;42 kgid_t gid;
43 loff_t size;43 loff_t size;
44 struct timespec atime;44 struct timespec64 atime;
45 struct timespec mtime;45 struct timespec64 mtime;
46 struct timespec ctime;46 struct timespec64 ctime;
47 struct timespec btime; /* File creation time */47 struct timespec64 btime; /* File creation time */
48 u64 blocks;48 u64 blocks;
49};49};
50 50