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
206206 kuid_t ia_uid;
207207 kgid_t ia_gid;
208208 loff_t ia_size;
209− struct timespec ia_atime;
210− struct timespec ia_mtime;
211− struct timespec ia_ctime;
209+ struct timespec64 ia_atime;
210+ struct timespec64 ia_mtime;
211+ struct timespec64 ia_ctime;
212212
213213 /*
214214 * Not an attribute, but an auxiliary info for filesystems wanting to
@@ -602,9 +602,9 @@ struct inode { · 387 unmodified lines
602602 };
603603 dev_t i_rdev;
604604 loff_t i_size;
605− struct timespec i_atime;
606− struct timespec i_mtime;
607− struct timespec i_ctime;
605+ struct timespec64 i_atime;
606+ struct timespec64 i_mtime;
607+ struct timespec64 i_ctime;
608608 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
609609 unsigned short i_bytes;
610610 unsigned int i_blkbits;
@@ -1091,7 +1091,7 @@ extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct · 480 unmodified lines
10911091 extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl);
10921092 extern int locks_lock_inode_wait(struct inode *inode, struct file_lock *fl);
10931093 extern int __break_lease(struct inode *inode, unsigned int flags, unsigned int type);
1094−extern void lease_get_mtime(struct inode *, struct timespec *time);
1094+extern void lease_get_mtime(struct inode *, struct timespec64 *time);
10951095 extern int generic_setlease(struct file *, long, struct file_lock **, void **priv);
10961096 extern int vfs_setlease(struct file *, long, struct file_lock **, void **);
10971097 extern 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
12061206 return 0;
12071207 }
12081208
1209−static inline void lease_get_mtime(struct inode *inode, struct timespec *time)
1209+static inline void lease_get_mtime(struct inode *inode,
1210+ struct timespec64 *time)
12101211 {
12111212 return;
12121213 }
@@ -1476,7 +1477,8 @@ static inline void i_gid_write(struct inode *inode, gid_t gid) · 263 unmodified lines
14761477 inode->i_gid = make_kgid(inode->i_sb->s_user_ns, gid);
14771478 }
14781479
1479−extern struct timespec current_time(struct inode *inode);
1480+extern struct timespec64 timespec64_trunc(struct timespec64 t, unsigned gran);
1481+extern struct timespec64 current_time(struct inode *inode);
14801482
14811483 /*
14821484 * Snapshotting support.
@@ -1764,7 +1766,7 @@ struct inode_operations { · 281 unmodified lines
17641766 ssize_t (*listxattr) (struct dentry *, char *, size_t);
17651767 int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start,
17661768 u64 len);
1767− int (*update_time)(struct inode *, struct timespec *, int);
1769+ int (*update_time)(struct inode *, struct timespec64 *, int);
17681770 int (*atomic_open)(struct inode *, struct dentry *,
17691771 struct file *, unsigned open_flag,
17701772 umode_t create_mode, int *opened);
@@ -2198,7 +2200,7 @@ extern int current_umask(void); · 427 unmodified lines
21982200
21992201 extern void ihold(struct inode * inode);
22002202 extern void iput(struct inode *);
2201−extern int generic_update_time(struct inode *, struct timespec *, int);
2203+extern int generic_update_time(struct inode *, struct timespec64 *, int);
22022204
22032205 /* /sys/fs */
22042206 extern struct kobject *fs_kobj;
include/linux/pstore.h+1−1
@@ -71,7 +71,7 @@ struct pstore_record { · 70 unmodified lines
7171 struct pstore_info *psi;
7272 enum pstore_type_id type;
7373 u64 id;
74− struct timespec time;
74+ struct timespec64 time;
7575 char *buf;
7676 ssize_t size;
7777 ssize_t ecc_notice_size;
include/linux/stat.h+4−4
@@ -41,10 +41,10 @@ struct kstat { · 40 unmodified lines
4141 kuid_t uid;
4242 kgid_t gid;
4343 loff_t size;
44− struct timespec atime;
45− struct timespec mtime;
46− struct timespec ctime;
47− struct timespec btime; /* File creation time */
44+ struct timespec64 atime;
45+ struct timespec64 mtime;
46+ struct timespec64 ctime;
47+ struct timespec64 btime; /* File creation time */
4848 u64 blocks;
4949 };
5050