diff options
85 files changed, 539 insertions, 424 deletions
diff --git a/drivers/firmware/efi/efi-pstore.c b/drivers/firmware/efi/efi-pstore.c index 5a0fa939d70f..cfe87b465819 100644 --- a/drivers/firmware/efi/efi-pstore.c +++ b/drivers/firmware/efi/efi-pstore.c | |||
@@ -28,10 +28,9 @@ static int efi_pstore_close(struct pstore_info *psi) | |||
28 | return 0; | 28 | return 0; |
29 | } | 29 | } |
30 | 30 | ||
31 | static inline u64 generic_id(unsigned long timestamp, | 31 | static inline u64 generic_id(u64 timestamp, unsigned int part, int count) |
32 | unsigned int part, int count) | ||
33 | { | 32 | { |
34 | return ((u64) timestamp * 100 + part) * 1000 + count; | 33 | return (timestamp * 100 + part) * 1000 + count; |
35 | } | 34 | } |
36 | 35 | ||
37 | static int efi_pstore_read_func(struct efivar_entry *entry, | 36 | static int efi_pstore_read_func(struct efivar_entry *entry, |
@@ -42,7 +41,8 @@ static int efi_pstore_read_func(struct efivar_entry *entry, | |||
42 | int i; | 41 | int i; |
43 | int cnt; | 42 | int cnt; |
44 | unsigned int part; | 43 | unsigned int part; |
45 | unsigned long time, size; | 44 | unsigned long size; |
45 | u64 time; | ||
46 | 46 | ||
47 | if (efi_guidcmp(entry->var.VendorGuid, vendor)) | 47 | if (efi_guidcmp(entry->var.VendorGuid, vendor)) |
48 | return 0; | 48 | return 0; |
@@ -50,7 +50,7 @@ static int efi_pstore_read_func(struct efivar_entry *entry, | |||
50 | for (i = 0; i < DUMP_NAME_LEN; i++) | 50 | for (i = 0; i < DUMP_NAME_LEN; i++) |
51 | name[i] = entry->var.VariableName[i]; | 51 | name[i] = entry->var.VariableName[i]; |
52 | 52 | ||
53 | if (sscanf(name, "dump-type%u-%u-%d-%lu-%c", | 53 | if (sscanf(name, "dump-type%u-%u-%d-%llu-%c", |
54 | &record->type, &part, &cnt, &time, &data_type) == 5) { | 54 | &record->type, &part, &cnt, &time, &data_type) == 5) { |
55 | record->id = generic_id(time, part, cnt); | 55 | record->id = generic_id(time, part, cnt); |
56 | record->part = part; | 56 | record->part = part; |
@@ -62,7 +62,7 @@ static int efi_pstore_read_func(struct efivar_entry *entry, | |||
62 | else | 62 | else |
63 | record->compressed = false; | 63 | record->compressed = false; |
64 | record->ecc_notice_size = 0; | 64 | record->ecc_notice_size = 0; |
65 | } else if (sscanf(name, "dump-type%u-%u-%d-%lu", | 65 | } else if (sscanf(name, "dump-type%u-%u-%d-%llu", |
66 | &record->type, &part, &cnt, &time) == 4) { | 66 | &record->type, &part, &cnt, &time) == 4) { |
67 | record->id = generic_id(time, part, cnt); | 67 | record->id = generic_id(time, part, cnt); |
68 | record->part = part; | 68 | record->part = part; |
@@ -71,7 +71,7 @@ static int efi_pstore_read_func(struct efivar_entry *entry, | |||
71 | record->time.tv_nsec = 0; | 71 | record->time.tv_nsec = 0; |
72 | record->compressed = false; | 72 | record->compressed = false; |
73 | record->ecc_notice_size = 0; | 73 | record->ecc_notice_size = 0; |
74 | } else if (sscanf(name, "dump-type%u-%u-%lu", | 74 | } else if (sscanf(name, "dump-type%u-%u-%llu", |
75 | &record->type, &part, &time) == 3) { | 75 | &record->type, &part, &time) == 3) { |
76 | /* | 76 | /* |
77 | * Check if an old format, | 77 | * Check if an old format, |
@@ -250,9 +250,10 @@ static int efi_pstore_write(struct pstore_record *record) | |||
250 | /* Since we copy the entire length of name, make sure it is wiped. */ | 250 | /* Since we copy the entire length of name, make sure it is wiped. */ |
251 | memset(name, 0, sizeof(name)); | 251 | memset(name, 0, sizeof(name)); |
252 | 252 | ||
253 | snprintf(name, sizeof(name), "dump-type%u-%u-%d-%lu-%c", | 253 | snprintf(name, sizeof(name), "dump-type%u-%u-%d-%lld-%c", |
254 | record->type, record->part, record->count, | 254 | record->type, record->part, record->count, |
255 | record->time.tv_sec, record->compressed ? 'C' : 'D'); | 255 | (long long)record->time.tv_sec, |
256 | record->compressed ? 'C' : 'D'); | ||
256 | 257 | ||
257 | for (i = 0; i < DUMP_NAME_LEN; i++) | 258 | for (i = 0; i < DUMP_NAME_LEN; i++) |
258 | efi_name[i] = name[i]; | 259 | efi_name[i] = name[i]; |
@@ -327,15 +328,15 @@ static int efi_pstore_erase(struct pstore_record *record) | |||
327 | char name[DUMP_NAME_LEN]; | 328 | char name[DUMP_NAME_LEN]; |
328 | int ret; | 329 | int ret; |
329 | 330 | ||
330 | snprintf(name, sizeof(name), "dump-type%u-%u-%d-%lu", | 331 | snprintf(name, sizeof(name), "dump-type%u-%u-%d-%lld", |
331 | record->type, record->part, record->count, | 332 | record->type, record->part, record->count, |
332 | record->time.tv_sec); | 333 | (long long)record->time.tv_sec); |
333 | ret = efi_pstore_erase_name(name); | 334 | ret = efi_pstore_erase_name(name); |
334 | if (ret != -ENOENT) | 335 | if (ret != -ENOENT) |
335 | return ret; | 336 | return ret; |
336 | 337 | ||
337 | snprintf(name, sizeof(name), "dump-type%u-%u-%lu", | 338 | snprintf(name, sizeof(name), "dump-type%u-%u-%lld", |
338 | record->type, record->part, record->time.tv_sec); | 339 | record->type, record->part, (long long)record->time.tv_sec); |
339 | ret = efi_pstore_erase_name(name); | 340 | ret = efi_pstore_erase_name(name); |
340 | 341 | ||
341 | return ret; | 342 | return ret; |
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 7c838b90a31d..aba59521ad48 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c | |||
@@ -867,8 +867,13 @@ static ssize_t tty_read(struct file *file, char __user *buf, size_t count, | |||
867 | i = -EIO; | 867 | i = -EIO; |
868 | tty_ldisc_deref(ld); | 868 | tty_ldisc_deref(ld); |
869 | 869 | ||
870 | if (i > 0) | 870 | if (i > 0) { |
871 | tty_update_time(&inode->i_atime); | 871 | struct timespec ts; |
872 | |||
873 | ts = timespec64_to_timespec(inode->i_atime); | ||
874 | tty_update_time(&ts); | ||
875 | inode->i_atime = timespec_to_timespec64(ts); | ||
876 | } | ||
872 | 877 | ||
873 | return i; | 878 | return i; |
874 | } | 879 | } |
@@ -969,7 +974,11 @@ static inline ssize_t do_tty_write( | |||
969 | cond_resched(); | 974 | cond_resched(); |
970 | } | 975 | } |
971 | if (written) { | 976 | if (written) { |
972 | tty_update_time(&file_inode(file)->i_mtime); | 977 | struct timespec ts; |
978 | |||
979 | ts = timespec64_to_timespec(file_inode(file)->i_mtime); | ||
980 | tty_update_time(&ts); | ||
981 | file_inode(file)->i_mtime = timespec_to_timespec64(ts); | ||
973 | ret = written; | 982 | ret = written; |
974 | } | 983 | } |
975 | out: | 984 | out: |
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index 199d25700050..dce9d12c7981 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c | |||
@@ -1308,7 +1308,7 @@ ffs_sb_make_inode(struct super_block *sb, void *data, | |||
1308 | inode = new_inode(sb); | 1308 | inode = new_inode(sb); |
1309 | 1309 | ||
1310 | if (likely(inode)) { | 1310 | if (likely(inode)) { |
1311 | struct timespec ts = current_time(inode); | 1311 | struct timespec64 ts = current_time(inode); |
1312 | 1312 | ||
1313 | inode->i_ino = get_next_ino(); | 1313 | inode->i_ino = get_next_ino(); |
1314 | inode->i_mode = perms->mode; | 1314 | inode->i_mode = perms->mode; |
diff --git a/fs/adfs/inode.c b/fs/adfs/inode.c index 8dbd36f5e581..c836c425ca94 100644 --- a/fs/adfs/inode.c +++ b/fs/adfs/inode.c | |||
@@ -199,7 +199,7 @@ adfs_adfs2unix_time(struct timespec *tv, struct inode *inode) | |||
199 | return; | 199 | return; |
200 | 200 | ||
201 | cur_time: | 201 | cur_time: |
202 | *tv = current_time(inode); | 202 | *tv = timespec64_to_timespec(current_time(inode)); |
203 | return; | 203 | return; |
204 | 204 | ||
205 | too_early: | 205 | too_early: |
@@ -242,6 +242,7 @@ adfs_unix2adfs_time(struct inode *inode, unsigned int secs) | |||
242 | struct inode * | 242 | struct inode * |
243 | adfs_iget(struct super_block *sb, struct object_info *obj) | 243 | adfs_iget(struct super_block *sb, struct object_info *obj) |
244 | { | 244 | { |
245 | struct timespec ts; | ||
245 | struct inode *inode; | 246 | struct inode *inode; |
246 | 247 | ||
247 | inode = new_inode(sb); | 248 | inode = new_inode(sb); |
@@ -270,7 +271,9 @@ adfs_iget(struct super_block *sb, struct object_info *obj) | |||
270 | ADFS_I(inode)->stamped = ((obj->loadaddr & 0xfff00000) == 0xfff00000); | 271 | ADFS_I(inode)->stamped = ((obj->loadaddr & 0xfff00000) == 0xfff00000); |
271 | 272 | ||
272 | inode->i_mode = adfs_atts2mode(sb, inode); | 273 | inode->i_mode = adfs_atts2mode(sb, inode); |
273 | adfs_adfs2unix_time(&inode->i_mtime, inode); | 274 | ts = timespec64_to_timespec(inode->i_mtime); |
275 | adfs_adfs2unix_time(&ts, inode); | ||
276 | inode->i_mtime = timespec_to_timespec64(ts); | ||
274 | inode->i_atime = inode->i_mtime; | 277 | inode->i_atime = inode->i_mtime; |
275 | inode->i_ctime = inode->i_mtime; | 278 | inode->i_ctime = inode->i_mtime; |
276 | 279 | ||
diff --git a/fs/afs/fsclient.c b/fs/afs/fsclient.c index b273e1d60478..5907601aafd0 100644 --- a/fs/afs/fsclient.c +++ b/fs/afs/fsclient.c | |||
@@ -72,7 +72,7 @@ void afs_update_inode_from_status(struct afs_vnode *vnode, | |||
72 | const afs_dataversion_t *expected_version, | 72 | const afs_dataversion_t *expected_version, |
73 | u8 flags) | 73 | u8 flags) |
74 | { | 74 | { |
75 | struct timespec t; | 75 | struct timespec64 t; |
76 | umode_t mode; | 76 | umode_t mode; |
77 | 77 | ||
78 | t.tv_sec = status->mtime_client; | 78 | t.tv_sec = status->mtime_client; |
@@ -183,14 +183,14 @@ void setattr_copy(struct inode *inode, const struct iattr *attr) | |||
183 | if (ia_valid & ATTR_GID) | 183 | if (ia_valid & ATTR_GID) |
184 | inode->i_gid = attr->ia_gid; | 184 | inode->i_gid = attr->ia_gid; |
185 | if (ia_valid & ATTR_ATIME) | 185 | if (ia_valid & ATTR_ATIME) |
186 | inode->i_atime = timespec_trunc(attr->ia_atime, | 186 | inode->i_atime = timespec64_trunc(attr->ia_atime, |
187 | inode->i_sb->s_time_gran); | 187 | inode->i_sb->s_time_gran); |
188 | if (ia_valid & ATTR_MTIME) | 188 | if (ia_valid & ATTR_MTIME) |
189 | inode->i_mtime = timespec_trunc(attr->ia_mtime, | 189 | inode->i_mtime = timespec64_trunc(attr->ia_mtime, |
190 | inode->i_sb->s_time_gran); | 190 | inode->i_sb->s_time_gran); |
191 | if (ia_valid & ATTR_CTIME) | 191 | if (ia_valid & ATTR_CTIME) |
192 | inode->i_ctime = timespec_trunc(attr->ia_ctime, | 192 | inode->i_ctime = timespec64_trunc(attr->ia_ctime, |
193 | inode->i_sb->s_time_gran); | 193 | inode->i_sb->s_time_gran); |
194 | if (ia_valid & ATTR_MODE) { | 194 | if (ia_valid & ATTR_MODE) { |
195 | umode_t mode = attr->ia_mode; | 195 | umode_t mode = attr->ia_mode; |
196 | 196 | ||
@@ -227,7 +227,7 @@ int notify_change(struct dentry * dentry, struct iattr * attr, struct inode **de | |||
227 | struct inode *inode = dentry->d_inode; | 227 | struct inode *inode = dentry->d_inode; |
228 | umode_t mode = inode->i_mode; | 228 | umode_t mode = inode->i_mode; |
229 | int error; | 229 | int error; |
230 | struct timespec now; | 230 | struct timespec64 now; |
231 | unsigned int ia_valid = attr->ia_valid; | 231 | unsigned int ia_valid = attr->ia_valid; |
232 | 232 | ||
233 | WARN_ON_ONCE(!inode_is_locked(inode)); | 233 | WARN_ON_ONCE(!inode_is_locked(inode)); |
diff --git a/fs/bad_inode.c b/fs/bad_inode.c index 213b51dbbb60..125e8bbd22a2 100644 --- a/fs/bad_inode.c +++ b/fs/bad_inode.c | |||
@@ -126,7 +126,7 @@ static int bad_inode_fiemap(struct inode *inode, | |||
126 | return -EIO; | 126 | return -EIO; |
127 | } | 127 | } |
128 | 128 | ||
129 | static int bad_inode_update_time(struct inode *inode, struct timespec *time, | 129 | static int bad_inode_update_time(struct inode *inode, struct timespec64 *time, |
130 | int flags) | 130 | int flags) |
131 | { | 131 | { |
132 | return -EIO; | 132 | return -EIO; |
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index f660ba1e5e58..51e77d72068a 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -1842,16 +1842,16 @@ out: | |||
1842 | 1842 | ||
1843 | static void update_time_for_write(struct inode *inode) | 1843 | static void update_time_for_write(struct inode *inode) |
1844 | { | 1844 | { |
1845 | struct timespec now; | 1845 | struct timespec64 now; |
1846 | 1846 | ||
1847 | if (IS_NOCMTIME(inode)) | 1847 | if (IS_NOCMTIME(inode)) |
1848 | return; | 1848 | return; |
1849 | 1849 | ||
1850 | now = current_time(inode); | 1850 | now = current_time(inode); |
1851 | if (!timespec_equal(&inode->i_mtime, &now)) | 1851 | if (!timespec64_equal(&inode->i_mtime, &now)) |
1852 | inode->i_mtime = now; | 1852 | inode->i_mtime = now; |
1853 | 1853 | ||
1854 | if (!timespec_equal(&inode->i_ctime, &now)) | 1854 | if (!timespec64_equal(&inode->i_ctime, &now)) |
1855 | inode->i_ctime = now; | 1855 | inode->i_ctime = now; |
1856 | 1856 | ||
1857 | if (IS_I_VERSION(inode)) | 1857 | if (IS_I_VERSION(inode)) |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index c12b7a6e534a..e9482f0db9d0 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -5745,7 +5745,7 @@ static struct inode *new_simple_dir(struct super_block *s, | |||
5745 | inode->i_mtime = current_time(inode); | 5745 | inode->i_mtime = current_time(inode); |
5746 | inode->i_atime = inode->i_mtime; | 5746 | inode->i_atime = inode->i_mtime; |
5747 | inode->i_ctime = inode->i_mtime; | 5747 | inode->i_ctime = inode->i_mtime; |
5748 | BTRFS_I(inode)->i_otime = inode->i_mtime; | 5748 | BTRFS_I(inode)->i_otime = timespec64_to_timespec(inode->i_mtime); |
5749 | 5749 | ||
5750 | return inode; | 5750 | return inode; |
5751 | } | 5751 | } |
@@ -6094,7 +6094,7 @@ static int btrfs_dirty_inode(struct inode *inode) | |||
6094 | * This is a copy of file_update_time. We need this so we can return error on | 6094 | * This is a copy of file_update_time. We need this so we can return error on |
6095 | * ENOSPC for updating the inode in the case of file write and mmap writes. | 6095 | * ENOSPC for updating the inode in the case of file write and mmap writes. |
6096 | */ | 6096 | */ |
6097 | static int btrfs_update_time(struct inode *inode, struct timespec *now, | 6097 | static int btrfs_update_time(struct inode *inode, struct timespec64 *now, |
6098 | int flags) | 6098 | int flags) |
6099 | { | 6099 | { |
6100 | struct btrfs_root *root = BTRFS_I(inode)->root; | 6100 | struct btrfs_root *root = BTRFS_I(inode)->root; |
@@ -6349,7 +6349,7 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans, | |||
6349 | inode->i_mtime = current_time(inode); | 6349 | inode->i_mtime = current_time(inode); |
6350 | inode->i_atime = inode->i_mtime; | 6350 | inode->i_atime = inode->i_mtime; |
6351 | inode->i_ctime = inode->i_mtime; | 6351 | inode->i_ctime = inode->i_mtime; |
6352 | BTRFS_I(inode)->i_otime = inode->i_mtime; | 6352 | BTRFS_I(inode)->i_otime = timespec64_to_timespec(inode->i_mtime); |
6353 | 6353 | ||
6354 | inode_item = btrfs_item_ptr(path->nodes[0], path->slots[0], | 6354 | inode_item = btrfs_item_ptr(path->nodes[0], path->slots[0], |
6355 | struct btrfs_inode_item); | 6355 | struct btrfs_inode_item); |
@@ -9435,7 +9435,7 @@ static int btrfs_rename_exchange(struct inode *old_dir, | |||
9435 | struct btrfs_root *dest = BTRFS_I(new_dir)->root; | 9435 | struct btrfs_root *dest = BTRFS_I(new_dir)->root; |
9436 | struct inode *new_inode = new_dentry->d_inode; | 9436 | struct inode *new_inode = new_dentry->d_inode; |
9437 | struct inode *old_inode = old_dentry->d_inode; | 9437 | struct inode *old_inode = old_dentry->d_inode; |
9438 | struct timespec ctime = current_time(old_inode); | 9438 | struct timespec64 ctime = current_time(old_inode); |
9439 | struct dentry *parent; | 9439 | struct dentry *parent; |
9440 | u64 old_ino = btrfs_ino(BTRFS_I(old_inode)); | 9440 | u64 old_ino = btrfs_ino(BTRFS_I(old_inode)); |
9441 | u64 new_ino = btrfs_ino(BTRFS_I(new_inode)); | 9441 | u64 new_ino = btrfs_ino(BTRFS_I(new_inode)); |
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 5556e9ea2a4b..c2837a32d689 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -562,7 +562,7 @@ static noinline int create_subvol(struct inode *dir, | |||
562 | struct btrfs_root *root = BTRFS_I(dir)->root; | 562 | struct btrfs_root *root = BTRFS_I(dir)->root; |
563 | struct btrfs_root *new_root; | 563 | struct btrfs_root *new_root; |
564 | struct btrfs_block_rsv block_rsv; | 564 | struct btrfs_block_rsv block_rsv; |
565 | struct timespec cur_time = current_time(dir); | 565 | struct timespec64 cur_time = current_time(dir); |
566 | struct inode *inode; | 566 | struct inode *inode; |
567 | int ret; | 567 | int ret; |
568 | int err; | 568 | int err; |
@@ -5395,7 +5395,7 @@ static long _btrfs_ioctl_set_received_subvol(struct file *file, | |||
5395 | struct btrfs_root *root = BTRFS_I(inode)->root; | 5395 | struct btrfs_root *root = BTRFS_I(inode)->root; |
5396 | struct btrfs_root_item *root_item = &root->root_item; | 5396 | struct btrfs_root_item *root_item = &root->root_item; |
5397 | struct btrfs_trans_handle *trans; | 5397 | struct btrfs_trans_handle *trans; |
5398 | struct timespec ct = current_time(inode); | 5398 | struct timespec64 ct = current_time(inode); |
5399 | int ret = 0; | 5399 | int ret = 0; |
5400 | int received_uuid_changed; | 5400 | int received_uuid_changed; |
5401 | 5401 | ||
diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c index 6db3bda44aa5..c451285976ac 100644 --- a/fs/btrfs/root-tree.c +++ b/fs/btrfs/root-tree.c | |||
@@ -485,9 +485,9 @@ void btrfs_update_root_times(struct btrfs_trans_handle *trans, | |||
485 | struct btrfs_root *root) | 485 | struct btrfs_root *root) |
486 | { | 486 | { |
487 | struct btrfs_root_item *item = &root->root_item; | 487 | struct btrfs_root_item *item = &root->root_item; |
488 | struct timespec ct; | 488 | struct timespec64 ct; |
489 | 489 | ||
490 | ktime_get_real_ts(&ct); | 490 | ktime_get_real_ts64(&ct); |
491 | spin_lock(&root->root_item_lock); | 491 | spin_lock(&root->root_item_lock); |
492 | btrfs_set_root_ctransid(item, trans->transid); | 492 | btrfs_set_root_ctransid(item, trans->transid); |
493 | btrfs_set_stack_timespec_sec(&item->ctime, ct.tv_sec); | 493 | btrfs_set_stack_timespec_sec(&item->ctime, ct.tv_sec); |
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 4485eae41e88..ff5f6c719976 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -1422,7 +1422,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, | |||
1422 | struct dentry *dentry; | 1422 | struct dentry *dentry; |
1423 | struct extent_buffer *tmp; | 1423 | struct extent_buffer *tmp; |
1424 | struct extent_buffer *old; | 1424 | struct extent_buffer *old; |
1425 | struct timespec cur_time; | 1425 | struct timespec64 cur_time; |
1426 | int ret = 0; | 1426 | int ret = 0; |
1427 | u64 to_reserve = 0; | 1427 | u64 to_reserve = 0; |
1428 | u64 index = 0; | 1428 | u64 index = 0; |
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index afcc59ed7090..292b3d72d725 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c | |||
@@ -574,6 +574,7 @@ static u64 get_writepages_data_length(struct inode *inode, | |||
574 | */ | 574 | */ |
575 | static int writepage_nounlock(struct page *page, struct writeback_control *wbc) | 575 | static int writepage_nounlock(struct page *page, struct writeback_control *wbc) |
576 | { | 576 | { |
577 | struct timespec ts; | ||
577 | struct inode *inode; | 578 | struct inode *inode; |
578 | struct ceph_inode_info *ci; | 579 | struct ceph_inode_info *ci; |
579 | struct ceph_fs_client *fsc; | 580 | struct ceph_fs_client *fsc; |
@@ -624,11 +625,12 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc) | |||
624 | set_bdi_congested(inode_to_bdi(inode), BLK_RW_ASYNC); | 625 | set_bdi_congested(inode_to_bdi(inode), BLK_RW_ASYNC); |
625 | 626 | ||
626 | set_page_writeback(page); | 627 | set_page_writeback(page); |
628 | ts = timespec64_to_timespec(inode->i_mtime); | ||
627 | err = ceph_osdc_writepages(&fsc->client->osdc, ceph_vino(inode), | 629 | err = ceph_osdc_writepages(&fsc->client->osdc, ceph_vino(inode), |
628 | &ci->i_layout, snapc, page_off, len, | 630 | &ci->i_layout, snapc, page_off, len, |
629 | ceph_wbc.truncate_seq, | 631 | ceph_wbc.truncate_seq, |
630 | ceph_wbc.truncate_size, | 632 | ceph_wbc.truncate_size, |
631 | &inode->i_mtime, &page, 1); | 633 | &ts, &page, 1); |
632 | if (err < 0) { | 634 | if (err < 0) { |
633 | struct writeback_control tmp_wbc; | 635 | struct writeback_control tmp_wbc; |
634 | if (!wbc) | 636 | if (!wbc) |
@@ -1132,7 +1134,7 @@ new_request: | |||
1132 | pages = NULL; | 1134 | pages = NULL; |
1133 | } | 1135 | } |
1134 | 1136 | ||
1135 | req->r_mtime = inode->i_mtime; | 1137 | req->r_mtime = timespec64_to_timespec(inode->i_mtime); |
1136 | rc = ceph_osdc_start_request(&fsc->client->osdc, req, true); | 1138 | rc = ceph_osdc_start_request(&fsc->client->osdc, req, true); |
1137 | BUG_ON(rc); | 1139 | BUG_ON(rc); |
1138 | req = NULL; | 1140 | req = NULL; |
@@ -1732,7 +1734,7 @@ int ceph_uninline_data(struct file *filp, struct page *locked_page) | |||
1732 | goto out; | 1734 | goto out; |
1733 | } | 1735 | } |
1734 | 1736 | ||
1735 | req->r_mtime = inode->i_mtime; | 1737 | req->r_mtime = timespec64_to_timespec(inode->i_mtime); |
1736 | err = ceph_osdc_start_request(&fsc->client->osdc, req, false); | 1738 | err = ceph_osdc_start_request(&fsc->client->osdc, req, false); |
1737 | if (!err) | 1739 | if (!err) |
1738 | err = ceph_osdc_wait_request(&fsc->client->osdc, req); | 1740 | err = ceph_osdc_wait_request(&fsc->client->osdc, req); |
@@ -1774,7 +1776,7 @@ int ceph_uninline_data(struct file *filp, struct page *locked_page) | |||
1774 | goto out_put; | 1776 | goto out_put; |
1775 | } | 1777 | } |
1776 | 1778 | ||
1777 | req->r_mtime = inode->i_mtime; | 1779 | req->r_mtime = timespec64_to_timespec(inode->i_mtime); |
1778 | err = ceph_osdc_start_request(&fsc->client->osdc, req, false); | 1780 | err = ceph_osdc_start_request(&fsc->client->osdc, req, false); |
1779 | if (!err) | 1781 | if (!err) |
1780 | err = ceph_osdc_wait_request(&fsc->client->osdc, req); | 1782 | err = ceph_osdc_wait_request(&fsc->client->osdc, req); |
@@ -1935,7 +1937,7 @@ static int __ceph_pool_perm_get(struct ceph_inode_info *ci, | |||
1935 | 0, false, true); | 1937 | 0, false, true); |
1936 | err = ceph_osdc_start_request(&fsc->client->osdc, rd_req, false); | 1938 | err = ceph_osdc_start_request(&fsc->client->osdc, rd_req, false); |
1937 | 1939 | ||
1938 | wr_req->r_mtime = ci->vfs_inode.i_mtime; | 1940 | wr_req->r_mtime = timespec64_to_timespec(ci->vfs_inode.i_mtime); |
1939 | err2 = ceph_osdc_start_request(&fsc->client->osdc, wr_req, false); | 1941 | err2 = ceph_osdc_start_request(&fsc->client->osdc, wr_req, false); |
1940 | 1942 | ||
1941 | if (!err) | 1943 | if (!err) |
diff --git a/fs/ceph/cache.c b/fs/ceph/cache.c index bb524c880b1e..362900e42424 100644 --- a/fs/ceph/cache.c +++ b/fs/ceph/cache.c | |||
@@ -130,7 +130,7 @@ static enum fscache_checkaux ceph_fscache_inode_check_aux( | |||
130 | 130 | ||
131 | memset(&aux, 0, sizeof(aux)); | 131 | memset(&aux, 0, sizeof(aux)); |
132 | aux.version = ci->i_version; | 132 | aux.version = ci->i_version; |
133 | aux.mtime = inode->i_mtime; | 133 | aux.mtime = timespec64_to_timespec(inode->i_mtime); |
134 | 134 | ||
135 | if (memcmp(data, &aux, sizeof(aux)) != 0) | 135 | if (memcmp(data, &aux, sizeof(aux)) != 0) |
136 | return FSCACHE_CHECKAUX_OBSOLETE; | 136 | return FSCACHE_CHECKAUX_OBSOLETE; |
@@ -163,7 +163,7 @@ void ceph_fscache_register_inode_cookie(struct inode *inode) | |||
163 | if (!ci->fscache) { | 163 | if (!ci->fscache) { |
164 | memset(&aux, 0, sizeof(aux)); | 164 | memset(&aux, 0, sizeof(aux)); |
165 | aux.version = ci->i_version; | 165 | aux.version = ci->i_version; |
166 | aux.mtime = inode->i_mtime; | 166 | aux.mtime = timespec64_to_timespec(inode->i_mtime); |
167 | ci->fscache = fscache_acquire_cookie(fsc->fscache, | 167 | ci->fscache = fscache_acquire_cookie(fsc->fscache, |
168 | &ceph_fscache_inode_object_def, | 168 | &ceph_fscache_inode_object_def, |
169 | &ci->i_vino, sizeof(ci->i_vino), | 169 | &ci->i_vino, sizeof(ci->i_vino), |
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 0ae41854d676..990258cbd836 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c | |||
@@ -1360,9 +1360,9 @@ static int __send_cap(struct ceph_mds_client *mdsc, struct ceph_cap *cap, | |||
1360 | arg.xattr_buf = NULL; | 1360 | arg.xattr_buf = NULL; |
1361 | } | 1361 | } |
1362 | 1362 | ||
1363 | arg.mtime = inode->i_mtime; | 1363 | arg.mtime = timespec64_to_timespec(inode->i_mtime); |
1364 | arg.atime = inode->i_atime; | 1364 | arg.atime = timespec64_to_timespec(inode->i_atime); |
1365 | arg.ctime = inode->i_ctime; | 1365 | arg.ctime = timespec64_to_timespec(inode->i_ctime); |
1366 | 1366 | ||
1367 | arg.op = op; | 1367 | arg.op = op; |
1368 | arg.caps = cap->implemented; | 1368 | arg.caps = cap->implemented; |
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 6b9f7f3cd237..ad0bed99b1d5 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
@@ -923,7 +923,7 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter, | |||
923 | int num_pages = 0; | 923 | int num_pages = 0; |
924 | int flags; | 924 | int flags; |
925 | int ret; | 925 | int ret; |
926 | struct timespec mtime = current_time(inode); | 926 | struct timespec mtime = timespec64_to_timespec(current_time(inode)); |
927 | size_t count = iov_iter_count(iter); | 927 | size_t count = iov_iter_count(iter); |
928 | loff_t pos = iocb->ki_pos; | 928 | loff_t pos = iocb->ki_pos; |
929 | bool write = iov_iter_rw(iter) == WRITE; | 929 | bool write = iov_iter_rw(iter) == WRITE; |
@@ -1131,7 +1131,7 @@ ceph_sync_write(struct kiocb *iocb, struct iov_iter *from, loff_t pos, | |||
1131 | int flags; | 1131 | int flags; |
1132 | int ret; | 1132 | int ret; |
1133 | bool check_caps = false; | 1133 | bool check_caps = false; |
1134 | struct timespec mtime = current_time(inode); | 1134 | struct timespec mtime = timespec64_to_timespec(current_time(inode)); |
1135 | size_t count = iov_iter_count(from); | 1135 | size_t count = iov_iter_count(from); |
1136 | 1136 | ||
1137 | if (ceph_snap(file_inode(file)) != CEPH_NOSNAP) | 1137 | if (ceph_snap(file_inode(file)) != CEPH_NOSNAP) |
@@ -1663,7 +1663,7 @@ static int ceph_zero_partial_object(struct inode *inode, | |||
1663 | goto out; | 1663 | goto out; |
1664 | } | 1664 | } |
1665 | 1665 | ||
1666 | req->r_mtime = inode->i_mtime; | 1666 | req->r_mtime = timespec64_to_timespec(inode->i_mtime); |
1667 | ret = ceph_osdc_start_request(&fsc->client->osdc, req, false); | 1667 | ret = ceph_osdc_start_request(&fsc->client->osdc, req, false); |
1668 | if (!ret) { | 1668 | if (!ret) { |
1669 | ret = ceph_osdc_wait_request(&fsc->client->osdc, req); | 1669 | ret = ceph_osdc_wait_request(&fsc->client->osdc, req); |
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 4fda7a9d4c9d..ee764ac352ab 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c | |||
@@ -662,6 +662,9 @@ void ceph_fill_file_time(struct inode *inode, int issued, | |||
662 | struct timespec *mtime, struct timespec *atime) | 662 | struct timespec *mtime, struct timespec *atime) |
663 | { | 663 | { |
664 | struct ceph_inode_info *ci = ceph_inode(inode); | 664 | struct ceph_inode_info *ci = ceph_inode(inode); |
665 | struct timespec64 ctime64 = timespec_to_timespec64(*ctime); | ||
666 | struct timespec64 mtime64 = timespec_to_timespec64(*mtime); | ||
667 | struct timespec64 atime64 = timespec_to_timespec64(*atime); | ||
665 | int warn = 0; | 668 | int warn = 0; |
666 | 669 | ||
667 | if (issued & (CEPH_CAP_FILE_EXCL| | 670 | if (issued & (CEPH_CAP_FILE_EXCL| |
@@ -670,39 +673,39 @@ void ceph_fill_file_time(struct inode *inode, int issued, | |||
670 | CEPH_CAP_AUTH_EXCL| | 673 | CEPH_CAP_AUTH_EXCL| |
671 | CEPH_CAP_XATTR_EXCL)) { | 674 | CEPH_CAP_XATTR_EXCL)) { |
672 | if (ci->i_version == 0 || | 675 | if (ci->i_version == 0 || |
673 | timespec_compare(ctime, &inode->i_ctime) > 0) { | 676 | timespec64_compare(&ctime64, &inode->i_ctime) > 0) { |
674 | dout("ctime %ld.%09ld -> %ld.%09ld inc w/ cap\n", | 677 | dout("ctime %lld.%09ld -> %lld.%09ld inc w/ cap\n", |
675 | inode->i_ctime.tv_sec, inode->i_ctime.tv_nsec, | 678 | (long long)inode->i_ctime.tv_sec, inode->i_ctime.tv_nsec, |
676 | ctime->tv_sec, ctime->tv_nsec); | 679 | (long long)ctime->tv_sec, ctime->tv_nsec); |
677 | inode->i_ctime = *ctime; | 680 | inode->i_ctime = ctime64; |
678 | } | 681 | } |
679 | if (ci->i_version == 0 || | 682 | if (ci->i_version == 0 || |
680 | ceph_seq_cmp(time_warp_seq, ci->i_time_warp_seq) > 0) { | 683 | ceph_seq_cmp(time_warp_seq, ci->i_time_warp_seq) > 0) { |
681 | /* the MDS did a utimes() */ | 684 | /* the MDS did a utimes() */ |
682 | dout("mtime %ld.%09ld -> %ld.%09ld " | 685 | dout("mtime %lld.%09ld -> %lld.%09ld " |
683 | "tw %d -> %d\n", | 686 | "tw %d -> %d\n", |
684 | inode->i_mtime.tv_sec, inode->i_mtime.tv_nsec, | 687 | (long long)inode->i_mtime.tv_sec, inode->i_mtime.tv_nsec, |
685 | mtime->tv_sec, mtime->tv_nsec, | 688 | (long long)mtime->tv_sec, mtime->tv_nsec, |
686 | ci->i_time_warp_seq, (int)time_warp_seq); | 689 | ci->i_time_warp_seq, (int)time_warp_seq); |
687 | 690 | ||
688 | inode->i_mtime = *mtime; | 691 | inode->i_mtime = mtime64; |
689 | inode->i_atime = *atime; | 692 | inode->i_atime = atime64; |
690 | ci->i_time_warp_seq = time_warp_seq; | 693 | ci->i_time_warp_seq = time_warp_seq; |
691 | } else if (time_warp_seq == ci->i_time_warp_seq) { | 694 | } else if (time_warp_seq == ci->i_time_warp_seq) { |
692 | /* nobody did utimes(); take the max */ | 695 | /* nobody did utimes(); take the max */ |
693 | if (timespec_compare(mtime, &inode->i_mtime) > 0) { | 696 | if (timespec64_compare(&mtime64, &inode->i_mtime) > 0) { |
694 | dout("mtime %ld.%09ld -> %ld.%09ld inc\n", | 697 | dout("mtime %lld.%09ld -> %lld.%09ld inc\n", |
695 | inode->i_mtime.tv_sec, | 698 | (long long)inode->i_mtime.tv_sec, |
696 | inode->i_mtime.tv_nsec, | 699 | inode->i_mtime.tv_nsec, |
697 | mtime->tv_sec, mtime->tv_nsec); | 700 | (long long)mtime->tv_sec, mtime->tv_nsec); |
698 | inode->i_mtime = *mtime; | 701 | inode->i_mtime = mtime64; |
699 | } | 702 | } |
700 | if (timespec_compare(atime, &inode->i_atime) > 0) { | 703 | if (timespec64_compare(&atime64, &inode->i_atime) > 0) { |
701 | dout("atime %ld.%09ld -> %ld.%09ld inc\n", | 704 | dout("atime %lld.%09ld -> %lld.%09ld inc\n", |
702 | inode->i_atime.tv_sec, | 705 | (long long)inode->i_atime.tv_sec, |
703 | inode->i_atime.tv_nsec, | 706 | inode->i_atime.tv_nsec, |
704 | atime->tv_sec, atime->tv_nsec); | 707 | (long long)atime->tv_sec, atime->tv_nsec); |
705 | inode->i_atime = *atime; | 708 | inode->i_atime = atime64; |
706 | } | 709 | } |
707 | } else if (issued & CEPH_CAP_FILE_EXCL) { | 710 | } else if (issued & CEPH_CAP_FILE_EXCL) { |
708 | /* we did a utimes(); ignore mds values */ | 711 | /* we did a utimes(); ignore mds values */ |
@@ -712,9 +715,9 @@ void ceph_fill_file_time(struct inode *inode, int issued, | |||
712 | } else { | 715 | } else { |
713 | /* we have no write|excl caps; whatever the MDS says is true */ | 716 | /* we have no write|excl caps; whatever the MDS says is true */ |
714 | if (ceph_seq_cmp(time_warp_seq, ci->i_time_warp_seq) >= 0) { | 717 | if (ceph_seq_cmp(time_warp_seq, ci->i_time_warp_seq) >= 0) { |
715 | inode->i_ctime = *ctime; | 718 | inode->i_ctime = ctime64; |
716 | inode->i_mtime = *mtime; | 719 | inode->i_mtime = mtime64; |
717 | inode->i_atime = *atime; | 720 | inode->i_atime = atime64; |
718 | ci->i_time_warp_seq = time_warp_seq; | 721 | ci->i_time_warp_seq = time_warp_seq; |
719 | } else { | 722 | } else { |
720 | warn = 1; | 723 | warn = 1; |
@@ -1950,6 +1953,7 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr) | |||
1950 | int err = 0; | 1953 | int err = 0; |
1951 | int inode_dirty_flags = 0; | 1954 | int inode_dirty_flags = 0; |
1952 | bool lock_snap_rwsem = false; | 1955 | bool lock_snap_rwsem = false; |
1956 | struct timespec ts; | ||
1953 | 1957 | ||
1954 | prealloc_cf = ceph_alloc_cap_flush(); | 1958 | prealloc_cf = ceph_alloc_cap_flush(); |
1955 | if (!prealloc_cf) | 1959 | if (!prealloc_cf) |
@@ -2024,44 +2028,44 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr) | |||
2024 | } | 2028 | } |
2025 | 2029 | ||
2026 | if (ia_valid & ATTR_ATIME) { | 2030 | if (ia_valid & ATTR_ATIME) { |
2027 | dout("setattr %p atime %ld.%ld -> %ld.%ld\n", inode, | 2031 | dout("setattr %p atime %lld.%ld -> %lld.%ld\n", inode, |
2028 | inode->i_atime.tv_sec, inode->i_atime.tv_nsec, | 2032 | (long long)inode->i_atime.tv_sec, inode->i_atime.tv_nsec, |
2029 | attr->ia_atime.tv_sec, attr->ia_atime.tv_nsec); | 2033 | (long long)attr->ia_atime.tv_sec, attr->ia_atime.tv_nsec); |
2030 | if (issued & CEPH_CAP_FILE_EXCL) { | 2034 | if (issued & CEPH_CAP_FILE_EXCL) { |
2031 | ci->i_time_warp_seq++; | 2035 | ci->i_time_warp_seq++; |
2032 | inode->i_atime = attr->ia_atime; | 2036 | inode->i_atime = attr->ia_atime; |
2033 | dirtied |= CEPH_CAP_FILE_EXCL; | 2037 | dirtied |= CEPH_CAP_FILE_EXCL; |
2034 | } else if ((issued & CEPH_CAP_FILE_WR) && | 2038 | } else if ((issued & CEPH_CAP_FILE_WR) && |
2035 | timespec_compare(&inode->i_atime, | 2039 | timespec64_compare(&inode->i_atime, |
2036 | &attr->ia_atime) < 0) { | 2040 | &attr->ia_atime) < 0) { |
2037 | inode->i_atime = attr->ia_atime; | 2041 | inode->i_atime = attr->ia_atime; |
2038 | dirtied |= CEPH_CAP_FILE_WR; | 2042 | dirtied |= CEPH_CAP_FILE_WR; |
2039 | } else if ((issued & CEPH_CAP_FILE_SHARED) == 0 || | 2043 | } else if ((issued & CEPH_CAP_FILE_SHARED) == 0 || |
2040 | !timespec_equal(&inode->i_atime, &attr->ia_atime)) { | 2044 | !timespec64_equal(&inode->i_atime, &attr->ia_atime)) { |
2041 | ceph_encode_timespec(&req->r_args.setattr.atime, | 2045 | ts = timespec64_to_timespec(attr->ia_atime); |
2042 | &attr->ia_atime); | 2046 | ceph_encode_timespec(&req->r_args.setattr.atime, &ts); |
2043 | mask |= CEPH_SETATTR_ATIME; | 2047 | mask |= CEPH_SETATTR_ATIME; |
2044 | release |= CEPH_CAP_FILE_SHARED | | 2048 | release |= CEPH_CAP_FILE_SHARED | |
2045 | CEPH_CAP_FILE_RD | CEPH_CAP_FILE_WR; | 2049 | CEPH_CAP_FILE_RD | CEPH_CAP_FILE_WR; |
2046 | } | 2050 | } |
2047 | } | 2051 | } |
2048 | if (ia_valid & ATTR_MTIME) { | 2052 | if (ia_valid & ATTR_MTIME) { |
2049 | dout("setattr %p mtime %ld.%ld -> %ld.%ld\n", inode, | 2053 | dout("setattr %p mtime %lld.%ld -> %lld.%ld\n", inode, |
2050 | inode->i_mtime.tv_sec, inode->i_mtime.tv_nsec, | 2054 | (long long)inode->i_mtime.tv_sec, inode->i_mtime.tv_nsec, |
2051 | attr->ia_mtime.tv_sec, attr->ia_mtime.tv_nsec); | 2055 | (long long)attr->ia_mtime.tv_sec, attr->ia_mtime.tv_nsec); |
2052 | if (issued & CEPH_CAP_FILE_EXCL) { | 2056 | if (issued & CEPH_CAP_FILE_EXCL) { |
2053 | ci->i_time_warp_seq++; | 2057 | ci->i_time_warp_seq++; |
2054 | inode->i_mtime = attr->ia_mtime; | 2058 | inode->i_mtime = attr->ia_mtime; |
2055 | dirtied |= CEPH_CAP_FILE_EXCL; | 2059 | dirtied |= CEPH_CAP_FILE_EXCL; |
2056 | } else if ((issued & CEPH_CAP_FILE_WR) && | 2060 | } else if ((issued & CEPH_CAP_FILE_WR) && |
2057 | timespec_compare(&inode->i_mtime, | 2061 | timespec64_compare(&inode->i_mtime, |
2058 | &attr->ia_mtime) < 0) { | 2062 | &attr->ia_mtime) < 0) { |
2059 | inode->i_mtime = attr->ia_mtime; | 2063 | inode->i_mtime = attr->ia_mtime; |
2060 | dirtied |= CEPH_CAP_FILE_WR; | 2064 | dirtied |= CEPH_CAP_FILE_WR; |
2061 | } else if ((issued & CEPH_CAP_FILE_SHARED) == 0 || | 2065 | } else if ((issued & CEPH_CAP_FILE_SHARED) == 0 || |
2062 | !timespec_equal(&inode->i_mtime, &attr->ia_mtime)) { | 2066 | !timespec64_equal(&inode->i_mtime, &attr->ia_mtime)) { |
2063 | ceph_encode_timespec(&req->r_args.setattr.mtime, | 2067 | ts = timespec64_to_timespec(attr->ia_mtime); |
2064 | &attr->ia_mtime); | 2068 | ceph_encode_timespec(&req->r_args.setattr.mtime, &ts); |
2065 | mask |= CEPH_SETATTR_MTIME; | 2069 | mask |= CEPH_SETATTR_MTIME; |
2066 | release |= CEPH_CAP_FILE_SHARED | | 2070 | release |= CEPH_CAP_FILE_SHARED | |
2067 | CEPH_CAP_FILE_RD | CEPH_CAP_FILE_WR; | 2071 | CEPH_CAP_FILE_RD | CEPH_CAP_FILE_WR; |
@@ -2091,9 +2095,9 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr) | |||
2091 | if (ia_valid & ATTR_CTIME) { | 2095 | if (ia_valid & ATTR_CTIME) { |
2092 | bool only = (ia_valid & (ATTR_SIZE|ATTR_MTIME|ATTR_ATIME| | 2096 | bool only = (ia_valid & (ATTR_SIZE|ATTR_MTIME|ATTR_ATIME| |
2093 | ATTR_MODE|ATTR_UID|ATTR_GID)) == 0; | 2097 | ATTR_MODE|ATTR_UID|ATTR_GID)) == 0; |
2094 | dout("setattr %p ctime %ld.%ld -> %ld.%ld (%s)\n", inode, | 2098 | dout("setattr %p ctime %lld.%ld -> %lld.%ld (%s)\n", inode, |
2095 | inode->i_ctime.tv_sec, inode->i_ctime.tv_nsec, | 2099 | (long long)inode->i_ctime.tv_sec, inode->i_ctime.tv_nsec, |
2096 | attr->ia_ctime.tv_sec, attr->ia_ctime.tv_nsec, | 2100 | (long long)attr->ia_ctime.tv_sec, attr->ia_ctime.tv_nsec, |
2097 | only ? "ctime only" : "ignored"); | 2101 | only ? "ctime only" : "ignored"); |
2098 | if (only) { | 2102 | if (only) { |
2099 | /* | 2103 | /* |
@@ -2135,7 +2139,7 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr) | |||
2135 | req->r_inode_drop = release; | 2139 | req->r_inode_drop = release; |
2136 | req->r_args.setattr.mask = cpu_to_le32(mask); | 2140 | req->r_args.setattr.mask = cpu_to_le32(mask); |
2137 | req->r_num_caps = 1; | 2141 | req->r_num_caps = 1; |
2138 | req->r_stamp = attr->ia_ctime; | 2142 | req->r_stamp = timespec64_to_timespec(attr->ia_ctime); |
2139 | err = ceph_mdsc_do_request(mdsc, NULL, req); | 2143 | err = ceph_mdsc_do_request(mdsc, NULL, req); |
2140 | } | 2144 | } |
2141 | dout("setattr %p result=%d (%s locally, %d remote)\n", inode, err, | 2145 | dout("setattr %p result=%d (%s locally, %d remote)\n", inode, err, |
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index cf8d24812cc0..dc8bc664a871 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c | |||
@@ -2958,12 +2958,15 @@ static int encode_caps_cb(struct inode *inode, struct ceph_cap *cap, | |||
2958 | rec.v2.flock_len = (__force __le32) | 2958 | rec.v2.flock_len = (__force __le32) |
2959 | ((ci->i_ceph_flags & CEPH_I_ERROR_FILELOCK) ? 0 : 1); | 2959 | ((ci->i_ceph_flags & CEPH_I_ERROR_FILELOCK) ? 0 : 1); |
2960 | } else { | 2960 | } else { |
2961 | struct timespec ts; | ||
2961 | rec.v1.cap_id = cpu_to_le64(cap->cap_id); | 2962 | rec.v1.cap_id = cpu_to_le64(cap->cap_id); |
2962 | rec.v1.wanted = cpu_to_le32(__ceph_caps_wanted(ci)); | 2963 | rec.v1.wanted = cpu_to_le32(__ceph_caps_wanted(ci)); |
2963 | rec.v1.issued = cpu_to_le32(cap->issued); | 2964 | rec.v1.issued = cpu_to_le32(cap->issued); |
2964 | rec.v1.size = cpu_to_le64(inode->i_size); | 2965 | rec.v1.size = cpu_to_le64(inode->i_size); |
2965 | ceph_encode_timespec(&rec.v1.mtime, &inode->i_mtime); | 2966 | ts = timespec64_to_timespec(inode->i_mtime); |
2966 | ceph_encode_timespec(&rec.v1.atime, &inode->i_atime); | 2967 | ceph_encode_timespec(&rec.v1.mtime, &ts); |
2968 | ts = timespec64_to_timespec(inode->i_atime); | ||
2969 | ceph_encode_timespec(&rec.v1.atime, &ts); | ||
2967 | rec.v1.snaprealm = cpu_to_le64(ci->i_snap_realm->ino); | 2970 | rec.v1.snaprealm = cpu_to_le64(ci->i_snap_realm->ino); |
2968 | rec.v1.pathbase = cpu_to_le64(pathbase); | 2971 | rec.v1.pathbase = cpu_to_le64(pathbase); |
2969 | } | 2972 | } |
diff --git a/fs/ceph/snap.c b/fs/ceph/snap.c index 041c27ea8de1..af81555c14fd 100644 --- a/fs/ceph/snap.c +++ b/fs/ceph/snap.c | |||
@@ -594,9 +594,9 @@ int __ceph_finish_cap_snap(struct ceph_inode_info *ci, | |||
594 | 594 | ||
595 | BUG_ON(capsnap->writing); | 595 | BUG_ON(capsnap->writing); |
596 | capsnap->size = inode->i_size; | 596 | capsnap->size = inode->i_size; |
597 | capsnap->mtime = inode->i_mtime; | 597 | capsnap->mtime = timespec64_to_timespec(inode->i_mtime); |
598 | capsnap->atime = inode->i_atime; | 598 | capsnap->atime = timespec64_to_timespec(inode->i_atime); |
599 | capsnap->ctime = inode->i_ctime; | 599 | capsnap->ctime = timespec64_to_timespec(inode->i_ctime); |
600 | capsnap->time_warp_seq = ci->i_time_warp_seq; | 600 | capsnap->time_warp_seq = ci->i_time_warp_seq; |
601 | capsnap->truncate_size = ci->i_truncate_size; | 601 | capsnap->truncate_size = ci->i_truncate_size; |
602 | capsnap->truncate_seq = ci->i_truncate_seq; | 602 | capsnap->truncate_seq = ci->i_truncate_seq; |
diff --git a/fs/cifs/cache.c b/fs/cifs/cache.c index edf5f40898bf..e1553d1e0e50 100644 --- a/fs/cifs/cache.c +++ b/fs/cifs/cache.c | |||
@@ -128,8 +128,8 @@ fscache_checkaux cifs_fscache_inode_check_aux(void *cookie_netfs_data, | |||
128 | 128 | ||
129 | memset(&auxdata, 0, sizeof(auxdata)); | 129 | memset(&auxdata, 0, sizeof(auxdata)); |
130 | auxdata.eof = cifsi->server_eof; | 130 | auxdata.eof = cifsi->server_eof; |
131 | auxdata.last_write_time = cifsi->vfs_inode.i_mtime; | 131 | auxdata.last_write_time = timespec64_to_timespec(cifsi->vfs_inode.i_mtime); |
132 | auxdata.last_change_time = cifsi->vfs_inode.i_ctime; | 132 | auxdata.last_change_time = timespec64_to_timespec(cifsi->vfs_inode.i_ctime); |
133 | 133 | ||
134 | if (memcmp(data, &auxdata, datalen) != 0) | 134 | if (memcmp(data, &auxdata, datalen) != 0) |
135 | return FSCACHE_CHECKAUX_OBSOLETE; | 135 | return FSCACHE_CHECKAUX_OBSOLETE; |
diff --git a/fs/cifs/fscache.c b/fs/cifs/fscache.c index 25d3f66b2d50..85145a763021 100644 --- a/fs/cifs/fscache.c +++ b/fs/cifs/fscache.c | |||
@@ -129,8 +129,8 @@ static void cifs_fscache_acquire_inode_cookie(struct cifsInodeInfo *cifsi, | |||
129 | 129 | ||
130 | memset(&auxdata, 0, sizeof(auxdata)); | 130 | memset(&auxdata, 0, sizeof(auxdata)); |
131 | auxdata.eof = cifsi->server_eof; | 131 | auxdata.eof = cifsi->server_eof; |
132 | auxdata.last_write_time = cifsi->vfs_inode.i_mtime; | 132 | auxdata.last_write_time = timespec64_to_timespec(cifsi->vfs_inode.i_mtime); |
133 | auxdata.last_change_time = cifsi->vfs_inode.i_ctime; | 133 | auxdata.last_change_time = timespec64_to_timespec(cifsi->vfs_inode.i_ctime); |
134 | 134 | ||
135 | cifsi->fscache = | 135 | cifsi->fscache = |
136 | fscache_acquire_cookie(tcon->fscache, | 136 | fscache_acquire_cookie(tcon->fscache, |
@@ -166,8 +166,8 @@ void cifs_fscache_release_inode_cookie(struct inode *inode) | |||
166 | if (cifsi->fscache) { | 166 | if (cifsi->fscache) { |
167 | memset(&auxdata, 0, sizeof(auxdata)); | 167 | memset(&auxdata, 0, sizeof(auxdata)); |
168 | auxdata.eof = cifsi->server_eof; | 168 | auxdata.eof = cifsi->server_eof; |
169 | auxdata.last_write_time = cifsi->vfs_inode.i_mtime; | 169 | auxdata.last_write_time = timespec64_to_timespec(cifsi->vfs_inode.i_mtime); |
170 | auxdata.last_change_time = cifsi->vfs_inode.i_ctime; | 170 | auxdata.last_change_time = timespec64_to_timespec(cifsi->vfs_inode.i_ctime); |
171 | 171 | ||
172 | cifs_dbg(FYI, "%s: (0x%p)\n", __func__, cifsi->fscache); | 172 | cifs_dbg(FYI, "%s: (0x%p)\n", __func__, cifsi->fscache); |
173 | fscache_relinquish_cookie(cifsi->fscache, &auxdata, false); | 173 | fscache_relinquish_cookie(cifsi->fscache, &auxdata, false); |
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index a94071c7b408..f4697f548a39 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -95,6 +95,7 @@ static void | |||
95 | cifs_revalidate_cache(struct inode *inode, struct cifs_fattr *fattr) | 95 | cifs_revalidate_cache(struct inode *inode, struct cifs_fattr *fattr) |
96 | { | 96 | { |
97 | struct cifsInodeInfo *cifs_i = CIFS_I(inode); | 97 | struct cifsInodeInfo *cifs_i = CIFS_I(inode); |
98 | struct timespec ts; | ||
98 | 99 | ||
99 | cifs_dbg(FYI, "%s: revalidating inode %llu\n", | 100 | cifs_dbg(FYI, "%s: revalidating inode %llu\n", |
100 | __func__, cifs_i->uniqueid); | 101 | __func__, cifs_i->uniqueid); |
@@ -113,7 +114,8 @@ cifs_revalidate_cache(struct inode *inode, struct cifs_fattr *fattr) | |||
113 | } | 114 | } |
114 | 115 | ||
115 | /* revalidate if mtime or size have changed */ | 116 | /* revalidate if mtime or size have changed */ |
116 | if (timespec_equal(&inode->i_mtime, &fattr->cf_mtime) && | 117 | ts = timespec64_to_timespec(inode->i_mtime); |
118 | if (timespec_equal(&ts, &fattr->cf_mtime) && | ||
117 | cifs_i->server_eof == fattr->cf_eof) { | 119 | cifs_i->server_eof == fattr->cf_eof) { |
118 | cifs_dbg(FYI, "%s: inode %llu is unchanged\n", | 120 | cifs_dbg(FYI, "%s: inode %llu is unchanged\n", |
119 | __func__, cifs_i->uniqueid); | 121 | __func__, cifs_i->uniqueid); |
@@ -162,9 +164,9 @@ cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr) | |||
162 | cifs_revalidate_cache(inode, fattr); | 164 | cifs_revalidate_cache(inode, fattr); |
163 | 165 | ||
164 | spin_lock(&inode->i_lock); | 166 | spin_lock(&inode->i_lock); |
165 | inode->i_atime = fattr->cf_atime; | 167 | inode->i_atime = timespec_to_timespec64(fattr->cf_atime); |
166 | inode->i_mtime = fattr->cf_mtime; | 168 | inode->i_mtime = timespec_to_timespec64(fattr->cf_mtime); |
167 | inode->i_ctime = fattr->cf_ctime; | 169 | inode->i_ctime = timespec_to_timespec64(fattr->cf_ctime); |
168 | inode->i_rdev = fattr->cf_rdev; | 170 | inode->i_rdev = fattr->cf_rdev; |
169 | cifs_nlink_fattr_to_inode(inode, fattr); | 171 | cifs_nlink_fattr_to_inode(inode, fattr); |
170 | inode->i_uid = fattr->cf_uid; | 172 | inode->i_uid = fattr->cf_uid; |
@@ -1123,14 +1125,14 @@ cifs_set_file_info(struct inode *inode, struct iattr *attrs, unsigned int xid, | |||
1123 | if (attrs->ia_valid & ATTR_ATIME) { | 1125 | if (attrs->ia_valid & ATTR_ATIME) { |
1124 | set_time = true; | 1126 | set_time = true; |
1125 | info_buf.LastAccessTime = | 1127 | info_buf.LastAccessTime = |
1126 | cpu_to_le64(cifs_UnixTimeToNT(attrs->ia_atime)); | 1128 | cpu_to_le64(cifs_UnixTimeToNT(timespec64_to_timespec(attrs->ia_atime))); |
1127 | } else | 1129 | } else |
1128 | info_buf.LastAccessTime = 0; | 1130 | info_buf.LastAccessTime = 0; |
1129 | 1131 | ||
1130 | if (attrs->ia_valid & ATTR_MTIME) { | 1132 | if (attrs->ia_valid & ATTR_MTIME) { |
1131 | set_time = true; | 1133 | set_time = true; |
1132 | info_buf.LastWriteTime = | 1134 | info_buf.LastWriteTime = |
1133 | cpu_to_le64(cifs_UnixTimeToNT(attrs->ia_mtime)); | 1135 | cpu_to_le64(cifs_UnixTimeToNT(timespec64_to_timespec(attrs->ia_mtime))); |
1134 | } else | 1136 | } else |
1135 | info_buf.LastWriteTime = 0; | 1137 | info_buf.LastWriteTime = 0; |
1136 | 1138 | ||
@@ -1143,7 +1145,7 @@ cifs_set_file_info(struct inode *inode, struct iattr *attrs, unsigned int xid, | |||
1143 | if (set_time && (attrs->ia_valid & ATTR_CTIME)) { | 1145 | if (set_time && (attrs->ia_valid & ATTR_CTIME)) { |
1144 | cifs_dbg(FYI, "CIFS - CTIME changed\n"); | 1146 | cifs_dbg(FYI, "CIFS - CTIME changed\n"); |
1145 | info_buf.ChangeTime = | 1147 | info_buf.ChangeTime = |
1146 | cpu_to_le64(cifs_UnixTimeToNT(attrs->ia_ctime)); | 1148 | cpu_to_le64(cifs_UnixTimeToNT(timespec64_to_timespec(attrs->ia_ctime))); |
1147 | } else | 1149 | } else |
1148 | info_buf.ChangeTime = 0; | 1150 | info_buf.ChangeTime = 0; |
1149 | 1151 | ||
@@ -2060,8 +2062,8 @@ int cifs_getattr(const struct path *path, struct kstat *stat, | |||
2060 | /* old CIFS Unix Extensions doesn't return create time */ | 2062 | /* old CIFS Unix Extensions doesn't return create time */ |
2061 | if (CIFS_I(inode)->createtime) { | 2063 | if (CIFS_I(inode)->createtime) { |
2062 | stat->result_mask |= STATX_BTIME; | 2064 | stat->result_mask |= STATX_BTIME; |
2063 | stat->btime = | 2065 | stat->btime = timespec_to_timespec64( |
2064 | cifs_NTtimeToUnix(cpu_to_le64(CIFS_I(inode)->createtime)); | 2066 | cifs_NTtimeToUnix(cpu_to_le64(CIFS_I(inode)->createtime))); |
2065 | } | 2067 | } |
2066 | 2068 | ||
2067 | stat->attributes_mask |= (STATX_ATTR_COMPRESSED | STATX_ATTR_ENCRYPTED); | 2069 | stat->attributes_mask |= (STATX_ATTR_COMPRESSED | STATX_ATTR_ENCRYPTED); |
@@ -2267,17 +2269,17 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs) | |||
2267 | args->gid = INVALID_GID; /* no change */ | 2269 | args->gid = INVALID_GID; /* no change */ |
2268 | 2270 | ||
2269 | if (attrs->ia_valid & ATTR_ATIME) | 2271 | if (attrs->ia_valid & ATTR_ATIME) |
2270 | args->atime = cifs_UnixTimeToNT(attrs->ia_atime); | 2272 | args->atime = cifs_UnixTimeToNT(timespec64_to_timespec(attrs->ia_atime)); |
2271 | else | 2273 | else |
2272 | args->atime = NO_CHANGE_64; | 2274 | args->atime = NO_CHANGE_64; |
2273 | 2275 | ||
2274 | if (attrs->ia_valid & ATTR_MTIME) | 2276 | if (attrs->ia_valid & ATTR_MTIME) |
2275 | args->mtime = cifs_UnixTimeToNT(attrs->ia_mtime); | 2277 | args->mtime = cifs_UnixTimeToNT(timespec64_to_timespec(attrs->ia_mtime)); |
2276 | else | 2278 | else |
2277 | args->mtime = NO_CHANGE_64; | 2279 | args->mtime = NO_CHANGE_64; |
2278 | 2280 | ||
2279 | if (attrs->ia_valid & ATTR_CTIME) | 2281 | if (attrs->ia_valid & ATTR_CTIME) |
2280 | args->ctime = cifs_UnixTimeToNT(attrs->ia_ctime); | 2282 | args->ctime = cifs_UnixTimeToNT(timespec64_to_timespec(attrs->ia_ctime)); |
2281 | else | 2283 | else |
2282 | args->ctime = NO_CHANGE_64; | 2284 | args->ctime = NO_CHANGE_64; |
2283 | 2285 | ||
diff --git a/fs/coda/coda_linux.c b/fs/coda/coda_linux.c index ca599df0dcb1..f3d543dd9a98 100644 --- a/fs/coda/coda_linux.c +++ b/fs/coda/coda_linux.c | |||
@@ -105,11 +105,11 @@ void coda_vattr_to_iattr(struct inode *inode, struct coda_vattr *attr) | |||
105 | if (attr->va_size != -1) | 105 | if (attr->va_size != -1) |
106 | inode->i_blocks = (attr->va_size + 511) >> 9; | 106 | inode->i_blocks = (attr->va_size + 511) >> 9; |
107 | if (attr->va_atime.tv_sec != -1) | 107 | if (attr->va_atime.tv_sec != -1) |
108 | inode->i_atime = attr->va_atime; | 108 | inode->i_atime = timespec_to_timespec64(attr->va_atime); |
109 | if (attr->va_mtime.tv_sec != -1) | 109 | if (attr->va_mtime.tv_sec != -1) |
110 | inode->i_mtime = attr->va_mtime; | 110 | inode->i_mtime = timespec_to_timespec64(attr->va_mtime); |
111 | if (attr->va_ctime.tv_sec != -1) | 111 | if (attr->va_ctime.tv_sec != -1) |
112 | inode->i_ctime = attr->va_ctime; | 112 | inode->i_ctime = timespec_to_timespec64(attr->va_ctime); |
113 | } | 113 | } |
114 | 114 | ||
115 | 115 | ||
@@ -175,13 +175,13 @@ void coda_iattr_to_vattr(struct iattr *iattr, struct coda_vattr *vattr) | |||
175 | vattr->va_size = iattr->ia_size; | 175 | vattr->va_size = iattr->ia_size; |
176 | } | 176 | } |
177 | if ( valid & ATTR_ATIME ) { | 177 | if ( valid & ATTR_ATIME ) { |
178 | vattr->va_atime = iattr->ia_atime; | 178 | vattr->va_atime = timespec64_to_timespec(iattr->ia_atime); |
179 | } | 179 | } |
180 | if ( valid & ATTR_MTIME ) { | 180 | if ( valid & ATTR_MTIME ) { |
181 | vattr->va_mtime = iattr->ia_mtime; | 181 | vattr->va_mtime = timespec64_to_timespec(iattr->ia_mtime); |
182 | } | 182 | } |
183 | if ( valid & ATTR_CTIME ) { | 183 | if ( valid & ATTR_CTIME ) { |
184 | vattr->va_ctime = iattr->ia_ctime; | 184 | vattr->va_ctime = timespec64_to_timespec(iattr->ia_ctime); |
185 | } | 185 | } |
186 | } | 186 | } |
187 | 187 | ||
diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c index ad718e5e37bb..28ef9e528853 100644 --- a/fs/configfs/inode.c +++ b/fs/configfs/inode.c | |||
@@ -90,14 +90,14 @@ int configfs_setattr(struct dentry * dentry, struct iattr * iattr) | |||
90 | if (ia_valid & ATTR_GID) | 90 | if (ia_valid & ATTR_GID) |
91 | sd_iattr->ia_gid = iattr->ia_gid; | 91 | sd_iattr->ia_gid = iattr->ia_gid; |
92 | if (ia_valid & ATTR_ATIME) | 92 | if (ia_valid & ATTR_ATIME) |
93 | sd_iattr->ia_atime = timespec_trunc(iattr->ia_atime, | 93 | sd_iattr->ia_atime = timespec64_trunc(iattr->ia_atime, |
94 | inode->i_sb->s_time_gran); | 94 | inode->i_sb->s_time_gran); |
95 | if (ia_valid & ATTR_MTIME) | 95 | if (ia_valid & ATTR_MTIME) |
96 | sd_iattr->ia_mtime = timespec_trunc(iattr->ia_mtime, | 96 | sd_iattr->ia_mtime = timespec64_trunc(iattr->ia_mtime, |
97 | inode->i_sb->s_time_gran); | 97 | inode->i_sb->s_time_gran); |
98 | if (ia_valid & ATTR_CTIME) | 98 | if (ia_valid & ATTR_CTIME) |
99 | sd_iattr->ia_ctime = timespec_trunc(iattr->ia_ctime, | 99 | sd_iattr->ia_ctime = timespec64_trunc(iattr->ia_ctime, |
100 | inode->i_sb->s_time_gran); | 100 | inode->i_sb->s_time_gran); |
101 | if (ia_valid & ATTR_MODE) { | 101 | if (ia_valid & ATTR_MODE) { |
102 | umode_t mode = iattr->ia_mode; | 102 | umode_t mode = iattr->ia_mode; |
103 | 103 | ||
diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c index c4fb9ad7c808..f408994fc632 100644 --- a/fs/cramfs/inode.c +++ b/fs/cramfs/inode.c | |||
@@ -90,7 +90,7 @@ static struct inode *get_cramfs_inode(struct super_block *sb, | |||
90 | const struct cramfs_inode *cramfs_inode, unsigned int offset) | 90 | const struct cramfs_inode *cramfs_inode, unsigned int offset) |
91 | { | 91 | { |
92 | struct inode *inode; | 92 | struct inode *inode; |
93 | static struct timespec zerotime; | 93 | static struct timespec64 zerotime; |
94 | 94 | ||
95 | inode = iget_locked(sb, cramino(cramfs_inode, offset)); | 95 | inode = iget_locked(sb, cramino(cramfs_inode, offset)); |
96 | if (!inode) | 96 | if (!inode) |
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index df95412915ea..0b127853c584 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -817,12 +817,14 @@ static inline void ext4_decode_extra_time(struct timespec *time, __le32 extra) | |||
817 | time->tv_nsec = (le32_to_cpu(extra) & EXT4_NSEC_MASK) >> EXT4_EPOCH_BITS; | 817 | time->tv_nsec = (le32_to_cpu(extra) & EXT4_NSEC_MASK) >> EXT4_EPOCH_BITS; |
818 | } | 818 | } |
819 | 819 | ||
820 | #define EXT4_INODE_SET_XTIME(xtime, inode, raw_inode) \ | 820 | #define EXT4_INODE_SET_XTIME(xtime, inode, raw_inode) \ |
821 | do { \ | 821 | do { \ |
822 | (raw_inode)->xtime = cpu_to_le32((inode)->xtime.tv_sec); \ | 822 | (raw_inode)->xtime = cpu_to_le32((inode)->xtime.tv_sec); \ |
823 | if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), xtime ## _extra)) \ | 823 | if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), xtime ## _extra)) {\ |
824 | (raw_inode)->xtime ## _extra = \ | 824 | struct timespec ts = timespec64_to_timespec((inode)->xtime); \ |
825 | ext4_encode_extra_time(&(inode)->xtime); \ | 825 | (raw_inode)->xtime ## _extra = \ |
826 | ext4_encode_extra_time(&ts); \ | ||
827 | } \ | ||
826 | } while (0) | 828 | } while (0) |
827 | 829 | ||
828 | #define EXT4_EINODE_SET_XTIME(xtime, einode, raw_inode) \ | 830 | #define EXT4_EINODE_SET_XTIME(xtime, einode, raw_inode) \ |
@@ -834,16 +836,20 @@ do { \ | |||
834 | ext4_encode_extra_time(&(einode)->xtime); \ | 836 | ext4_encode_extra_time(&(einode)->xtime); \ |
835 | } while (0) | 837 | } while (0) |
836 | 838 | ||
837 | #define EXT4_INODE_GET_XTIME(xtime, inode, raw_inode) \ | 839 | #define EXT4_INODE_GET_XTIME(xtime, inode, raw_inode) \ |
838 | do { \ | 840 | do { \ |
839 | (inode)->xtime.tv_sec = (signed)le32_to_cpu((raw_inode)->xtime); \ | 841 | (inode)->xtime.tv_sec = (signed)le32_to_cpu((raw_inode)->xtime); \ |
840 | if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), xtime ## _extra)) \ | 842 | if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), xtime ## _extra)) { \ |
841 | ext4_decode_extra_time(&(inode)->xtime, \ | 843 | struct timespec ts = timespec64_to_timespec((inode)->xtime); \ |
842 | raw_inode->xtime ## _extra); \ | 844 | ext4_decode_extra_time(&ts, \ |
843 | else \ | 845 | raw_inode->xtime ## _extra); \ |
844 | (inode)->xtime.tv_nsec = 0; \ | 846 | (inode)->xtime = timespec_to_timespec64(ts); \ |
847 | } \ | ||
848 | else \ | ||
849 | (inode)->xtime.tv_nsec = 0; \ | ||
845 | } while (0) | 850 | } while (0) |
846 | 851 | ||
852 | |||
847 | #define EXT4_EINODE_GET_XTIME(xtime, einode, raw_inode) \ | 853 | #define EXT4_EINODE_GET_XTIME(xtime, einode, raw_inode) \ |
848 | do { \ | 854 | do { \ |
849 | if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime)) \ | 855 | if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime)) \ |
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index 4d6e007f3569..f525f909b559 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c | |||
@@ -1072,8 +1072,8 @@ got: | |||
1072 | inode->i_ino = ino + group * EXT4_INODES_PER_GROUP(sb); | 1072 | inode->i_ino = ino + group * EXT4_INODES_PER_GROUP(sb); |
1073 | /* This is the optimal IO size (for stat), not the fs block size */ | 1073 | /* This is the optimal IO size (for stat), not the fs block size */ |
1074 | inode->i_blocks = 0; | 1074 | inode->i_blocks = 0; |
1075 | inode->i_mtime = inode->i_atime = inode->i_ctime = ei->i_crtime = | 1075 | inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); |
1076 | current_time(inode); | 1076 | ei->i_crtime = timespec64_to_timespec(inode->i_mtime); |
1077 | 1077 | ||
1078 | memset(ei->i_data, 0, sizeof(ei->i_data)); | 1078 | memset(ei->i_data, 0, sizeof(ei->i_data)); |
1079 | ei->i_dir_start_lookup = 0; | 1079 | ei->i_dir_start_lookup = 0; |
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 4a09063ce1d2..2a4c25c4681d 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c | |||
@@ -3673,7 +3673,7 @@ static int ext4_cross_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
3673 | }; | 3673 | }; |
3674 | u8 new_file_type; | 3674 | u8 new_file_type; |
3675 | int retval; | 3675 | int retval; |
3676 | struct timespec ctime; | 3676 | struct timespec64 ctime; |
3677 | 3677 | ||
3678 | if ((ext4_test_inode_flag(new_dir, EXT4_INODE_PROJINHERIT) && | 3678 | if ((ext4_test_inode_flag(new_dir, EXT4_INODE_PROJINHERIT) && |
3679 | !projid_eq(EXT4_I(new_dir)->i_projid, | 3679 | !projid_eq(EXT4_I(new_dir)->i_projid, |
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 4c09e770a0a3..4d8b1de83143 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h | |||
@@ -2518,6 +2518,7 @@ static inline void clear_file(struct inode *inode, int type) | |||
2518 | 2518 | ||
2519 | static inline bool f2fs_skip_inode_update(struct inode *inode, int dsync) | 2519 | static inline bool f2fs_skip_inode_update(struct inode *inode, int dsync) |
2520 | { | 2520 | { |
2521 | struct timespec ts; | ||
2521 | bool ret; | 2522 | bool ret; |
2522 | 2523 | ||
2523 | if (dsync) { | 2524 | if (dsync) { |
@@ -2533,11 +2534,14 @@ static inline bool f2fs_skip_inode_update(struct inode *inode, int dsync) | |||
2533 | i_size_read(inode) & ~PAGE_MASK) | 2534 | i_size_read(inode) & ~PAGE_MASK) |
2534 | return false; | 2535 | return false; |
2535 | 2536 | ||
2536 | if (!timespec_equal(F2FS_I(inode)->i_disk_time, &inode->i_atime)) | 2537 | ts = timespec64_to_timespec(inode->i_atime); |
2538 | if (!timespec_equal(F2FS_I(inode)->i_disk_time, &ts)) | ||
2537 | return false; | 2539 | return false; |
2538 | if (!timespec_equal(F2FS_I(inode)->i_disk_time + 1, &inode->i_ctime)) | 2540 | ts = timespec64_to_timespec(inode->i_ctime); |
2541 | if (!timespec_equal(F2FS_I(inode)->i_disk_time + 1, &ts)) | ||
2539 | return false; | 2542 | return false; |
2540 | if (!timespec_equal(F2FS_I(inode)->i_disk_time + 2, &inode->i_mtime)) | 2543 | ts = timespec64_to_timespec(inode->i_mtime); |
2544 | if (!timespec_equal(F2FS_I(inode)->i_disk_time + 2, &ts)) | ||
2541 | return false; | 2545 | return false; |
2542 | if (!timespec_equal(F2FS_I(inode)->i_disk_time + 3, | 2546 | if (!timespec_equal(F2FS_I(inode)->i_disk_time + 3, |
2543 | &F2FS_I(inode)->i_crtime)) | 2547 | &F2FS_I(inode)->i_crtime)) |
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index cadb425c02d7..6880c6f78d58 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c | |||
@@ -730,14 +730,14 @@ static void __setattr_copy(struct inode *inode, const struct iattr *attr) | |||
730 | if (ia_valid & ATTR_GID) | 730 | if (ia_valid & ATTR_GID) |
731 | inode->i_gid = attr->ia_gid; | 731 | inode->i_gid = attr->ia_gid; |
732 | if (ia_valid & ATTR_ATIME) | 732 | if (ia_valid & ATTR_ATIME) |
733 | inode->i_atime = timespec_trunc(attr->ia_atime, | 733 | inode->i_atime = timespec64_trunc(attr->ia_atime, |
734 | inode->i_sb->s_time_gran); | 734 | inode->i_sb->s_time_gran); |
735 | if (ia_valid & ATTR_MTIME) | 735 | if (ia_valid & ATTR_MTIME) |
736 | inode->i_mtime = timespec_trunc(attr->ia_mtime, | 736 | inode->i_mtime = timespec64_trunc(attr->ia_mtime, |
737 | inode->i_sb->s_time_gran); | 737 | inode->i_sb->s_time_gran); |
738 | if (ia_valid & ATTR_CTIME) | 738 | if (ia_valid & ATTR_CTIME) |
739 | inode->i_ctime = timespec_trunc(attr->ia_ctime, | 739 | inode->i_ctime = timespec64_trunc(attr->ia_ctime, |
740 | inode->i_sb->s_time_gran); | 740 | inode->i_sb->s_time_gran); |
741 | if (ia_valid & ATTR_MODE) { | 741 | if (ia_valid & ATTR_MODE) { |
742 | umode_t mode = attr->ia_mode; | 742 | umode_t mode = attr->ia_mode; |
743 | 743 | ||
diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index 30a777369d2b..f121c864f4c0 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c | |||
@@ -297,9 +297,9 @@ static int do_read_inode(struct inode *inode) | |||
297 | fi->i_crtime.tv_nsec = le32_to_cpu(ri->i_crtime_nsec); | 297 | fi->i_crtime.tv_nsec = le32_to_cpu(ri->i_crtime_nsec); |
298 | } | 298 | } |
299 | 299 | ||
300 | F2FS_I(inode)->i_disk_time[0] = inode->i_atime; | 300 | F2FS_I(inode)->i_disk_time[0] = timespec64_to_timespec(inode->i_atime); |
301 | F2FS_I(inode)->i_disk_time[1] = inode->i_ctime; | 301 | F2FS_I(inode)->i_disk_time[1] = timespec64_to_timespec(inode->i_ctime); |
302 | F2FS_I(inode)->i_disk_time[2] = inode->i_mtime; | 302 | F2FS_I(inode)->i_disk_time[2] = timespec64_to_timespec(inode->i_mtime); |
303 | F2FS_I(inode)->i_disk_time[3] = F2FS_I(inode)->i_crtime; | 303 | F2FS_I(inode)->i_disk_time[3] = F2FS_I(inode)->i_crtime; |
304 | f2fs_put_page(node_page, 1); | 304 | f2fs_put_page(node_page, 1); |
305 | 305 | ||
@@ -470,9 +470,9 @@ void f2fs_update_inode(struct inode *inode, struct page *node_page) | |||
470 | if (inode->i_nlink == 0) | 470 | if (inode->i_nlink == 0) |
471 | clear_inline_node(node_page); | 471 | clear_inline_node(node_page); |
472 | 472 | ||
473 | F2FS_I(inode)->i_disk_time[0] = inode->i_atime; | 473 | F2FS_I(inode)->i_disk_time[0] = timespec64_to_timespec(inode->i_atime); |
474 | F2FS_I(inode)->i_disk_time[1] = inode->i_ctime; | 474 | F2FS_I(inode)->i_disk_time[1] = timespec64_to_timespec(inode->i_ctime); |
475 | F2FS_I(inode)->i_disk_time[2] = inode->i_mtime; | 475 | F2FS_I(inode)->i_disk_time[2] = timespec64_to_timespec(inode->i_mtime); |
476 | F2FS_I(inode)->i_disk_time[3] = F2FS_I(inode)->i_crtime; | 476 | F2FS_I(inode)->i_disk_time[3] = F2FS_I(inode)->i_crtime; |
477 | } | 477 | } |
478 | 478 | ||
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index 64050c84d353..231b7f3ea7d3 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c | |||
@@ -50,8 +50,8 @@ static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode) | |||
50 | 50 | ||
51 | inode->i_ino = ino; | 51 | inode->i_ino = ino; |
52 | inode->i_blocks = 0; | 52 | inode->i_blocks = 0; |
53 | inode->i_mtime = inode->i_atime = inode->i_ctime = | 53 | inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); |
54 | F2FS_I(inode)->i_crtime = current_time(inode); | 54 | F2FS_I(inode)->i_crtime = timespec64_to_timespec(inode->i_mtime); |
55 | inode->i_generation = sbi->s_next_generation++; | 55 | inode->i_generation = sbi->s_next_generation++; |
56 | 56 | ||
57 | if (S_ISDIR(inode->i_mode)) | 57 | if (S_ISDIR(inode->i_mode)) |
diff --git a/fs/fat/inode.c b/fs/fat/inode.c index ffbbf0520d9e..13271ea2b453 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c | |||
@@ -502,6 +502,7 @@ static int fat_validate_dir(struct inode *dir) | |||
502 | /* doesn't deal with root inode */ | 502 | /* doesn't deal with root inode */ |
503 | int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de) | 503 | int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de) |
504 | { | 504 | { |
505 | struct timespec ts; | ||
505 | struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb); | 506 | struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb); |
506 | int error; | 507 | int error; |
507 | 508 | ||
@@ -552,11 +553,14 @@ int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de) | |||
552 | inode->i_blocks = ((inode->i_size + (sbi->cluster_size - 1)) | 553 | inode->i_blocks = ((inode->i_size + (sbi->cluster_size - 1)) |
553 | & ~((loff_t)sbi->cluster_size - 1)) >> 9; | 554 | & ~((loff_t)sbi->cluster_size - 1)) >> 9; |
554 | 555 | ||
555 | fat_time_fat2unix(sbi, &inode->i_mtime, de->time, de->date, 0); | 556 | fat_time_fat2unix(sbi, &ts, de->time, de->date, 0); |
557 | inode->i_mtime = timespec_to_timespec64(ts); | ||
556 | if (sbi->options.isvfat) { | 558 | if (sbi->options.isvfat) { |
557 | fat_time_fat2unix(sbi, &inode->i_ctime, de->ctime, | 559 | fat_time_fat2unix(sbi, &ts, de->ctime, |
558 | de->cdate, de->ctime_cs); | 560 | de->cdate, de->ctime_cs); |
559 | fat_time_fat2unix(sbi, &inode->i_atime, 0, de->adate, 0); | 561 | inode->i_ctime = timespec_to_timespec64(ts); |
562 | fat_time_fat2unix(sbi, &ts, 0, de->adate, 0); | ||
563 | inode->i_atime = timespec_to_timespec64(ts); | ||
560 | } else | 564 | } else |
561 | inode->i_ctime = inode->i_atime = inode->i_mtime; | 565 | inode->i_ctime = inode->i_atime = inode->i_mtime; |
562 | 566 | ||
@@ -825,6 +829,7 @@ static int fat_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
825 | 829 | ||
826 | static int __fat_write_inode(struct inode *inode, int wait) | 830 | static int __fat_write_inode(struct inode *inode, int wait) |
827 | { | 831 | { |
832 | struct timespec ts; | ||
828 | struct super_block *sb = inode->i_sb; | 833 | struct super_block *sb = inode->i_sb; |
829 | struct msdos_sb_info *sbi = MSDOS_SB(sb); | 834 | struct msdos_sb_info *sbi = MSDOS_SB(sb); |
830 | struct buffer_head *bh; | 835 | struct buffer_head *bh; |
@@ -862,13 +867,16 @@ retry: | |||
862 | raw_entry->size = cpu_to_le32(inode->i_size); | 867 | raw_entry->size = cpu_to_le32(inode->i_size); |
863 | raw_entry->attr = fat_make_attrs(inode); | 868 | raw_entry->attr = fat_make_attrs(inode); |
864 | fat_set_start(raw_entry, MSDOS_I(inode)->i_logstart); | 869 | fat_set_start(raw_entry, MSDOS_I(inode)->i_logstart); |
865 | fat_time_unix2fat(sbi, &inode->i_mtime, &raw_entry->time, | 870 | ts = timespec64_to_timespec(inode->i_mtime); |
871 | fat_time_unix2fat(sbi, &ts, &raw_entry->time, | ||
866 | &raw_entry->date, NULL); | 872 | &raw_entry->date, NULL); |
867 | if (sbi->options.isvfat) { | 873 | if (sbi->options.isvfat) { |
868 | __le16 atime; | 874 | __le16 atime; |
869 | fat_time_unix2fat(sbi, &inode->i_ctime, &raw_entry->ctime, | 875 | ts = timespec64_to_timespec(inode->i_ctime); |
876 | fat_time_unix2fat(sbi, &ts, &raw_entry->ctime, | ||
870 | &raw_entry->cdate, &raw_entry->ctime_cs); | 877 | &raw_entry->cdate, &raw_entry->ctime_cs); |
871 | fat_time_unix2fat(sbi, &inode->i_atime, &atime, | 878 | ts = timespec64_to_timespec(inode->i_atime); |
879 | fat_time_unix2fat(sbi, &ts, &atime, | ||
872 | &raw_entry->adate, NULL); | 880 | &raw_entry->adate, NULL); |
873 | } | 881 | } |
874 | spin_unlock(&sbi->inode_hash_lock); | 882 | spin_unlock(&sbi->inode_hash_lock); |
diff --git a/fs/fat/namei_msdos.c b/fs/fat/namei_msdos.c index 484ce674e0cd..16a832c37d66 100644 --- a/fs/fat/namei_msdos.c +++ b/fs/fat/namei_msdos.c | |||
@@ -250,7 +250,7 @@ static int msdos_add_entry(struct inode *dir, const unsigned char *name, | |||
250 | if (err) | 250 | if (err) |
251 | return err; | 251 | return err; |
252 | 252 | ||
253 | dir->i_ctime = dir->i_mtime = *ts; | 253 | dir->i_ctime = dir->i_mtime = timespec_to_timespec64(*ts); |
254 | if (IS_DIRSYNC(dir)) | 254 | if (IS_DIRSYNC(dir)) |
255 | (void)fat_sync_inode(dir); | 255 | (void)fat_sync_inode(dir); |
256 | else | 256 | else |
@@ -266,7 +266,8 @@ static int msdos_create(struct inode *dir, struct dentry *dentry, umode_t mode, | |||
266 | struct super_block *sb = dir->i_sb; | 266 | struct super_block *sb = dir->i_sb; |
267 | struct inode *inode = NULL; | 267 | struct inode *inode = NULL; |
268 | struct fat_slot_info sinfo; | 268 | struct fat_slot_info sinfo; |
269 | struct timespec ts; | 269 | struct timespec64 ts; |
270 | struct timespec t; | ||
270 | unsigned char msdos_name[MSDOS_NAME]; | 271 | unsigned char msdos_name[MSDOS_NAME]; |
271 | int err, is_hid; | 272 | int err, is_hid; |
272 | 273 | ||
@@ -285,7 +286,8 @@ static int msdos_create(struct inode *dir, struct dentry *dentry, umode_t mode, | |||
285 | } | 286 | } |
286 | 287 | ||
287 | ts = current_time(dir); | 288 | ts = current_time(dir); |
288 | err = msdos_add_entry(dir, msdos_name, 0, is_hid, 0, &ts, &sinfo); | 289 | t = timespec64_to_timespec(ts); |
290 | err = msdos_add_entry(dir, msdos_name, 0, is_hid, 0, &t, &sinfo); | ||
289 | if (err) | 291 | if (err) |
290 | goto out; | 292 | goto out; |
291 | inode = fat_build_inode(sb, sinfo.de, sinfo.i_pos); | 293 | inode = fat_build_inode(sb, sinfo.de, sinfo.i_pos); |
@@ -344,7 +346,8 @@ static int msdos_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) | |||
344 | struct fat_slot_info sinfo; | 346 | struct fat_slot_info sinfo; |
345 | struct inode *inode; | 347 | struct inode *inode; |
346 | unsigned char msdos_name[MSDOS_NAME]; | 348 | unsigned char msdos_name[MSDOS_NAME]; |
347 | struct timespec ts; | 349 | struct timespec64 ts; |
350 | struct timespec t; | ||
348 | int err, is_hid, cluster; | 351 | int err, is_hid, cluster; |
349 | 352 | ||
350 | mutex_lock(&MSDOS_SB(sb)->s_lock); | 353 | mutex_lock(&MSDOS_SB(sb)->s_lock); |
@@ -362,12 +365,13 @@ static int msdos_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) | |||
362 | } | 365 | } |
363 | 366 | ||
364 | ts = current_time(dir); | 367 | ts = current_time(dir); |
365 | cluster = fat_alloc_new_dir(dir, &ts); | 368 | t = timespec64_to_timespec(ts); |
369 | cluster = fat_alloc_new_dir(dir, &t); | ||
366 | if (cluster < 0) { | 370 | if (cluster < 0) { |
367 | err = cluster; | 371 | err = cluster; |
368 | goto out; | 372 | goto out; |
369 | } | 373 | } |
370 | err = msdos_add_entry(dir, msdos_name, 1, is_hid, cluster, &ts, &sinfo); | 374 | err = msdos_add_entry(dir, msdos_name, 1, is_hid, cluster, &t, &sinfo); |
371 | if (err) | 375 | if (err) |
372 | goto out_free; | 376 | goto out_free; |
373 | inc_nlink(dir); | 377 | inc_nlink(dir); |
@@ -432,7 +436,7 @@ static int do_msdos_rename(struct inode *old_dir, unsigned char *old_name, | |||
432 | struct msdos_dir_entry *dotdot_de; | 436 | struct msdos_dir_entry *dotdot_de; |
433 | struct inode *old_inode, *new_inode; | 437 | struct inode *old_inode, *new_inode; |
434 | struct fat_slot_info old_sinfo, sinfo; | 438 | struct fat_slot_info old_sinfo, sinfo; |
435 | struct timespec ts; | 439 | struct timespec64 ts; |
436 | loff_t new_i_pos; | 440 | loff_t new_i_pos; |
437 | int err, old_attrs, is_dir, update_dotdot, corrupt = 0; | 441 | int err, old_attrs, is_dir, update_dotdot, corrupt = 0; |
438 | 442 | ||
@@ -499,8 +503,9 @@ static int do_msdos_rename(struct inode *old_dir, unsigned char *old_name, | |||
499 | new_i_pos = MSDOS_I(new_inode)->i_pos; | 503 | new_i_pos = MSDOS_I(new_inode)->i_pos; |
500 | fat_detach(new_inode); | 504 | fat_detach(new_inode); |
501 | } else { | 505 | } else { |
506 | struct timespec t = timespec64_to_timespec(ts); | ||
502 | err = msdos_add_entry(new_dir, new_name, is_dir, is_hid, 0, | 507 | err = msdos_add_entry(new_dir, new_name, is_dir, is_hid, 0, |
503 | &ts, &sinfo); | 508 | &t, &sinfo); |
504 | if (err) | 509 | if (err) |
505 | goto out; | 510 | goto out; |
506 | new_i_pos = sinfo.i_pos; | 511 | new_i_pos = sinfo.i_pos; |
diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c index d4e23f8ddcf6..9a5469120caa 100644 --- a/fs/fat/namei_vfat.c +++ b/fs/fat/namei_vfat.c | |||
@@ -678,7 +678,7 @@ static int vfat_add_entry(struct inode *dir, const struct qstr *qname, | |||
678 | goto cleanup; | 678 | goto cleanup; |
679 | 679 | ||
680 | /* update timestamp */ | 680 | /* update timestamp */ |
681 | dir->i_ctime = dir->i_mtime = dir->i_atime = *ts; | 681 | dir->i_ctime = dir->i_mtime = dir->i_atime = timespec_to_timespec64(*ts); |
682 | if (IS_DIRSYNC(dir)) | 682 | if (IS_DIRSYNC(dir)) |
683 | (void)fat_sync_inode(dir); | 683 | (void)fat_sync_inode(dir); |
684 | else | 684 | else |
@@ -761,13 +761,15 @@ static int vfat_create(struct inode *dir, struct dentry *dentry, umode_t mode, | |||
761 | struct super_block *sb = dir->i_sb; | 761 | struct super_block *sb = dir->i_sb; |
762 | struct inode *inode; | 762 | struct inode *inode; |
763 | struct fat_slot_info sinfo; | 763 | struct fat_slot_info sinfo; |
764 | struct timespec ts; | 764 | struct timespec64 ts; |
765 | struct timespec t; | ||
765 | int err; | 766 | int err; |
766 | 767 | ||
767 | mutex_lock(&MSDOS_SB(sb)->s_lock); | 768 | mutex_lock(&MSDOS_SB(sb)->s_lock); |
768 | 769 | ||
769 | ts = current_time(dir); | 770 | ts = current_time(dir); |
770 | err = vfat_add_entry(dir, &dentry->d_name, 0, 0, &ts, &sinfo); | 771 | t = timespec64_to_timespec(ts); |
772 | err = vfat_add_entry(dir, &dentry->d_name, 0, 0, &t, &sinfo); | ||
771 | if (err) | 773 | if (err) |
772 | goto out; | 774 | goto out; |
773 | inode_inc_iversion(dir); | 775 | inode_inc_iversion(dir); |
@@ -850,18 +852,20 @@ static int vfat_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) | |||
850 | struct super_block *sb = dir->i_sb; | 852 | struct super_block *sb = dir->i_sb; |
851 | struct inode *inode; | 853 | struct inode *inode; |
852 | struct fat_slot_info sinfo; | 854 | struct fat_slot_info sinfo; |
853 | struct timespec ts; | 855 | struct timespec64 ts; |
856 | struct timespec t; | ||
854 | int err, cluster; | 857 | int err, cluster; |
855 | 858 | ||
856 | mutex_lock(&MSDOS_SB(sb)->s_lock); | 859 | mutex_lock(&MSDOS_SB(sb)->s_lock); |
857 | 860 | ||
858 | ts = current_time(dir); | 861 | ts = current_time(dir); |
859 | cluster = fat_alloc_new_dir(dir, &ts); | 862 | t = timespec64_to_timespec(ts); |
863 | cluster = fat_alloc_new_dir(dir, &t); | ||
860 | if (cluster < 0) { | 864 | if (cluster < 0) { |
861 | err = cluster; | 865 | err = cluster; |
862 | goto out; | 866 | goto out; |
863 | } | 867 | } |
864 | err = vfat_add_entry(dir, &dentry->d_name, 1, cluster, &ts, &sinfo); | 868 | err = vfat_add_entry(dir, &dentry->d_name, 1, cluster, &t, &sinfo); |
865 | if (err) | 869 | if (err) |
866 | goto out_free; | 870 | goto out_free; |
867 | inode_inc_iversion(dir); | 871 | inode_inc_iversion(dir); |
@@ -899,7 +903,8 @@ static int vfat_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
899 | struct msdos_dir_entry *dotdot_de; | 903 | struct msdos_dir_entry *dotdot_de; |
900 | struct inode *old_inode, *new_inode; | 904 | struct inode *old_inode, *new_inode; |
901 | struct fat_slot_info old_sinfo, sinfo; | 905 | struct fat_slot_info old_sinfo, sinfo; |
902 | struct timespec ts; | 906 | struct timespec64 ts; |
907 | struct timespec t; | ||
903 | loff_t new_i_pos; | 908 | loff_t new_i_pos; |
904 | int err, is_dir, update_dotdot, corrupt = 0; | 909 | int err, is_dir, update_dotdot, corrupt = 0; |
905 | struct super_block *sb = old_dir->i_sb; | 910 | struct super_block *sb = old_dir->i_sb; |
@@ -934,8 +939,9 @@ static int vfat_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
934 | new_i_pos = MSDOS_I(new_inode)->i_pos; | 939 | new_i_pos = MSDOS_I(new_inode)->i_pos; |
935 | fat_detach(new_inode); | 940 | fat_detach(new_inode); |
936 | } else { | 941 | } else { |
942 | t = timespec64_to_timespec(ts); | ||
937 | err = vfat_add_entry(new_dir, &new_dentry->d_name, is_dir, 0, | 943 | err = vfat_add_entry(new_dir, &new_dentry->d_name, is_dir, 0, |
938 | &ts, &sinfo); | 944 | &t, &sinfo); |
939 | if (err) | 945 | if (err) |
940 | goto out; | 946 | goto out; |
941 | new_i_pos = sinfo.i_pos; | 947 | new_i_pos = sinfo.i_pos; |
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index ffcaf98044b9..a24df8861b40 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c | |||
@@ -217,7 +217,7 @@ void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr, | |||
217 | return; | 217 | return; |
218 | } | 218 | } |
219 | 219 | ||
220 | old_mtime = inode->i_mtime; | 220 | old_mtime = timespec64_to_timespec(inode->i_mtime); |
221 | fuse_change_attributes_common(inode, attr, attr_valid); | 221 | fuse_change_attributes_common(inode, attr, attr_valid); |
222 | 222 | ||
223 | oldsize = inode->i_size; | 223 | oldsize = inode->i_size; |
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index 3090c445e8fc..d97ad89955d1 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c | |||
@@ -871,7 +871,7 @@ static struct gfs2_leaf *new_leaf(struct inode *inode, struct buffer_head **pbh, | |||
871 | struct buffer_head *bh; | 871 | struct buffer_head *bh; |
872 | struct gfs2_leaf *leaf; | 872 | struct gfs2_leaf *leaf; |
873 | struct gfs2_dirent *dent; | 873 | struct gfs2_dirent *dent; |
874 | struct timespec tv = current_time(inode); | 874 | struct timespec64 tv = current_time(inode); |
875 | 875 | ||
876 | error = gfs2_alloc_blocks(ip, &bn, &n, 0, NULL); | 876 | error = gfs2_alloc_blocks(ip, &bn, &n, 0, NULL); |
877 | if (error) | 877 | if (error) |
@@ -1802,7 +1802,7 @@ int gfs2_dir_add(struct inode *inode, const struct qstr *name, | |||
1802 | struct gfs2_inode *ip = GFS2_I(inode); | 1802 | struct gfs2_inode *ip = GFS2_I(inode); |
1803 | struct buffer_head *bh = da->bh; | 1803 | struct buffer_head *bh = da->bh; |
1804 | struct gfs2_dirent *dent = da->dent; | 1804 | struct gfs2_dirent *dent = da->dent; |
1805 | struct timespec tv; | 1805 | struct timespec64 tv; |
1806 | struct gfs2_leaf *leaf; | 1806 | struct gfs2_leaf *leaf; |
1807 | int error; | 1807 | int error; |
1808 | 1808 | ||
@@ -1880,7 +1880,7 @@ int gfs2_dir_del(struct gfs2_inode *dip, const struct dentry *dentry) | |||
1880 | const struct qstr *name = &dentry->d_name; | 1880 | const struct qstr *name = &dentry->d_name; |
1881 | struct gfs2_dirent *dent, *prev = NULL; | 1881 | struct gfs2_dirent *dent, *prev = NULL; |
1882 | struct buffer_head *bh; | 1882 | struct buffer_head *bh; |
1883 | struct timespec tv = current_time(&dip->i_inode); | 1883 | struct timespec64 tv = current_time(&dip->i_inode); |
1884 | 1884 | ||
1885 | /* Returns _either_ the entry (if its first in block) or the | 1885 | /* Returns _either_ the entry (if its first in block) or the |
1886 | previous entry otherwise */ | 1886 | previous entry otherwise */ |
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c index d8782a7a1e7d..c63bee9adb6a 100644 --- a/fs/gfs2/glops.c +++ b/fs/gfs2/glops.c | |||
@@ -338,7 +338,7 @@ static int inode_go_demote_ok(const struct gfs2_glock *gl) | |||
338 | static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf) | 338 | static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf) |
339 | { | 339 | { |
340 | const struct gfs2_dinode *str = buf; | 340 | const struct gfs2_dinode *str = buf; |
341 | struct timespec atime; | 341 | struct timespec64 atime; |
342 | u16 height, depth; | 342 | u16 height, depth; |
343 | 343 | ||
344 | if (unlikely(ip->i_no_addr != be64_to_cpu(str->di_num.no_addr))) | 344 | if (unlikely(ip->i_no_addr != be64_to_cpu(str->di_num.no_addr))) |
@@ -361,7 +361,7 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf) | |||
361 | gfs2_set_inode_blocks(&ip->i_inode, be64_to_cpu(str->di_blocks)); | 361 | gfs2_set_inode_blocks(&ip->i_inode, be64_to_cpu(str->di_blocks)); |
362 | atime.tv_sec = be64_to_cpu(str->di_atime); | 362 | atime.tv_sec = be64_to_cpu(str->di_atime); |
363 | atime.tv_nsec = be32_to_cpu(str->di_atime_nsec); | 363 | atime.tv_nsec = be32_to_cpu(str->di_atime_nsec); |
364 | if (timespec_compare(&ip->i_inode.i_atime, &atime) < 0) | 364 | if (timespec64_compare(&ip->i_inode.i_atime, &atime) < 0) |
365 | ip->i_inode.i_atime = atime; | 365 | ip->i_inode.i_atime = atime; |
366 | ip->i_inode.i_mtime.tv_sec = be64_to_cpu(str->di_mtime); | 366 | ip->i_inode.i_mtime.tv_sec = be64_to_cpu(str->di_mtime); |
367 | ip->i_inode.i_mtime.tv_nsec = be32_to_cpu(str->di_mtime_nsec); | 367 | ip->i_inode.i_mtime.tv_nsec = be32_to_cpu(str->di_mtime_nsec); |
diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c index b3309b83371a..2a16111d312f 100644 --- a/fs/hfs/inode.c +++ b/fs/hfs/inode.c | |||
@@ -351,7 +351,7 @@ static int hfs_read_inode(struct inode *inode, void *data) | |||
351 | inode->i_mode &= ~hsb->s_file_umask; | 351 | inode->i_mode &= ~hsb->s_file_umask; |
352 | inode->i_mode |= S_IFREG; | 352 | inode->i_mode |= S_IFREG; |
353 | inode->i_ctime = inode->i_atime = inode->i_mtime = | 353 | inode->i_ctime = inode->i_atime = inode->i_mtime = |
354 | hfs_m_to_utime(rec->file.MdDat); | 354 | timespec_to_timespec64(hfs_m_to_utime(rec->file.MdDat)); |
355 | inode->i_op = &hfs_file_inode_operations; | 355 | inode->i_op = &hfs_file_inode_operations; |
356 | inode->i_fop = &hfs_file_operations; | 356 | inode->i_fop = &hfs_file_operations; |
357 | inode->i_mapping->a_ops = &hfs_aops; | 357 | inode->i_mapping->a_ops = &hfs_aops; |
@@ -362,7 +362,7 @@ static int hfs_read_inode(struct inode *inode, void *data) | |||
362 | HFS_I(inode)->fs_blocks = 0; | 362 | HFS_I(inode)->fs_blocks = 0; |
363 | inode->i_mode = S_IFDIR | (S_IRWXUGO & ~hsb->s_dir_umask); | 363 | inode->i_mode = S_IFDIR | (S_IRWXUGO & ~hsb->s_dir_umask); |
364 | inode->i_ctime = inode->i_atime = inode->i_mtime = | 364 | inode->i_ctime = inode->i_atime = inode->i_mtime = |
365 | hfs_m_to_utime(rec->dir.MdDat); | 365 | timespec_to_timespec64(hfs_m_to_utime(rec->dir.MdDat)); |
366 | inode->i_op = &hfs_dir_inode_operations; | 366 | inode->i_op = &hfs_dir_inode_operations; |
367 | inode->i_fop = &hfs_dir_operations; | 367 | inode->i_fop = &hfs_dir_operations; |
368 | break; | 368 | break; |
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index c0c8d433864f..c824f702feec 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c | |||
@@ -493,9 +493,9 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd) | |||
493 | hfsplus_get_perms(inode, &folder->permissions, 1); | 493 | hfsplus_get_perms(inode, &folder->permissions, 1); |
494 | set_nlink(inode, 1); | 494 | set_nlink(inode, 1); |
495 | inode->i_size = 2 + be32_to_cpu(folder->valence); | 495 | inode->i_size = 2 + be32_to_cpu(folder->valence); |
496 | inode->i_atime = hfsp_mt2ut(folder->access_date); | 496 | inode->i_atime = timespec_to_timespec64(hfsp_mt2ut(folder->access_date)); |
497 | inode->i_mtime = hfsp_mt2ut(folder->content_mod_date); | 497 | inode->i_mtime = timespec_to_timespec64(hfsp_mt2ut(folder->content_mod_date)); |
498 | inode->i_ctime = hfsp_mt2ut(folder->attribute_mod_date); | 498 | inode->i_ctime = timespec_to_timespec64(hfsp_mt2ut(folder->attribute_mod_date)); |
499 | HFSPLUS_I(inode)->create_date = folder->create_date; | 499 | HFSPLUS_I(inode)->create_date = folder->create_date; |
500 | HFSPLUS_I(inode)->fs_blocks = 0; | 500 | HFSPLUS_I(inode)->fs_blocks = 0; |
501 | if (folder->flags & cpu_to_be16(HFSPLUS_HAS_FOLDER_COUNT)) { | 501 | if (folder->flags & cpu_to_be16(HFSPLUS_HAS_FOLDER_COUNT)) { |
@@ -531,9 +531,9 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd) | |||
531 | init_special_inode(inode, inode->i_mode, | 531 | init_special_inode(inode, inode->i_mode, |
532 | be32_to_cpu(file->permissions.dev)); | 532 | be32_to_cpu(file->permissions.dev)); |
533 | } | 533 | } |
534 | inode->i_atime = hfsp_mt2ut(file->access_date); | 534 | inode->i_atime = timespec_to_timespec64(hfsp_mt2ut(file->access_date)); |
535 | inode->i_mtime = hfsp_mt2ut(file->content_mod_date); | 535 | inode->i_mtime = timespec_to_timespec64(hfsp_mt2ut(file->content_mod_date)); |
536 | inode->i_ctime = hfsp_mt2ut(file->attribute_mod_date); | 536 | inode->i_ctime = timespec_to_timespec64(hfsp_mt2ut(file->attribute_mod_date)); |
537 | HFSPLUS_I(inode)->create_date = file->create_date; | 537 | HFSPLUS_I(inode)->create_date = file->create_date; |
538 | } else { | 538 | } else { |
539 | pr_err("bad catalog entry used to create inode\n"); | 539 | pr_err("bad catalog entry used to create inode\n"); |
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index 3cd85eb5bbb1..2597b290c2a5 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c | |||
@@ -555,9 +555,9 @@ static int read_name(struct inode *ino, char *name) | |||
555 | set_nlink(ino, st.nlink); | 555 | set_nlink(ino, st.nlink); |
556 | i_uid_write(ino, st.uid); | 556 | i_uid_write(ino, st.uid); |
557 | i_gid_write(ino, st.gid); | 557 | i_gid_write(ino, st.gid); |
558 | ino->i_atime = st.atime; | 558 | ino->i_atime = timespec_to_timespec64(st.atime); |
559 | ino->i_mtime = st.mtime; | 559 | ino->i_mtime = timespec_to_timespec64(st.mtime); |
560 | ino->i_ctime = st.ctime; | 560 | ino->i_ctime = timespec_to_timespec64(st.ctime); |
561 | ino->i_size = st.size; | 561 | ino->i_size = st.size; |
562 | ino->i_blocks = st.blocks; | 562 | ino->i_blocks = st.blocks; |
563 | return 0; | 563 | return 0; |
@@ -838,15 +838,15 @@ static int hostfs_setattr(struct dentry *dentry, struct iattr *attr) | |||
838 | } | 838 | } |
839 | if (attr->ia_valid & ATTR_ATIME) { | 839 | if (attr->ia_valid & ATTR_ATIME) { |
840 | attrs.ia_valid |= HOSTFS_ATTR_ATIME; | 840 | attrs.ia_valid |= HOSTFS_ATTR_ATIME; |
841 | attrs.ia_atime = attr->ia_atime; | 841 | attrs.ia_atime = timespec64_to_timespec(attr->ia_atime); |
842 | } | 842 | } |
843 | if (attr->ia_valid & ATTR_MTIME) { | 843 | if (attr->ia_valid & ATTR_MTIME) { |
844 | attrs.ia_valid |= HOSTFS_ATTR_MTIME; | 844 | attrs.ia_valid |= HOSTFS_ATTR_MTIME; |
845 | attrs.ia_mtime = attr->ia_mtime; | 845 | attrs.ia_mtime = timespec64_to_timespec(attr->ia_mtime); |
846 | } | 846 | } |
847 | if (attr->ia_valid & ATTR_CTIME) { | 847 | if (attr->ia_valid & ATTR_CTIME) { |
848 | attrs.ia_valid |= HOSTFS_ATTR_CTIME; | 848 | attrs.ia_valid |= HOSTFS_ATTR_CTIME; |
849 | attrs.ia_ctime = attr->ia_ctime; | 849 | attrs.ia_ctime = timespec64_to_timespec(attr->ia_ctime); |
850 | } | 850 | } |
851 | if (attr->ia_valid & ATTR_ATIME_SET) { | 851 | if (attr->ia_valid & ATTR_ATIME_SET) { |
852 | attrs.ia_valid |= HOSTFS_ATTR_ATIME_SET; | 852 | attrs.ia_valid |= HOSTFS_ATTR_ATIME_SET; |
diff --git a/fs/inode.c b/fs/inode.c index 0df41bb77e0f..2c300e981796 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
@@ -1577,8 +1577,8 @@ static void update_ovl_inode_times(struct dentry *dentry, struct inode *inode, | |||
1577 | if (upperdentry) { | 1577 | if (upperdentry) { |
1578 | struct inode *realinode = d_inode(upperdentry); | 1578 | struct inode *realinode = d_inode(upperdentry); |
1579 | 1579 | ||
1580 | if ((!timespec_equal(&inode->i_mtime, &realinode->i_mtime) || | 1580 | if ((!timespec64_equal(&inode->i_mtime, &realinode->i_mtime) || |
1581 | !timespec_equal(&inode->i_ctime, &realinode->i_ctime))) { | 1581 | !timespec64_equal(&inode->i_ctime, &realinode->i_ctime))) { |
1582 | inode->i_mtime = realinode->i_mtime; | 1582 | inode->i_mtime = realinode->i_mtime; |
1583 | inode->i_ctime = realinode->i_ctime; | 1583 | inode->i_ctime = realinode->i_ctime; |
1584 | } | 1584 | } |
@@ -1601,12 +1601,12 @@ static int relatime_need_update(const struct path *path, struct inode *inode, | |||
1601 | /* | 1601 | /* |
1602 | * Is mtime younger than atime? If yes, update atime: | 1602 | * Is mtime younger than atime? If yes, update atime: |
1603 | */ | 1603 | */ |
1604 | if (timespec_compare(&inode->i_mtime, &inode->i_atime) >= 0) | 1604 | if (timespec64_compare(&inode->i_mtime, &inode->i_atime) >= 0) |
1605 | return 1; | 1605 | return 1; |
1606 | /* | 1606 | /* |
1607 | * Is ctime younger than atime? If yes, update atime: | 1607 | * Is ctime younger than atime? If yes, update atime: |
1608 | */ | 1608 | */ |
1609 | if (timespec_compare(&inode->i_ctime, &inode->i_atime) >= 0) | 1609 | if (timespec64_compare(&inode->i_ctime, &inode->i_atime) >= 0) |
1610 | return 1; | 1610 | return 1; |
1611 | 1611 | ||
1612 | /* | 1612 | /* |
@@ -1621,7 +1621,7 @@ static int relatime_need_update(const struct path *path, struct inode *inode, | |||
1621 | return 0; | 1621 | return 0; |
1622 | } | 1622 | } |
1623 | 1623 | ||
1624 | int generic_update_time(struct inode *inode, struct timespec *time, int flags) | 1624 | int generic_update_time(struct inode *inode, struct timespec64 *time, int flags) |
1625 | { | 1625 | { |
1626 | int iflags = I_DIRTY_TIME; | 1626 | int iflags = I_DIRTY_TIME; |
1627 | bool dirty = false; | 1627 | bool dirty = false; |
@@ -1649,9 +1649,9 @@ EXPORT_SYMBOL(generic_update_time); | |||
1649 | * This does the actual work of updating an inodes time or version. Must have | 1649 | * This does the actual work of updating an inodes time or version. Must have |
1650 | * had called mnt_want_write() before calling this. | 1650 | * had called mnt_want_write() before calling this. |
1651 | */ | 1651 | */ |
1652 | static int update_time(struct inode *inode, struct timespec *time, int flags) | 1652 | static int update_time(struct inode *inode, struct timespec64 *time, int flags) |
1653 | { | 1653 | { |
1654 | int (*update_time)(struct inode *, struct timespec *, int); | 1654 | int (*update_time)(struct inode *, struct timespec64 *, int); |
1655 | 1655 | ||
1656 | update_time = inode->i_op->update_time ? inode->i_op->update_time : | 1656 | update_time = inode->i_op->update_time ? inode->i_op->update_time : |
1657 | generic_update_time; | 1657 | generic_update_time; |
@@ -1672,7 +1672,7 @@ bool __atime_needs_update(const struct path *path, struct inode *inode, | |||
1672 | bool rcu) | 1672 | bool rcu) |
1673 | { | 1673 | { |
1674 | struct vfsmount *mnt = path->mnt; | 1674 | struct vfsmount *mnt = path->mnt; |
1675 | struct timespec now; | 1675 | struct timespec64 now; |
1676 | 1676 | ||
1677 | if (inode->i_flags & S_NOATIME) | 1677 | if (inode->i_flags & S_NOATIME) |
1678 | return false; | 1678 | return false; |
@@ -1695,10 +1695,10 @@ bool __atime_needs_update(const struct path *path, struct inode *inode, | |||
1695 | 1695 | ||
1696 | now = current_time(inode); | 1696 | now = current_time(inode); |
1697 | 1697 | ||
1698 | if (!relatime_need_update(path, inode, now, rcu)) | 1698 | if (!relatime_need_update(path, inode, timespec64_to_timespec(now), rcu)) |
1699 | return false; | 1699 | return false; |
1700 | 1700 | ||
1701 | if (timespec_equal(&inode->i_atime, &now)) | 1701 | if (timespec64_equal(&inode->i_atime, &now)) |
1702 | return false; | 1702 | return false; |
1703 | 1703 | ||
1704 | return true; | 1704 | return true; |
@@ -1708,7 +1708,7 @@ void touch_atime(const struct path *path) | |||
1708 | { | 1708 | { |
1709 | struct vfsmount *mnt = path->mnt; | 1709 | struct vfsmount *mnt = path->mnt; |
1710 | struct inode *inode = d_inode(path->dentry); | 1710 | struct inode *inode = d_inode(path->dentry); |
1711 | struct timespec now; | 1711 | struct timespec64 now; |
1712 | 1712 | ||
1713 | if (!__atime_needs_update(path, inode, false)) | 1713 | if (!__atime_needs_update(path, inode, false)) |
1714 | return; | 1714 | return; |
@@ -1842,7 +1842,7 @@ EXPORT_SYMBOL(file_remove_privs); | |||
1842 | int file_update_time(struct file *file) | 1842 | int file_update_time(struct file *file) |
1843 | { | 1843 | { |
1844 | struct inode *inode = file_inode(file); | 1844 | struct inode *inode = file_inode(file); |
1845 | struct timespec now; | 1845 | struct timespec64 now; |
1846 | int sync_it = 0; | 1846 | int sync_it = 0; |
1847 | int ret; | 1847 | int ret; |
1848 | 1848 | ||
@@ -1851,10 +1851,10 @@ int file_update_time(struct file *file) | |||
1851 | return 0; | 1851 | return 0; |
1852 | 1852 | ||
1853 | now = current_time(inode); | 1853 | now = current_time(inode); |
1854 | if (!timespec_equal(&inode->i_mtime, &now)) | 1854 | if (!timespec64_equal(&inode->i_mtime, &now)) |
1855 | sync_it = S_MTIME; | 1855 | sync_it = S_MTIME; |
1856 | 1856 | ||
1857 | if (!timespec_equal(&inode->i_ctime, &now)) | 1857 | if (!timespec64_equal(&inode->i_ctime, &now)) |
1858 | sync_it |= S_CTIME; | 1858 | sync_it |= S_CTIME; |
1859 | 1859 | ||
1860 | if (IS_I_VERSION(inode) && inode_iversion_need_inc(inode)) | 1860 | if (IS_I_VERSION(inode) && inode_iversion_need_inc(inode)) |
@@ -2098,6 +2098,30 @@ void inode_nohighmem(struct inode *inode) | |||
2098 | EXPORT_SYMBOL(inode_nohighmem); | 2098 | EXPORT_SYMBOL(inode_nohighmem); |
2099 | 2099 | ||
2100 | /** | 2100 | /** |
2101 | * timespec64_trunc - Truncate timespec64 to a granularity | ||
2102 | * @t: Timespec64 | ||
2103 | * @gran: Granularity in ns. | ||
2104 | * | ||
2105 | * Truncate a timespec64 to a granularity. Always rounds down. gran must | ||
2106 | * not be 0 nor greater than a second (NSEC_PER_SEC, or 10^9 ns). | ||
2107 | */ | ||
2108 | struct timespec64 timespec64_trunc(struct timespec64 t, unsigned gran) | ||
2109 | { | ||
2110 | /* Avoid division in the common cases 1 ns and 1 s. */ | ||
2111 | if (gran == 1) { | ||
2112 | /* nothing */ | ||
2113 | } else if (gran == NSEC_PER_SEC) { | ||
2114 | t.tv_nsec = 0; | ||
2115 | } else if (gran > 1 && gran < NSEC_PER_SEC) { | ||
2116 | t.tv_nsec -= t.tv_nsec % gran; | ||
2117 | } else { | ||
2118 | WARN(1, "illegal file time granularity: %u", gran); | ||
2119 | } | ||
2120 | return t; | ||
2121 | } | ||
2122 | EXPORT_SYMBOL(timespec64_trunc); | ||
2123 | |||
2124 | /** | ||
2101 | * current_time - Return FS time | 2125 | * current_time - Return FS time |
2102 | * @inode: inode. | 2126 | * @inode: inode. |
2103 | * | 2127 | * |
@@ -2107,15 +2131,15 @@ EXPORT_SYMBOL(inode_nohighmem); | |||
2107 | * Note that inode and inode->sb cannot be NULL. | 2131 | * Note that inode and inode->sb cannot be NULL. |
2108 | * Otherwise, the function warns and returns time without truncation. | 2132 | * Otherwise, the function warns and returns time without truncation. |
2109 | */ | 2133 | */ |
2110 | struct timespec current_time(struct inode *inode) | 2134 | struct timespec64 current_time(struct inode *inode) |
2111 | { | 2135 | { |
2112 | struct timespec now = current_kernel_time(); | 2136 | struct timespec64 now = current_kernel_time64(); |
2113 | 2137 | ||
2114 | if (unlikely(!inode->i_sb)) { | 2138 | if (unlikely(!inode->i_sb)) { |
2115 | WARN(1, "current_time() called with uninitialized super_block in the inode"); | 2139 | WARN(1, "current_time() called with uninitialized super_block in the inode"); |
2116 | return now; | 2140 | return now; |
2117 | } | 2141 | } |
2118 | 2142 | ||
2119 | return timespec_trunc(now, inode->i_sb->s_time_gran); | 2143 | return timespec64_trunc(now, inode->i_sb->s_time_gran); |
2120 | } | 2144 | } |
2121 | EXPORT_SYMBOL(current_time); | 2145 | EXPORT_SYMBOL(current_time); |
diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c index e5a6deb38e1e..b2944f9218f7 100644 --- a/fs/jffs2/dir.c +++ b/fs/jffs2/dir.c | |||
@@ -201,7 +201,7 @@ static int jffs2_create(struct inode *dir_i, struct dentry *dentry, | |||
201 | if (ret) | 201 | if (ret) |
202 | goto fail; | 202 | goto fail; |
203 | 203 | ||
204 | dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(ri->ctime)); | 204 | dir_i->i_mtime = dir_i->i_ctime = timespec_to_timespec64(ITIME(je32_to_cpu(ri->ctime))); |
205 | 205 | ||
206 | jffs2_free_raw_inode(ri); | 206 | jffs2_free_raw_inode(ri); |
207 | 207 | ||
@@ -234,7 +234,7 @@ static int jffs2_unlink(struct inode *dir_i, struct dentry *dentry) | |||
234 | if (dead_f->inocache) | 234 | if (dead_f->inocache) |
235 | set_nlink(d_inode(dentry), dead_f->inocache->pino_nlink); | 235 | set_nlink(d_inode(dentry), dead_f->inocache->pino_nlink); |
236 | if (!ret) | 236 | if (!ret) |
237 | dir_i->i_mtime = dir_i->i_ctime = ITIME(now); | 237 | dir_i->i_mtime = dir_i->i_ctime = timespec_to_timespec64(ITIME(now)); |
238 | return ret; | 238 | return ret; |
239 | } | 239 | } |
240 | /***********************************************************************/ | 240 | /***********************************************************************/ |
@@ -268,7 +268,7 @@ static int jffs2_link (struct dentry *old_dentry, struct inode *dir_i, struct de | |||
268 | set_nlink(d_inode(old_dentry), ++f->inocache->pino_nlink); | 268 | set_nlink(d_inode(old_dentry), ++f->inocache->pino_nlink); |
269 | mutex_unlock(&f->sem); | 269 | mutex_unlock(&f->sem); |
270 | d_instantiate(dentry, d_inode(old_dentry)); | 270 | d_instantiate(dentry, d_inode(old_dentry)); |
271 | dir_i->i_mtime = dir_i->i_ctime = ITIME(now); | 271 | dir_i->i_mtime = dir_i->i_ctime = timespec_to_timespec64(ITIME(now)); |
272 | ihold(d_inode(old_dentry)); | 272 | ihold(d_inode(old_dentry)); |
273 | } | 273 | } |
274 | return ret; | 274 | return ret; |
@@ -418,7 +418,7 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char | |||
418 | goto fail; | 418 | goto fail; |
419 | } | 419 | } |
420 | 420 | ||
421 | dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(rd->mctime)); | 421 | dir_i->i_mtime = dir_i->i_ctime = timespec_to_timespec64(ITIME(je32_to_cpu(rd->mctime))); |
422 | 422 | ||
423 | jffs2_free_raw_dirent(rd); | 423 | jffs2_free_raw_dirent(rd); |
424 | 424 | ||
@@ -561,7 +561,7 @@ static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, umode_t mode | |||
561 | goto fail; | 561 | goto fail; |
562 | } | 562 | } |
563 | 563 | ||
564 | dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(rd->mctime)); | 564 | dir_i->i_mtime = dir_i->i_ctime = timespec_to_timespec64(ITIME(je32_to_cpu(rd->mctime))); |
565 | inc_nlink(dir_i); | 565 | inc_nlink(dir_i); |
566 | 566 | ||
567 | jffs2_free_raw_dirent(rd); | 567 | jffs2_free_raw_dirent(rd); |
@@ -598,7 +598,7 @@ static int jffs2_rmdir (struct inode *dir_i, struct dentry *dentry) | |||
598 | ret = jffs2_do_unlink(c, dir_f, dentry->d_name.name, | 598 | ret = jffs2_do_unlink(c, dir_f, dentry->d_name.name, |
599 | dentry->d_name.len, f, now); | 599 | dentry->d_name.len, f, now); |
600 | if (!ret) { | 600 | if (!ret) { |
601 | dir_i->i_mtime = dir_i->i_ctime = ITIME(now); | 601 | dir_i->i_mtime = dir_i->i_ctime = timespec_to_timespec64(ITIME(now)); |
602 | clear_nlink(d_inode(dentry)); | 602 | clear_nlink(d_inode(dentry)); |
603 | drop_nlink(dir_i); | 603 | drop_nlink(dir_i); |
604 | } | 604 | } |
@@ -733,7 +733,7 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, umode_t mode | |||
733 | goto fail; | 733 | goto fail; |
734 | } | 734 | } |
735 | 735 | ||
736 | dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(rd->mctime)); | 736 | dir_i->i_mtime = dir_i->i_ctime = timespec_to_timespec64(ITIME(je32_to_cpu(rd->mctime))); |
737 | 737 | ||
738 | jffs2_free_raw_dirent(rd); | 738 | jffs2_free_raw_dirent(rd); |
739 | 739 | ||
@@ -853,14 +853,14 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry, | |||
853 | * caller won't do it on its own since we are returning an error. | 853 | * caller won't do it on its own since we are returning an error. |
854 | */ | 854 | */ |
855 | d_invalidate(new_dentry); | 855 | d_invalidate(new_dentry); |
856 | new_dir_i->i_mtime = new_dir_i->i_ctime = ITIME(now); | 856 | new_dir_i->i_mtime = new_dir_i->i_ctime = timespec_to_timespec64(ITIME(now)); |
857 | return ret; | 857 | return ret; |
858 | } | 858 | } |
859 | 859 | ||
860 | if (d_is_dir(old_dentry)) | 860 | if (d_is_dir(old_dentry)) |
861 | drop_nlink(old_dir_i); | 861 | drop_nlink(old_dir_i); |
862 | 862 | ||
863 | new_dir_i->i_mtime = new_dir_i->i_ctime = old_dir_i->i_mtime = old_dir_i->i_ctime = ITIME(now); | 863 | new_dir_i->i_mtime = new_dir_i->i_ctime = old_dir_i->i_mtime = old_dir_i->i_ctime = timespec_to_timespec64(ITIME(now)); |
864 | 864 | ||
865 | return 0; | 865 | return 0; |
866 | } | 866 | } |
diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c index bd0428bebe9b..481afd4c2e1a 100644 --- a/fs/jffs2/file.c +++ b/fs/jffs2/file.c | |||
@@ -308,7 +308,7 @@ static int jffs2_write_end(struct file *filp, struct address_space *mapping, | |||
308 | inode->i_size = pos + writtenlen; | 308 | inode->i_size = pos + writtenlen; |
309 | inode->i_blocks = (inode->i_size + 511) >> 9; | 309 | inode->i_blocks = (inode->i_size + 511) >> 9; |
310 | 310 | ||
311 | inode->i_ctime = inode->i_mtime = ITIME(je32_to_cpu(ri->ctime)); | 311 | inode->i_ctime = inode->i_mtime = timespec_to_timespec64(ITIME(je32_to_cpu(ri->ctime))); |
312 | } | 312 | } |
313 | } | 313 | } |
314 | 314 | ||
diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c index eab04eca95a3..0ecfb8ea38cd 100644 --- a/fs/jffs2/fs.c +++ b/fs/jffs2/fs.c | |||
@@ -146,9 +146,9 @@ int jffs2_do_setattr (struct inode *inode, struct iattr *iattr) | |||
146 | return PTR_ERR(new_metadata); | 146 | return PTR_ERR(new_metadata); |
147 | } | 147 | } |
148 | /* It worked. Update the inode */ | 148 | /* It worked. Update the inode */ |
149 | inode->i_atime = ITIME(je32_to_cpu(ri->atime)); | 149 | inode->i_atime = timespec_to_timespec64(ITIME(je32_to_cpu(ri->atime))); |
150 | inode->i_ctime = ITIME(je32_to_cpu(ri->ctime)); | 150 | inode->i_ctime = timespec_to_timespec64(ITIME(je32_to_cpu(ri->ctime))); |
151 | inode->i_mtime = ITIME(je32_to_cpu(ri->mtime)); | 151 | inode->i_mtime = timespec_to_timespec64(ITIME(je32_to_cpu(ri->mtime))); |
152 | inode->i_mode = jemode_to_cpu(ri->mode); | 152 | inode->i_mode = jemode_to_cpu(ri->mode); |
153 | i_uid_write(inode, je16_to_cpu(ri->uid)); | 153 | i_uid_write(inode, je16_to_cpu(ri->uid)); |
154 | i_gid_write(inode, je16_to_cpu(ri->gid)); | 154 | i_gid_write(inode, je16_to_cpu(ri->gid)); |
@@ -280,9 +280,9 @@ struct inode *jffs2_iget(struct super_block *sb, unsigned long ino) | |||
280 | i_uid_write(inode, je16_to_cpu(latest_node.uid)); | 280 | i_uid_write(inode, je16_to_cpu(latest_node.uid)); |
281 | i_gid_write(inode, je16_to_cpu(latest_node.gid)); | 281 | i_gid_write(inode, je16_to_cpu(latest_node.gid)); |
282 | inode->i_size = je32_to_cpu(latest_node.isize); | 282 | inode->i_size = je32_to_cpu(latest_node.isize); |
283 | inode->i_atime = ITIME(je32_to_cpu(latest_node.atime)); | 283 | inode->i_atime = timespec_to_timespec64(ITIME(je32_to_cpu(latest_node.atime))); |
284 | inode->i_mtime = ITIME(je32_to_cpu(latest_node.mtime)); | 284 | inode->i_mtime = timespec_to_timespec64(ITIME(je32_to_cpu(latest_node.mtime))); |
285 | inode->i_ctime = ITIME(je32_to_cpu(latest_node.ctime)); | 285 | inode->i_ctime = timespec_to_timespec64(ITIME(je32_to_cpu(latest_node.ctime))); |
286 | 286 | ||
287 | set_nlink(inode, f->inocache->pino_nlink); | 287 | set_nlink(inode, f->inocache->pino_nlink); |
288 | 288 | ||
diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c index 89d1dc19340b..d66cc0777303 100644 --- a/fs/kernfs/dir.c +++ b/fs/kernfs/dir.c | |||
@@ -779,7 +779,7 @@ int kernfs_add_one(struct kernfs_node *kn) | |||
779 | ps_iattr = parent->iattr; | 779 | ps_iattr = parent->iattr; |
780 | if (ps_iattr) { | 780 | if (ps_iattr) { |
781 | struct iattr *ps_iattrs = &ps_iattr->ia_iattr; | 781 | struct iattr *ps_iattrs = &ps_iattr->ia_iattr; |
782 | ktime_get_real_ts(&ps_iattrs->ia_ctime); | 782 | ktime_get_real_ts64(&ps_iattrs->ia_ctime); |
783 | ps_iattrs->ia_mtime = ps_iattrs->ia_ctime; | 783 | ps_iattrs->ia_mtime = ps_iattrs->ia_ctime; |
784 | } | 784 | } |
785 | 785 | ||
@@ -1306,7 +1306,7 @@ static void __kernfs_remove(struct kernfs_node *kn) | |||
1306 | 1306 | ||
1307 | /* update timestamps on the parent */ | 1307 | /* update timestamps on the parent */ |
1308 | if (ps_iattr) { | 1308 | if (ps_iattr) { |
1309 | ktime_get_real_ts(&ps_iattr->ia_iattr.ia_ctime); | 1309 | ktime_get_real_ts64(&ps_iattr->ia_iattr.ia_ctime); |
1310 | ps_iattr->ia_iattr.ia_mtime = | 1310 | ps_iattr->ia_iattr.ia_mtime = |
1311 | ps_iattr->ia_iattr.ia_ctime; | 1311 | ps_iattr->ia_iattr.ia_ctime; |
1312 | } | 1312 | } |
diff --git a/fs/kernfs/inode.c b/fs/kernfs/inode.c index a34303981deb..3d73fe9d56e2 100644 --- a/fs/kernfs/inode.c +++ b/fs/kernfs/inode.c | |||
@@ -52,7 +52,7 @@ static struct kernfs_iattrs *kernfs_iattrs(struct kernfs_node *kn) | |||
52 | iattrs->ia_uid = GLOBAL_ROOT_UID; | 52 | iattrs->ia_uid = GLOBAL_ROOT_UID; |
53 | iattrs->ia_gid = GLOBAL_ROOT_GID; | 53 | iattrs->ia_gid = GLOBAL_ROOT_GID; |
54 | 54 | ||
55 | ktime_get_real_ts(&iattrs->ia_atime); | 55 | ktime_get_real_ts64(&iattrs->ia_atime); |
56 | iattrs->ia_mtime = iattrs->ia_atime; | 56 | iattrs->ia_mtime = iattrs->ia_atime; |
57 | iattrs->ia_ctime = iattrs->ia_atime; | 57 | iattrs->ia_ctime = iattrs->ia_atime; |
58 | 58 | ||
@@ -176,9 +176,9 @@ static inline void set_inode_attr(struct inode *inode, struct iattr *iattr) | |||
176 | struct super_block *sb = inode->i_sb; | 176 | struct super_block *sb = inode->i_sb; |
177 | inode->i_uid = iattr->ia_uid; | 177 | inode->i_uid = iattr->ia_uid; |
178 | inode->i_gid = iattr->ia_gid; | 178 | inode->i_gid = iattr->ia_gid; |
179 | inode->i_atime = timespec_trunc(iattr->ia_atime, sb->s_time_gran); | 179 | inode->i_atime = timespec64_trunc(iattr->ia_atime, sb->s_time_gran); |
180 | inode->i_mtime = timespec_trunc(iattr->ia_mtime, sb->s_time_gran); | 180 | inode->i_mtime = timespec64_trunc(iattr->ia_mtime, sb->s_time_gran); |
181 | inode->i_ctime = timespec_trunc(iattr->ia_ctime, sb->s_time_gran); | 181 | inode->i_ctime = timespec64_trunc(iattr->ia_ctime, sb->s_time_gran); |
182 | } | 182 | } |
183 | 183 | ||
184 | static void kernfs_refresh_inode(struct kernfs_node *kn, struct inode *inode) | 184 | static void kernfs_refresh_inode(struct kernfs_node *kn, struct inode *inode) |
diff --git a/fs/locks.c b/fs/locks.c index 05e211be8684..db7b6917d9c5 100644 --- a/fs/locks.c +++ b/fs/locks.c | |||
@@ -1562,7 +1562,7 @@ EXPORT_SYMBOL(__break_lease); | |||
1562 | * exclusive leases. The justification is that if someone has an | 1562 | * exclusive leases. The justification is that if someone has an |
1563 | * exclusive lease, then they could be modifying it. | 1563 | * exclusive lease, then they could be modifying it. |
1564 | */ | 1564 | */ |
1565 | void lease_get_mtime(struct inode *inode, struct timespec *time) | 1565 | void lease_get_mtime(struct inode *inode, struct timespec64 *time) |
1566 | { | 1566 | { |
1567 | bool has_lease = false; | 1567 | bool has_lease = false; |
1568 | struct file_lock_context *ctx; | 1568 | struct file_lock_context *ctx; |
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c index ee81031cab29..64c214fb9da6 100644 --- a/fs/nfs/callback_proc.c +++ b/fs/nfs/callback_proc.c | |||
@@ -56,8 +56,8 @@ __be32 nfs4_callback_getattr(void *argp, void *resp, | |||
56 | res->change_attr = delegation->change_attr; | 56 | res->change_attr = delegation->change_attr; |
57 | if (nfs_have_writebacks(inode)) | 57 | if (nfs_have_writebacks(inode)) |
58 | res->change_attr++; | 58 | res->change_attr++; |
59 | res->ctime = inode->i_ctime; | 59 | res->ctime = timespec64_to_timespec(inode->i_ctime); |
60 | res->mtime = inode->i_mtime; | 60 | res->mtime = timespec64_to_timespec(inode->i_mtime); |
61 | res->bitmap[0] = (FATTR4_WORD0_CHANGE|FATTR4_WORD0_SIZE) & | 61 | res->bitmap[0] = (FATTR4_WORD0_CHANGE|FATTR4_WORD0_SIZE) & |
62 | args->bitmap[0]; | 62 | args->bitmap[0]; |
63 | res->bitmap[1] = (FATTR4_WORD1_TIME_METADATA|FATTR4_WORD1_TIME_MODIFY) & | 63 | res->bitmap[1] = (FATTR4_WORD1_TIME_METADATA|FATTR4_WORD1_TIME_MODIFY) & |
diff --git a/fs/nfs/fscache-index.c b/fs/nfs/fscache-index.c index 1c5d8d31fc0a..666415d13d52 100644 --- a/fs/nfs/fscache-index.c +++ b/fs/nfs/fscache-index.c | |||
@@ -88,8 +88,8 @@ enum fscache_checkaux nfs_fscache_inode_check_aux(void *cookie_netfs_data, | |||
88 | return FSCACHE_CHECKAUX_OBSOLETE; | 88 | return FSCACHE_CHECKAUX_OBSOLETE; |
89 | 89 | ||
90 | memset(&auxdata, 0, sizeof(auxdata)); | 90 | memset(&auxdata, 0, sizeof(auxdata)); |
91 | auxdata.mtime = nfsi->vfs_inode.i_mtime; | 91 | auxdata.mtime = timespec64_to_timespec(nfsi->vfs_inode.i_mtime); |
92 | auxdata.ctime = nfsi->vfs_inode.i_ctime; | 92 | auxdata.ctime = timespec64_to_timespec(nfsi->vfs_inode.i_ctime); |
93 | 93 | ||
94 | if (NFS_SERVER(&nfsi->vfs_inode)->nfs_client->rpc_ops->version == 4) | 94 | if (NFS_SERVER(&nfsi->vfs_inode)->nfs_client->rpc_ops->version == 4) |
95 | auxdata.change_attr = inode_peek_iversion_raw(&nfsi->vfs_inode); | 95 | auxdata.change_attr = inode_peek_iversion_raw(&nfsi->vfs_inode); |
diff --git a/fs/nfs/fscache.c b/fs/nfs/fscache.c index b55fc7920c3b..4dc887813c71 100644 --- a/fs/nfs/fscache.c +++ b/fs/nfs/fscache.c | |||
@@ -237,8 +237,8 @@ void nfs_fscache_init_inode(struct inode *inode) | |||
237 | return; | 237 | return; |
238 | 238 | ||
239 | memset(&auxdata, 0, sizeof(auxdata)); | 239 | memset(&auxdata, 0, sizeof(auxdata)); |
240 | auxdata.mtime = nfsi->vfs_inode.i_mtime; | 240 | auxdata.mtime = timespec64_to_timespec(nfsi->vfs_inode.i_mtime); |
241 | auxdata.ctime = nfsi->vfs_inode.i_ctime; | 241 | auxdata.ctime = timespec64_to_timespec(nfsi->vfs_inode.i_ctime); |
242 | 242 | ||
243 | if (NFS_SERVER(&nfsi->vfs_inode)->nfs_client->rpc_ops->version == 4) | 243 | if (NFS_SERVER(&nfsi->vfs_inode)->nfs_client->rpc_ops->version == 4) |
244 | auxdata.change_attr = inode_peek_iversion_raw(&nfsi->vfs_inode); | 244 | auxdata.change_attr = inode_peek_iversion_raw(&nfsi->vfs_inode); |
@@ -262,8 +262,8 @@ void nfs_fscache_clear_inode(struct inode *inode) | |||
262 | dfprintk(FSCACHE, "NFS: clear cookie (0x%p/0x%p)\n", nfsi, cookie); | 262 | dfprintk(FSCACHE, "NFS: clear cookie (0x%p/0x%p)\n", nfsi, cookie); |
263 | 263 | ||
264 | memset(&auxdata, 0, sizeof(auxdata)); | 264 | memset(&auxdata, 0, sizeof(auxdata)); |
265 | auxdata.mtime = nfsi->vfs_inode.i_mtime; | 265 | auxdata.mtime = timespec64_to_timespec(nfsi->vfs_inode.i_mtime); |
266 | auxdata.ctime = nfsi->vfs_inode.i_ctime; | 266 | auxdata.ctime = timespec64_to_timespec(nfsi->vfs_inode.i_ctime); |
267 | fscache_relinquish_cookie(cookie, &auxdata, false); | 267 | fscache_relinquish_cookie(cookie, &auxdata, false); |
268 | nfsi->fscache = NULL; | 268 | nfsi->fscache = NULL; |
269 | } | 269 | } |
@@ -304,8 +304,8 @@ void nfs_fscache_open_file(struct inode *inode, struct file *filp) | |||
304 | return; | 304 | return; |
305 | 305 | ||
306 | memset(&auxdata, 0, sizeof(auxdata)); | 306 | memset(&auxdata, 0, sizeof(auxdata)); |
307 | auxdata.mtime = nfsi->vfs_inode.i_mtime; | 307 | auxdata.mtime = timespec64_to_timespec(nfsi->vfs_inode.i_mtime); |
308 | auxdata.ctime = nfsi->vfs_inode.i_ctime; | 308 | auxdata.ctime = timespec64_to_timespec(nfsi->vfs_inode.i_ctime); |
309 | 309 | ||
310 | if (inode_is_open_for_write(inode)) { | 310 | if (inode_is_open_for_write(inode)) { |
311 | dfprintk(FSCACHE, "NFS: nfsi 0x%p disabling cache\n", nfsi); | 311 | dfprintk(FSCACHE, "NFS: nfsi 0x%p disabling cache\n", nfsi); |
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 73473d9bdfa4..b65aee481d13 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -501,15 +501,15 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr, st | |||
501 | nfsi->read_cache_jiffies = fattr->time_start; | 501 | nfsi->read_cache_jiffies = fattr->time_start; |
502 | nfsi->attr_gencount = fattr->gencount; | 502 | nfsi->attr_gencount = fattr->gencount; |
503 | if (fattr->valid & NFS_ATTR_FATTR_ATIME) | 503 | if (fattr->valid & NFS_ATTR_FATTR_ATIME) |
504 | inode->i_atime = fattr->atime; | 504 | inode->i_atime = timespec_to_timespec64(fattr->atime); |
505 | else if (nfs_server_capable(inode, NFS_CAP_ATIME)) | 505 | else if (nfs_server_capable(inode, NFS_CAP_ATIME)) |
506 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_ATIME); | 506 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_ATIME); |
507 | if (fattr->valid & NFS_ATTR_FATTR_MTIME) | 507 | if (fattr->valid & NFS_ATTR_FATTR_MTIME) |
508 | inode->i_mtime = fattr->mtime; | 508 | inode->i_mtime = timespec_to_timespec64(fattr->mtime); |
509 | else if (nfs_server_capable(inode, NFS_CAP_MTIME)) | 509 | else if (nfs_server_capable(inode, NFS_CAP_MTIME)) |
510 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_MTIME); | 510 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_MTIME); |
511 | if (fattr->valid & NFS_ATTR_FATTR_CTIME) | 511 | if (fattr->valid & NFS_ATTR_FATTR_CTIME) |
512 | inode->i_ctime = fattr->ctime; | 512 | inode->i_ctime = timespec_to_timespec64(fattr->ctime); |
513 | else if (nfs_server_capable(inode, NFS_CAP_CTIME)) | 513 | else if (nfs_server_capable(inode, NFS_CAP_CTIME)) |
514 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_CTIME); | 514 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_CTIME); |
515 | if (fattr->valid & NFS_ATTR_FATTR_CHANGE) | 515 | if (fattr->valid & NFS_ATTR_FATTR_CHANGE) |
@@ -694,7 +694,7 @@ void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr, | |||
694 | if ((attr->ia_valid & ATTR_GID) != 0) | 694 | if ((attr->ia_valid & ATTR_GID) != 0) |
695 | inode->i_gid = attr->ia_gid; | 695 | inode->i_gid = attr->ia_gid; |
696 | if (fattr->valid & NFS_ATTR_FATTR_CTIME) | 696 | if (fattr->valid & NFS_ATTR_FATTR_CTIME) |
697 | inode->i_ctime = fattr->ctime; | 697 | inode->i_ctime = timespec_to_timespec64(fattr->ctime); |
698 | else | 698 | else |
699 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_CHANGE | 699 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_CHANGE |
700 | | NFS_INO_INVALID_CTIME); | 700 | | NFS_INO_INVALID_CTIME); |
@@ -705,14 +705,14 @@ void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr, | |||
705 | NFS_I(inode)->cache_validity &= ~(NFS_INO_INVALID_ATIME | 705 | NFS_I(inode)->cache_validity &= ~(NFS_INO_INVALID_ATIME |
706 | | NFS_INO_INVALID_CTIME); | 706 | | NFS_INO_INVALID_CTIME); |
707 | if (fattr->valid & NFS_ATTR_FATTR_ATIME) | 707 | if (fattr->valid & NFS_ATTR_FATTR_ATIME) |
708 | inode->i_atime = fattr->atime; | 708 | inode->i_atime = timespec_to_timespec64(fattr->atime); |
709 | else if (attr->ia_valid & ATTR_ATIME_SET) | 709 | else if (attr->ia_valid & ATTR_ATIME_SET) |
710 | inode->i_atime = attr->ia_atime; | 710 | inode->i_atime = attr->ia_atime; |
711 | else | 711 | else |
712 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_ATIME); | 712 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_ATIME); |
713 | 713 | ||
714 | if (fattr->valid & NFS_ATTR_FATTR_CTIME) | 714 | if (fattr->valid & NFS_ATTR_FATTR_CTIME) |
715 | inode->i_ctime = fattr->ctime; | 715 | inode->i_ctime = timespec_to_timespec64(fattr->ctime); |
716 | else | 716 | else |
717 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_CHANGE | 717 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_CHANGE |
718 | | NFS_INO_INVALID_CTIME); | 718 | | NFS_INO_INVALID_CTIME); |
@@ -721,14 +721,14 @@ void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr, | |||
721 | NFS_I(inode)->cache_validity &= ~(NFS_INO_INVALID_MTIME | 721 | NFS_I(inode)->cache_validity &= ~(NFS_INO_INVALID_MTIME |
722 | | NFS_INO_INVALID_CTIME); | 722 | | NFS_INO_INVALID_CTIME); |
723 | if (fattr->valid & NFS_ATTR_FATTR_MTIME) | 723 | if (fattr->valid & NFS_ATTR_FATTR_MTIME) |
724 | inode->i_mtime = fattr->mtime; | 724 | inode->i_mtime = timespec_to_timespec64(fattr->mtime); |
725 | else if (attr->ia_valid & ATTR_MTIME_SET) | 725 | else if (attr->ia_valid & ATTR_MTIME_SET) |
726 | inode->i_mtime = attr->ia_mtime; | 726 | inode->i_mtime = attr->ia_mtime; |
727 | else | 727 | else |
728 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_MTIME); | 728 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_MTIME); |
729 | 729 | ||
730 | if (fattr->valid & NFS_ATTR_FATTR_CTIME) | 730 | if (fattr->valid & NFS_ATTR_FATTR_CTIME) |
731 | inode->i_ctime = fattr->ctime; | 731 | inode->i_ctime = timespec_to_timespec64(fattr->ctime); |
732 | else | 732 | else |
733 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_CHANGE | 733 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_CHANGE |
734 | | NFS_INO_INVALID_CTIME); | 734 | | NFS_INO_INVALID_CTIME); |
@@ -1351,6 +1351,8 @@ static bool nfs_file_has_buffered_writers(struct nfs_inode *nfsi) | |||
1351 | 1351 | ||
1352 | static void nfs_wcc_update_inode(struct inode *inode, struct nfs_fattr *fattr) | 1352 | static void nfs_wcc_update_inode(struct inode *inode, struct nfs_fattr *fattr) |
1353 | { | 1353 | { |
1354 | struct timespec ts; | ||
1355 | |||
1354 | if ((fattr->valid & NFS_ATTR_FATTR_PRECHANGE) | 1356 | if ((fattr->valid & NFS_ATTR_FATTR_PRECHANGE) |
1355 | && (fattr->valid & NFS_ATTR_FATTR_CHANGE) | 1357 | && (fattr->valid & NFS_ATTR_FATTR_CHANGE) |
1356 | && inode_eq_iversion_raw(inode, fattr->pre_change_attr)) { | 1358 | && inode_eq_iversion_raw(inode, fattr->pre_change_attr)) { |
@@ -1359,16 +1361,18 @@ static void nfs_wcc_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1359 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_DATA); | 1361 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_DATA); |
1360 | } | 1362 | } |
1361 | /* If we have atomic WCC data, we may update some attributes */ | 1363 | /* If we have atomic WCC data, we may update some attributes */ |
1364 | ts = timespec64_to_timespec(inode->i_ctime); | ||
1362 | if ((fattr->valid & NFS_ATTR_FATTR_PRECTIME) | 1365 | if ((fattr->valid & NFS_ATTR_FATTR_PRECTIME) |
1363 | && (fattr->valid & NFS_ATTR_FATTR_CTIME) | 1366 | && (fattr->valid & NFS_ATTR_FATTR_CTIME) |
1364 | && timespec_equal(&inode->i_ctime, &fattr->pre_ctime)) { | 1367 | && timespec_equal(&ts, &fattr->pre_ctime)) { |
1365 | memcpy(&inode->i_ctime, &fattr->ctime, sizeof(inode->i_ctime)); | 1368 | inode->i_ctime = timespec_to_timespec64(fattr->ctime); |
1366 | } | 1369 | } |
1367 | 1370 | ||
1371 | ts = timespec64_to_timespec(inode->i_mtime); | ||
1368 | if ((fattr->valid & NFS_ATTR_FATTR_PREMTIME) | 1372 | if ((fattr->valid & NFS_ATTR_FATTR_PREMTIME) |
1369 | && (fattr->valid & NFS_ATTR_FATTR_MTIME) | 1373 | && (fattr->valid & NFS_ATTR_FATTR_MTIME) |
1370 | && timespec_equal(&inode->i_mtime, &fattr->pre_mtime)) { | 1374 | && timespec_equal(&ts, &fattr->pre_mtime)) { |
1371 | memcpy(&inode->i_mtime, &fattr->mtime, sizeof(inode->i_mtime)); | 1375 | inode->i_mtime = timespec_to_timespec64(fattr->mtime); |
1372 | if (S_ISDIR(inode->i_mode)) | 1376 | if (S_ISDIR(inode->i_mode)) |
1373 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_DATA); | 1377 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_DATA); |
1374 | } | 1378 | } |
@@ -1394,7 +1398,7 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fat | |||
1394 | struct nfs_inode *nfsi = NFS_I(inode); | 1398 | struct nfs_inode *nfsi = NFS_I(inode); |
1395 | loff_t cur_size, new_isize; | 1399 | loff_t cur_size, new_isize; |
1396 | unsigned long invalid = 0; | 1400 | unsigned long invalid = 0; |
1397 | 1401 | struct timespec ts; | |
1398 | 1402 | ||
1399 | if (NFS_PROTO(inode)->have_delegation(inode, FMODE_READ)) | 1403 | if (NFS_PROTO(inode)->have_delegation(inode, FMODE_READ)) |
1400 | return 0; | 1404 | return 0; |
@@ -1411,10 +1415,12 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fat | |||
1411 | invalid |= NFS_INO_INVALID_CHANGE | 1415 | invalid |= NFS_INO_INVALID_CHANGE |
1412 | | NFS_INO_REVAL_PAGECACHE; | 1416 | | NFS_INO_REVAL_PAGECACHE; |
1413 | 1417 | ||
1414 | if ((fattr->valid & NFS_ATTR_FATTR_MTIME) && !timespec_equal(&inode->i_mtime, &fattr->mtime)) | 1418 | ts = timespec64_to_timespec(inode->i_mtime); |
1419 | if ((fattr->valid & NFS_ATTR_FATTR_MTIME) && !timespec_equal(&ts, &fattr->mtime)) | ||
1415 | invalid |= NFS_INO_INVALID_MTIME; | 1420 | invalid |= NFS_INO_INVALID_MTIME; |
1416 | 1421 | ||
1417 | if ((fattr->valid & NFS_ATTR_FATTR_CTIME) && !timespec_equal(&inode->i_ctime, &fattr->ctime)) | 1422 | ts = timespec64_to_timespec(inode->i_ctime); |
1423 | if ((fattr->valid & NFS_ATTR_FATTR_CTIME) && !timespec_equal(&ts, &fattr->ctime)) | ||
1418 | invalid |= NFS_INO_INVALID_CTIME; | 1424 | invalid |= NFS_INO_INVALID_CTIME; |
1419 | 1425 | ||
1420 | if (fattr->valid & NFS_ATTR_FATTR_SIZE) { | 1426 | if (fattr->valid & NFS_ATTR_FATTR_SIZE) { |
@@ -1444,7 +1450,8 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fat | |||
1444 | if ((fattr->valid & NFS_ATTR_FATTR_NLINK) && inode->i_nlink != fattr->nlink) | 1450 | if ((fattr->valid & NFS_ATTR_FATTR_NLINK) && inode->i_nlink != fattr->nlink) |
1445 | invalid |= NFS_INO_INVALID_OTHER; | 1451 | invalid |= NFS_INO_INVALID_OTHER; |
1446 | 1452 | ||
1447 | if ((fattr->valid & NFS_ATTR_FATTR_ATIME) && !timespec_equal(&inode->i_atime, &fattr->atime)) | 1453 | ts = timespec64_to_timespec(inode->i_atime); |
1454 | if ((fattr->valid & NFS_ATTR_FATTR_ATIME) && !timespec_equal(&ts, &fattr->atime)) | ||
1448 | invalid |= NFS_INO_INVALID_ATIME; | 1455 | invalid |= NFS_INO_INVALID_ATIME; |
1449 | 1456 | ||
1450 | if (invalid != 0) | 1457 | if (invalid != 0) |
@@ -1716,12 +1723,12 @@ int nfs_post_op_update_inode_force_wcc_locked(struct inode *inode, struct nfs_fa | |||
1716 | } | 1723 | } |
1717 | if ((fattr->valid & NFS_ATTR_FATTR_CTIME) != 0 && | 1724 | if ((fattr->valid & NFS_ATTR_FATTR_CTIME) != 0 && |
1718 | (fattr->valid & NFS_ATTR_FATTR_PRECTIME) == 0) { | 1725 | (fattr->valid & NFS_ATTR_FATTR_PRECTIME) == 0) { |
1719 | memcpy(&fattr->pre_ctime, &inode->i_ctime, sizeof(fattr->pre_ctime)); | 1726 | fattr->pre_ctime = timespec64_to_timespec(inode->i_ctime); |
1720 | fattr->valid |= NFS_ATTR_FATTR_PRECTIME; | 1727 | fattr->valid |= NFS_ATTR_FATTR_PRECTIME; |
1721 | } | 1728 | } |
1722 | if ((fattr->valid & NFS_ATTR_FATTR_MTIME) != 0 && | 1729 | if ((fattr->valid & NFS_ATTR_FATTR_MTIME) != 0 && |
1723 | (fattr->valid & NFS_ATTR_FATTR_PREMTIME) == 0) { | 1730 | (fattr->valid & NFS_ATTR_FATTR_PREMTIME) == 0) { |
1724 | memcpy(&fattr->pre_mtime, &inode->i_mtime, sizeof(fattr->pre_mtime)); | 1731 | fattr->pre_mtime = timespec64_to_timespec(inode->i_mtime); |
1725 | fattr->valid |= NFS_ATTR_FATTR_PREMTIME; | 1732 | fattr->valid |= NFS_ATTR_FATTR_PREMTIME; |
1726 | } | 1733 | } |
1727 | if ((fattr->valid & NFS_ATTR_FATTR_SIZE) != 0 && | 1734 | if ((fattr->valid & NFS_ATTR_FATTR_SIZE) != 0 && |
@@ -1884,7 +1891,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1884 | } | 1891 | } |
1885 | 1892 | ||
1886 | if (fattr->valid & NFS_ATTR_FATTR_MTIME) { | 1893 | if (fattr->valid & NFS_ATTR_FATTR_MTIME) { |
1887 | memcpy(&inode->i_mtime, &fattr->mtime, sizeof(inode->i_mtime)); | 1894 | inode->i_mtime = timespec_to_timespec64(fattr->mtime); |
1888 | } else if (server->caps & NFS_CAP_MTIME) { | 1895 | } else if (server->caps & NFS_CAP_MTIME) { |
1889 | nfsi->cache_validity |= save_cache_validity & | 1896 | nfsi->cache_validity |= save_cache_validity & |
1890 | (NFS_INO_INVALID_MTIME | 1897 | (NFS_INO_INVALID_MTIME |
@@ -1893,7 +1900,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1893 | } | 1900 | } |
1894 | 1901 | ||
1895 | if (fattr->valid & NFS_ATTR_FATTR_CTIME) { | 1902 | if (fattr->valid & NFS_ATTR_FATTR_CTIME) { |
1896 | memcpy(&inode->i_ctime, &fattr->ctime, sizeof(inode->i_ctime)); | 1903 | inode->i_ctime = timespec_to_timespec64(fattr->ctime); |
1897 | } else if (server->caps & NFS_CAP_CTIME) { | 1904 | } else if (server->caps & NFS_CAP_CTIME) { |
1898 | nfsi->cache_validity |= save_cache_validity & | 1905 | nfsi->cache_validity |= save_cache_validity & |
1899 | (NFS_INO_INVALID_CTIME | 1906 | (NFS_INO_INVALID_CTIME |
@@ -1931,7 +1938,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1931 | 1938 | ||
1932 | 1939 | ||
1933 | if (fattr->valid & NFS_ATTR_FATTR_ATIME) | 1940 | if (fattr->valid & NFS_ATTR_FATTR_ATIME) |
1934 | memcpy(&inode->i_atime, &fattr->atime, sizeof(inode->i_atime)); | 1941 | inode->i_atime = timespec_to_timespec64(fattr->atime); |
1935 | else if (server->caps & NFS_CAP_ATIME) { | 1942 | else if (server->caps & NFS_CAP_ATIME) { |
1936 | nfsi->cache_validity |= save_cache_validity & | 1943 | nfsi->cache_validity |= save_cache_validity & |
1937 | (NFS_INO_INVALID_ATIME | 1944 | (NFS_INO_INVALID_ATIME |
diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c index 85e4b4a233f9..350675e3ed47 100644 --- a/fs/nfs/nfs2xdr.c +++ b/fs/nfs/nfs2xdr.c | |||
@@ -354,6 +354,7 @@ static __be32 *xdr_time_not_set(__be32 *p) | |||
354 | 354 | ||
355 | static void encode_sattr(struct xdr_stream *xdr, const struct iattr *attr) | 355 | static void encode_sattr(struct xdr_stream *xdr, const struct iattr *attr) |
356 | { | 356 | { |
357 | struct timespec ts; | ||
357 | __be32 *p; | 358 | __be32 *p; |
358 | 359 | ||
359 | p = xdr_reserve_space(xdr, NFS_sattr_sz << 2); | 360 | p = xdr_reserve_space(xdr, NFS_sattr_sz << 2); |
@@ -375,17 +376,21 @@ static void encode_sattr(struct xdr_stream *xdr, const struct iattr *attr) | |||
375 | else | 376 | else |
376 | *p++ = cpu_to_be32(NFS2_SATTR_NOT_SET); | 377 | *p++ = cpu_to_be32(NFS2_SATTR_NOT_SET); |
377 | 378 | ||
378 | if (attr->ia_valid & ATTR_ATIME_SET) | 379 | if (attr->ia_valid & ATTR_ATIME_SET) { |
379 | p = xdr_encode_time(p, &attr->ia_atime); | 380 | ts = timespec64_to_timespec(attr->ia_atime); |
380 | else if (attr->ia_valid & ATTR_ATIME) | 381 | p = xdr_encode_time(p, &ts); |
381 | p = xdr_encode_current_server_time(p, &attr->ia_atime); | 382 | } else if (attr->ia_valid & ATTR_ATIME) { |
382 | else | 383 | ts = timespec64_to_timespec(attr->ia_atime); |
384 | p = xdr_encode_current_server_time(p, &ts); | ||
385 | } else | ||
383 | p = xdr_time_not_set(p); | 386 | p = xdr_time_not_set(p); |
384 | if (attr->ia_valid & ATTR_MTIME_SET) | 387 | if (attr->ia_valid & ATTR_MTIME_SET) { |
385 | xdr_encode_time(p, &attr->ia_mtime); | 388 | ts = timespec64_to_timespec(attr->ia_atime); |
386 | else if (attr->ia_valid & ATTR_MTIME) | 389 | xdr_encode_time(p, &ts); |
387 | xdr_encode_current_server_time(p, &attr->ia_mtime); | 390 | } else if (attr->ia_valid & ATTR_MTIME) { |
388 | else | 391 | ts = timespec64_to_timespec(attr->ia_mtime); |
392 | xdr_encode_current_server_time(p, &ts); | ||
393 | } else | ||
389 | xdr_time_not_set(p); | 394 | xdr_time_not_set(p); |
390 | } | 395 | } |
391 | 396 | ||
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c index 09ee36dd8426..64e4fa33d89f 100644 --- a/fs/nfs/nfs3xdr.c +++ b/fs/nfs/nfs3xdr.c | |||
@@ -561,6 +561,7 @@ static __be32 *xdr_decode_nfstime3(__be32 *p, struct timespec *timep) | |||
561 | */ | 561 | */ |
562 | static void encode_sattr3(struct xdr_stream *xdr, const struct iattr *attr) | 562 | static void encode_sattr3(struct xdr_stream *xdr, const struct iattr *attr) |
563 | { | 563 | { |
564 | struct timespec ts; | ||
564 | u32 nbytes; | 565 | u32 nbytes; |
565 | __be32 *p; | 566 | __be32 *p; |
566 | 567 | ||
@@ -610,8 +611,10 @@ static void encode_sattr3(struct xdr_stream *xdr, const struct iattr *attr) | |||
610 | *p++ = xdr_zero; | 611 | *p++ = xdr_zero; |
611 | 612 | ||
612 | if (attr->ia_valid & ATTR_ATIME_SET) { | 613 | if (attr->ia_valid & ATTR_ATIME_SET) { |
614 | struct timespec ts; | ||
613 | *p++ = xdr_two; | 615 | *p++ = xdr_two; |
614 | p = xdr_encode_nfstime3(p, &attr->ia_atime); | 616 | ts = timespec64_to_timespec(attr->ia_atime); |
617 | p = xdr_encode_nfstime3(p, &ts); | ||
615 | } else if (attr->ia_valid & ATTR_ATIME) { | 618 | } else if (attr->ia_valid & ATTR_ATIME) { |
616 | *p++ = xdr_one; | 619 | *p++ = xdr_one; |
617 | } else | 620 | } else |
@@ -619,7 +622,8 @@ static void encode_sattr3(struct xdr_stream *xdr, const struct iattr *attr) | |||
619 | 622 | ||
620 | if (attr->ia_valid & ATTR_MTIME_SET) { | 623 | if (attr->ia_valid & ATTR_MTIME_SET) { |
621 | *p++ = xdr_two; | 624 | *p++ = xdr_two; |
622 | xdr_encode_nfstime3(p, &attr->ia_mtime); | 625 | ts = timespec64_to_timespec(attr->ia_mtime); |
626 | xdr_encode_nfstime3(p, &ts); | ||
623 | } else if (attr->ia_valid & ATTR_MTIME) { | 627 | } else if (attr->ia_valid & ATTR_MTIME) { |
624 | *p = xdr_one; | 628 | *p = xdr_one; |
625 | } else | 629 | } else |
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 738a7be019d2..cd41d2577a04 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -1069,6 +1069,7 @@ static void encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, | |||
1069 | const struct nfs_server *server, | 1069 | const struct nfs_server *server, |
1070 | const uint32_t attrmask[]) | 1070 | const uint32_t attrmask[]) |
1071 | { | 1071 | { |
1072 | struct timespec ts; | ||
1072 | char owner_name[IDMAP_NAMESZ]; | 1073 | char owner_name[IDMAP_NAMESZ]; |
1073 | char owner_group[IDMAP_NAMESZ]; | 1074 | char owner_group[IDMAP_NAMESZ]; |
1074 | int owner_namelen = 0; | 1075 | int owner_namelen = 0; |
@@ -1157,14 +1158,16 @@ static void encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, | |||
1157 | if (bmval[1] & FATTR4_WORD1_TIME_ACCESS_SET) { | 1158 | if (bmval[1] & FATTR4_WORD1_TIME_ACCESS_SET) { |
1158 | if (iap->ia_valid & ATTR_ATIME_SET) { | 1159 | if (iap->ia_valid & ATTR_ATIME_SET) { |
1159 | *p++ = cpu_to_be32(NFS4_SET_TO_CLIENT_TIME); | 1160 | *p++ = cpu_to_be32(NFS4_SET_TO_CLIENT_TIME); |
1160 | p = xdr_encode_nfstime4(p, &iap->ia_atime); | 1161 | ts = timespec64_to_timespec(iap->ia_atime); |
1162 | p = xdr_encode_nfstime4(p, &ts); | ||
1161 | } else | 1163 | } else |
1162 | *p++ = cpu_to_be32(NFS4_SET_TO_SERVER_TIME); | 1164 | *p++ = cpu_to_be32(NFS4_SET_TO_SERVER_TIME); |
1163 | } | 1165 | } |
1164 | if (bmval[1] & FATTR4_WORD1_TIME_MODIFY_SET) { | 1166 | if (bmval[1] & FATTR4_WORD1_TIME_MODIFY_SET) { |
1165 | if (iap->ia_valid & ATTR_MTIME_SET) { | 1167 | if (iap->ia_valid & ATTR_MTIME_SET) { |
1166 | *p++ = cpu_to_be32(NFS4_SET_TO_CLIENT_TIME); | 1168 | *p++ = cpu_to_be32(NFS4_SET_TO_CLIENT_TIME); |
1167 | p = xdr_encode_nfstime4(p, &iap->ia_mtime); | 1169 | ts = timespec64_to_timespec(iap->ia_mtime); |
1170 | p = xdr_encode_nfstime4(p, &ts); | ||
1168 | } else | 1171 | } else |
1169 | *p++ = cpu_to_be32(NFS4_SET_TO_SERVER_TIME); | 1172 | *p++ = cpu_to_be32(NFS4_SET_TO_SERVER_TIME); |
1170 | } | 1173 | } |
diff --git a/fs/nfsd/blocklayout.c b/fs/nfsd/blocklayout.c index 77ccaad1399b..4fb1f72a25fb 100644 --- a/fs/nfsd/blocklayout.c +++ b/fs/nfsd/blocklayout.c | |||
@@ -121,13 +121,15 @@ nfsd4_block_commit_blocks(struct inode *inode, struct nfsd4_layoutcommit *lcp, | |||
121 | { | 121 | { |
122 | loff_t new_size = lcp->lc_last_wr + 1; | 122 | loff_t new_size = lcp->lc_last_wr + 1; |
123 | struct iattr iattr = { .ia_valid = 0 }; | 123 | struct iattr iattr = { .ia_valid = 0 }; |
124 | struct timespec ts; | ||
124 | int error; | 125 | int error; |
125 | 126 | ||
127 | ts = timespec64_to_timespec(inode->i_mtime); | ||
126 | if (lcp->lc_mtime.tv_nsec == UTIME_NOW || | 128 | if (lcp->lc_mtime.tv_nsec == UTIME_NOW || |
127 | timespec_compare(&lcp->lc_mtime, &inode->i_mtime) < 0) | 129 | timespec_compare(&lcp->lc_mtime, &ts) < 0) |
128 | lcp->lc_mtime = current_time(inode); | 130 | lcp->lc_mtime = timespec64_to_timespec(current_time(inode)); |
129 | iattr.ia_valid |= ATTR_ATIME | ATTR_CTIME | ATTR_MTIME; | 131 | iattr.ia_valid |= ATTR_ATIME | ATTR_CTIME | ATTR_MTIME; |
130 | iattr.ia_atime = iattr.ia_ctime = iattr.ia_mtime = lcp->lc_mtime; | 132 | iattr.ia_atime = iattr.ia_ctime = iattr.ia_mtime = timespec_to_timespec64(lcp->lc_mtime); |
131 | 133 | ||
132 | if (new_size > i_size_read(inode)) { | 134 | if (new_size > i_size_read(inode)) { |
133 | iattr.ia_valid |= ATTR_SIZE; | 135 | iattr.ia_valid |= ATTR_SIZE; |
diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c index 3192b544a441..9b973f4f7d01 100644 --- a/fs/nfsd/nfs3xdr.c +++ b/fs/nfsd/nfs3xdr.c | |||
@@ -165,6 +165,7 @@ static __be32 * | |||
165 | encode_fattr3(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp, | 165 | encode_fattr3(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp, |
166 | struct kstat *stat) | 166 | struct kstat *stat) |
167 | { | 167 | { |
168 | struct timespec ts; | ||
168 | *p++ = htonl(nfs3_ftypes[(stat->mode & S_IFMT) >> 12]); | 169 | *p++ = htonl(nfs3_ftypes[(stat->mode & S_IFMT) >> 12]); |
169 | *p++ = htonl((u32) (stat->mode & S_IALLUGO)); | 170 | *p++ = htonl((u32) (stat->mode & S_IALLUGO)); |
170 | *p++ = htonl((u32) stat->nlink); | 171 | *p++ = htonl((u32) stat->nlink); |
@@ -180,9 +181,12 @@ encode_fattr3(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp, | |||
180 | *p++ = htonl((u32) MINOR(stat->rdev)); | 181 | *p++ = htonl((u32) MINOR(stat->rdev)); |
181 | p = encode_fsid(p, fhp); | 182 | p = encode_fsid(p, fhp); |
182 | p = xdr_encode_hyper(p, stat->ino); | 183 | p = xdr_encode_hyper(p, stat->ino); |
183 | p = encode_time3(p, &stat->atime); | 184 | ts = timespec64_to_timespec(stat->atime); |
184 | p = encode_time3(p, &stat->mtime); | 185 | p = encode_time3(p, &ts); |
185 | p = encode_time3(p, &stat->ctime); | 186 | ts = timespec64_to_timespec(stat->mtime); |
187 | p = encode_time3(p, &ts); | ||
188 | ts = timespec64_to_timespec(stat->ctime); | ||
189 | p = encode_time3(p, &ts); | ||
186 | 190 | ||
187 | return p; | 191 | return p; |
188 | } | 192 | } |
@@ -271,8 +275,8 @@ void fill_pre_wcc(struct svc_fh *fhp) | |||
271 | stat.size = inode->i_size; | 275 | stat.size = inode->i_size; |
272 | } | 276 | } |
273 | 277 | ||
274 | fhp->fh_pre_mtime = stat.mtime; | 278 | fhp->fh_pre_mtime = timespec64_to_timespec(stat.mtime); |
275 | fhp->fh_pre_ctime = stat.ctime; | 279 | fhp->fh_pre_ctime = timespec64_to_timespec(stat.ctime); |
276 | fhp->fh_pre_size = stat.size; | 280 | fhp->fh_pre_size = stat.size; |
277 | fhp->fh_pre_change = nfsd4_change_attribute(&stat, inode); | 281 | fhp->fh_pre_change = nfsd4_change_attribute(&stat, inode); |
278 | fhp->fh_pre_saved = true; | 282 | fhp->fh_pre_saved = true; |
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 59d471025949..a96843c59fc1 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c | |||
@@ -320,6 +320,7 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, | |||
320 | struct iattr *iattr, struct nfs4_acl **acl, | 320 | struct iattr *iattr, struct nfs4_acl **acl, |
321 | struct xdr_netobj *label, int *umask) | 321 | struct xdr_netobj *label, int *umask) |
322 | { | 322 | { |
323 | struct timespec ts; | ||
323 | int expected_len, len = 0; | 324 | int expected_len, len = 0; |
324 | u32 dummy32; | 325 | u32 dummy32; |
325 | char *buf; | 326 | char *buf; |
@@ -421,7 +422,8 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, | |||
421 | switch (dummy32) { | 422 | switch (dummy32) { |
422 | case NFS4_SET_TO_CLIENT_TIME: | 423 | case NFS4_SET_TO_CLIENT_TIME: |
423 | len += 12; | 424 | len += 12; |
424 | status = nfsd4_decode_time(argp, &iattr->ia_atime); | 425 | status = nfsd4_decode_time(argp, &ts); |
426 | iattr->ia_atime = timespec_to_timespec64(ts); | ||
425 | if (status) | 427 | if (status) |
426 | return status; | 428 | return status; |
427 | iattr->ia_valid |= (ATTR_ATIME | ATTR_ATIME_SET); | 429 | iattr->ia_valid |= (ATTR_ATIME | ATTR_ATIME_SET); |
@@ -440,7 +442,8 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, | |||
440 | switch (dummy32) { | 442 | switch (dummy32) { |
441 | case NFS4_SET_TO_CLIENT_TIME: | 443 | case NFS4_SET_TO_CLIENT_TIME: |
442 | len += 12; | 444 | len += 12; |
443 | status = nfsd4_decode_time(argp, &iattr->ia_mtime); | 445 | status = nfsd4_decode_time(argp, &ts); |
446 | iattr->ia_mtime = timespec_to_timespec64(ts); | ||
444 | if (status) | 447 | if (status) |
445 | return status; | 448 | return status; |
446 | iattr->ia_valid |= (ATTR_MTIME | ATTR_MTIME_SET); | 449 | iattr->ia_valid |= (ATTR_MTIME | ATTR_MTIME_SET); |
diff --git a/fs/nfsd/nfsxdr.c b/fs/nfsd/nfsxdr.c index a43e8260520a..6b2e8b73d36e 100644 --- a/fs/nfsd/nfsxdr.c +++ b/fs/nfsd/nfsxdr.c | |||
@@ -131,7 +131,7 @@ encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp, | |||
131 | { | 131 | { |
132 | struct dentry *dentry = fhp->fh_dentry; | 132 | struct dentry *dentry = fhp->fh_dentry; |
133 | int type; | 133 | int type; |
134 | struct timespec time; | 134 | struct timespec64 time; |
135 | u32 f; | 135 | u32 f; |
136 | 136 | ||
137 | type = (stat->mode & S_IFMT); | 137 | type = (stat->mode & S_IFMT); |
diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c index 1c1ee489284b..decaf75d1cd5 100644 --- a/fs/ntfs/inode.c +++ b/fs/ntfs/inode.c | |||
@@ -667,18 +667,18 @@ static int ntfs_read_locked_inode(struct inode *vi) | |||
667 | * mtime is the last change of the data within the file. Not changed | 667 | * mtime is the last change of the data within the file. Not changed |
668 | * when only metadata is changed, e.g. a rename doesn't affect mtime. | 668 | * when only metadata is changed, e.g. a rename doesn't affect mtime. |
669 | */ | 669 | */ |
670 | vi->i_mtime = ntfs2utc(si->last_data_change_time); | 670 | vi->i_mtime = timespec_to_timespec64(ntfs2utc(si->last_data_change_time)); |
671 | /* | 671 | /* |
672 | * ctime is the last change of the metadata of the file. This obviously | 672 | * ctime is the last change of the metadata of the file. This obviously |
673 | * always changes, when mtime is changed. ctime can be changed on its | 673 | * always changes, when mtime is changed. ctime can be changed on its |
674 | * own, mtime is then not changed, e.g. when a file is renamed. | 674 | * own, mtime is then not changed, e.g. when a file is renamed. |
675 | */ | 675 | */ |
676 | vi->i_ctime = ntfs2utc(si->last_mft_change_time); | 676 | vi->i_ctime = timespec_to_timespec64(ntfs2utc(si->last_mft_change_time)); |
677 | /* | 677 | /* |
678 | * Last access to the data within the file. Not changed during a rename | 678 | * Last access to the data within the file. Not changed during a rename |
679 | * for example but changed whenever the file is written to. | 679 | * for example but changed whenever the file is written to. |
680 | */ | 680 | */ |
681 | vi->i_atime = ntfs2utc(si->last_access_time); | 681 | vi->i_atime = timespec_to_timespec64(ntfs2utc(si->last_access_time)); |
682 | 682 | ||
683 | /* Find the attribute list attribute if present. */ | 683 | /* Find the attribute list attribute if present. */ |
684 | ntfs_attr_reinit_search_ctx(ctx); | 684 | ntfs_attr_reinit_search_ctx(ctx); |
@@ -2804,11 +2804,11 @@ done: | |||
2804 | * for real. | 2804 | * for real. |
2805 | */ | 2805 | */ |
2806 | if (!IS_NOCMTIME(VFS_I(base_ni)) && !IS_RDONLY(VFS_I(base_ni))) { | 2806 | if (!IS_NOCMTIME(VFS_I(base_ni)) && !IS_RDONLY(VFS_I(base_ni))) { |
2807 | struct timespec now = current_time(VFS_I(base_ni)); | 2807 | struct timespec64 now = current_time(VFS_I(base_ni)); |
2808 | int sync_it = 0; | 2808 | int sync_it = 0; |
2809 | 2809 | ||
2810 | if (!timespec_equal(&VFS_I(base_ni)->i_mtime, &now) || | 2810 | if (!timespec64_equal(&VFS_I(base_ni)->i_mtime, &now) || |
2811 | !timespec_equal(&VFS_I(base_ni)->i_ctime, &now)) | 2811 | !timespec64_equal(&VFS_I(base_ni)->i_ctime, &now)) |
2812 | sync_it = 1; | 2812 | sync_it = 1; |
2813 | VFS_I(base_ni)->i_mtime = now; | 2813 | VFS_I(base_ni)->i_mtime = now; |
2814 | VFS_I(base_ni)->i_ctime = now; | 2814 | VFS_I(base_ni)->i_ctime = now; |
@@ -2923,14 +2923,14 @@ int ntfs_setattr(struct dentry *dentry, struct iattr *attr) | |||
2923 | } | 2923 | } |
2924 | } | 2924 | } |
2925 | if (ia_valid & ATTR_ATIME) | 2925 | if (ia_valid & ATTR_ATIME) |
2926 | vi->i_atime = timespec_trunc(attr->ia_atime, | 2926 | vi->i_atime = timespec64_trunc(attr->ia_atime, |
2927 | vi->i_sb->s_time_gran); | 2927 | vi->i_sb->s_time_gran); |
2928 | if (ia_valid & ATTR_MTIME) | 2928 | if (ia_valid & ATTR_MTIME) |
2929 | vi->i_mtime = timespec_trunc(attr->ia_mtime, | 2929 | vi->i_mtime = timespec64_trunc(attr->ia_mtime, |
2930 | vi->i_sb->s_time_gran); | 2930 | vi->i_sb->s_time_gran); |
2931 | if (ia_valid & ATTR_CTIME) | 2931 | if (ia_valid & ATTR_CTIME) |
2932 | vi->i_ctime = timespec_trunc(attr->ia_ctime, | 2932 | vi->i_ctime = timespec64_trunc(attr->ia_ctime, |
2933 | vi->i_sb->s_time_gran); | 2933 | vi->i_sb->s_time_gran); |
2934 | mark_inode_dirty(vi); | 2934 | mark_inode_dirty(vi); |
2935 | out: | 2935 | out: |
2936 | return err; | 2936 | return err; |
@@ -2997,7 +2997,7 @@ int __ntfs_write_inode(struct inode *vi, int sync) | |||
2997 | si = (STANDARD_INFORMATION*)((u8*)ctx->attr + | 2997 | si = (STANDARD_INFORMATION*)((u8*)ctx->attr + |
2998 | le16_to_cpu(ctx->attr->data.resident.value_offset)); | 2998 | le16_to_cpu(ctx->attr->data.resident.value_offset)); |
2999 | /* Update the access times if they have changed. */ | 2999 | /* Update the access times if they have changed. */ |
3000 | nt = utc2ntfs(vi->i_mtime); | 3000 | nt = utc2ntfs(timespec64_to_timespec(vi->i_mtime)); |
3001 | if (si->last_data_change_time != nt) { | 3001 | if (si->last_data_change_time != nt) { |
3002 | ntfs_debug("Updating mtime for inode 0x%lx: old = 0x%llx, " | 3002 | ntfs_debug("Updating mtime for inode 0x%lx: old = 0x%llx, " |
3003 | "new = 0x%llx", vi->i_ino, (long long) | 3003 | "new = 0x%llx", vi->i_ino, (long long) |
@@ -3006,7 +3006,7 @@ int __ntfs_write_inode(struct inode *vi, int sync) | |||
3006 | si->last_data_change_time = nt; | 3006 | si->last_data_change_time = nt; |
3007 | modified = true; | 3007 | modified = true; |
3008 | } | 3008 | } |
3009 | nt = utc2ntfs(vi->i_ctime); | 3009 | nt = utc2ntfs(timespec64_to_timespec(vi->i_ctime)); |
3010 | if (si->last_mft_change_time != nt) { | 3010 | if (si->last_mft_change_time != nt) { |
3011 | ntfs_debug("Updating ctime for inode 0x%lx: old = 0x%llx, " | 3011 | ntfs_debug("Updating ctime for inode 0x%lx: old = 0x%llx, " |
3012 | "new = 0x%llx", vi->i_ino, (long long) | 3012 | "new = 0x%llx", vi->i_ino, (long long) |
@@ -3015,7 +3015,7 @@ int __ntfs_write_inode(struct inode *vi, int sync) | |||
3015 | si->last_mft_change_time = nt; | 3015 | si->last_mft_change_time = nt; |
3016 | modified = true; | 3016 | modified = true; |
3017 | } | 3017 | } |
3018 | nt = utc2ntfs(vi->i_atime); | 3018 | nt = utc2ntfs(timespec64_to_timespec(vi->i_atime)); |
3019 | if (si->last_access_time != nt) { | 3019 | if (si->last_access_time != nt) { |
3020 | ntfs_debug("Updating atime for inode 0x%lx: old = 0x%llx, " | 3020 | ntfs_debug("Updating atime for inode 0x%lx: old = 0x%llx, " |
3021 | "new = 0x%llx", vi->i_ino, | 3021 | "new = 0x%llx", vi->i_ino, |
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index 68728de12864..0ff424c6d17c 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c | |||
@@ -2140,6 +2140,7 @@ static void __ocfs2_stuff_meta_lvb(struct inode *inode) | |||
2140 | struct ocfs2_inode_info *oi = OCFS2_I(inode); | 2140 | struct ocfs2_inode_info *oi = OCFS2_I(inode); |
2141 | struct ocfs2_lock_res *lockres = &oi->ip_inode_lockres; | 2141 | struct ocfs2_lock_res *lockres = &oi->ip_inode_lockres; |
2142 | struct ocfs2_meta_lvb *lvb; | 2142 | struct ocfs2_meta_lvb *lvb; |
2143 | struct timespec ts; | ||
2143 | 2144 | ||
2144 | lvb = ocfs2_dlm_lvb(&lockres->l_lksb); | 2145 | lvb = ocfs2_dlm_lvb(&lockres->l_lksb); |
2145 | 2146 | ||
@@ -2160,12 +2161,15 @@ static void __ocfs2_stuff_meta_lvb(struct inode *inode) | |||
2160 | lvb->lvb_igid = cpu_to_be32(i_gid_read(inode)); | 2161 | lvb->lvb_igid = cpu_to_be32(i_gid_read(inode)); |
2161 | lvb->lvb_imode = cpu_to_be16(inode->i_mode); | 2162 | lvb->lvb_imode = cpu_to_be16(inode->i_mode); |
2162 | lvb->lvb_inlink = cpu_to_be16(inode->i_nlink); | 2163 | lvb->lvb_inlink = cpu_to_be16(inode->i_nlink); |
2164 | ts = timespec64_to_timespec(inode->i_atime); | ||
2163 | lvb->lvb_iatime_packed = | 2165 | lvb->lvb_iatime_packed = |
2164 | cpu_to_be64(ocfs2_pack_timespec(&inode->i_atime)); | 2166 | cpu_to_be64(ocfs2_pack_timespec(&ts)); |
2167 | ts = timespec64_to_timespec(inode->i_ctime); | ||
2165 | lvb->lvb_ictime_packed = | 2168 | lvb->lvb_ictime_packed = |
2166 | cpu_to_be64(ocfs2_pack_timespec(&inode->i_ctime)); | 2169 | cpu_to_be64(ocfs2_pack_timespec(&ts)); |
2170 | ts = timespec64_to_timespec(inode->i_mtime); | ||
2167 | lvb->lvb_imtime_packed = | 2171 | lvb->lvb_imtime_packed = |
2168 | cpu_to_be64(ocfs2_pack_timespec(&inode->i_mtime)); | 2172 | cpu_to_be64(ocfs2_pack_timespec(&ts)); |
2169 | lvb->lvb_iattr = cpu_to_be32(oi->ip_attr); | 2173 | lvb->lvb_iattr = cpu_to_be32(oi->ip_attr); |
2170 | lvb->lvb_idynfeatures = cpu_to_be16(oi->ip_dyn_features); | 2174 | lvb->lvb_idynfeatures = cpu_to_be16(oi->ip_dyn_features); |
2171 | lvb->lvb_igeneration = cpu_to_be32(inode->i_generation); | 2175 | lvb->lvb_igeneration = cpu_to_be32(inode->i_generation); |
@@ -2183,6 +2187,7 @@ static void ocfs2_unpack_timespec(struct timespec *spec, | |||
2183 | 2187 | ||
2184 | static void ocfs2_refresh_inode_from_lvb(struct inode *inode) | 2188 | static void ocfs2_refresh_inode_from_lvb(struct inode *inode) |
2185 | { | 2189 | { |
2190 | struct timespec ts; | ||
2186 | struct ocfs2_inode_info *oi = OCFS2_I(inode); | 2191 | struct ocfs2_inode_info *oi = OCFS2_I(inode); |
2187 | struct ocfs2_lock_res *lockres = &oi->ip_inode_lockres; | 2192 | struct ocfs2_lock_res *lockres = &oi->ip_inode_lockres; |
2188 | struct ocfs2_meta_lvb *lvb; | 2193 | struct ocfs2_meta_lvb *lvb; |
@@ -2210,12 +2215,15 @@ static void ocfs2_refresh_inode_from_lvb(struct inode *inode) | |||
2210 | i_gid_write(inode, be32_to_cpu(lvb->lvb_igid)); | 2215 | i_gid_write(inode, be32_to_cpu(lvb->lvb_igid)); |
2211 | inode->i_mode = be16_to_cpu(lvb->lvb_imode); | 2216 | inode->i_mode = be16_to_cpu(lvb->lvb_imode); |
2212 | set_nlink(inode, be16_to_cpu(lvb->lvb_inlink)); | 2217 | set_nlink(inode, be16_to_cpu(lvb->lvb_inlink)); |
2213 | ocfs2_unpack_timespec(&inode->i_atime, | 2218 | ocfs2_unpack_timespec(&ts, |
2214 | be64_to_cpu(lvb->lvb_iatime_packed)); | 2219 | be64_to_cpu(lvb->lvb_iatime_packed)); |
2215 | ocfs2_unpack_timespec(&inode->i_mtime, | 2220 | inode->i_atime = timespec_to_timespec64(ts); |
2221 | ocfs2_unpack_timespec(&ts, | ||
2216 | be64_to_cpu(lvb->lvb_imtime_packed)); | 2222 | be64_to_cpu(lvb->lvb_imtime_packed)); |
2217 | ocfs2_unpack_timespec(&inode->i_ctime, | 2223 | inode->i_mtime = timespec_to_timespec64(ts); |
2224 | ocfs2_unpack_timespec(&ts, | ||
2218 | be64_to_cpu(lvb->lvb_ictime_packed)); | 2225 | be64_to_cpu(lvb->lvb_ictime_packed)); |
2226 | inode->i_ctime = timespec_to_timespec64(ts); | ||
2219 | spin_unlock(&oi->ip_lock); | 2227 | spin_unlock(&oi->ip_lock); |
2220 | } | 2228 | } |
2221 | 2229 | ||
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index a2a8603d27e0..255f758af03a 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -222,7 +222,7 @@ static int ocfs2_sync_file(struct file *file, loff_t start, loff_t end, | |||
222 | int ocfs2_should_update_atime(struct inode *inode, | 222 | int ocfs2_should_update_atime(struct inode *inode, |
223 | struct vfsmount *vfsmnt) | 223 | struct vfsmount *vfsmnt) |
224 | { | 224 | { |
225 | struct timespec now; | 225 | struct timespec64 now; |
226 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 226 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
227 | 227 | ||
228 | if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb)) | 228 | if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb)) |
@@ -248,8 +248,8 @@ int ocfs2_should_update_atime(struct inode *inode, | |||
248 | return 0; | 248 | return 0; |
249 | 249 | ||
250 | if (vfsmnt->mnt_flags & MNT_RELATIME) { | 250 | if (vfsmnt->mnt_flags & MNT_RELATIME) { |
251 | if ((timespec_compare(&inode->i_atime, &inode->i_mtime) <= 0) || | 251 | if ((timespec64_compare(&inode->i_atime, &inode->i_mtime) <= 0) || |
252 | (timespec_compare(&inode->i_atime, &inode->i_ctime) <= 0)) | 252 | (timespec64_compare(&inode->i_atime, &inode->i_ctime) <= 0)) |
253 | return 1; | 253 | return 1; |
254 | 254 | ||
255 | return 0; | 255 | return 0; |
diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c index d6db252e6200..6e4d2af8f5bc 100644 --- a/fs/orangefs/inode.c +++ b/fs/orangefs/inode.c | |||
@@ -297,7 +297,7 @@ int orangefs_permission(struct inode *inode, int mask) | |||
297 | return generic_permission(inode, mask); | 297 | return generic_permission(inode, mask); |
298 | } | 298 | } |
299 | 299 | ||
300 | int orangefs_update_time(struct inode *inode, struct timespec *time, int flags) | 300 | int orangefs_update_time(struct inode *inode, struct timespec64 *time, int flags) |
301 | { | 301 | { |
302 | struct iattr iattr; | 302 | struct iattr iattr; |
303 | gossip_debug(GOSSIP_INODE_DEBUG, "orangefs_update_time: %pU\n", | 303 | gossip_debug(GOSSIP_INODE_DEBUG, "orangefs_update_time: %pU\n", |
diff --git a/fs/orangefs/orangefs-kernel.h b/fs/orangefs/orangefs-kernel.h index 004511617b6d..17b24ad6b264 100644 --- a/fs/orangefs/orangefs-kernel.h +++ b/fs/orangefs/orangefs-kernel.h | |||
@@ -342,7 +342,7 @@ int orangefs_getattr(const struct path *path, struct kstat *stat, | |||
342 | 342 | ||
343 | int orangefs_permission(struct inode *inode, int mask); | 343 | int orangefs_permission(struct inode *inode, int mask); |
344 | 344 | ||
345 | int orangefs_update_time(struct inode *, struct timespec *, int); | 345 | int orangefs_update_time(struct inode *, struct timespec64 *, int); |
346 | 346 | ||
347 | /* | 347 | /* |
348 | * defined in xattr.c | 348 | * defined in xattr.c |
diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index 1db5b3b458a1..ed16a898caeb 100644 --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c | |||
@@ -416,7 +416,7 @@ int ovl_open_maybe_copy_up(struct dentry *dentry, unsigned int file_flags) | |||
416 | return err; | 416 | return err; |
417 | } | 417 | } |
418 | 418 | ||
419 | int ovl_update_time(struct inode *inode, struct timespec *ts, int flags) | 419 | int ovl_update_time(struct inode *inode, struct timespec64 *ts, int flags) |
420 | { | 420 | { |
421 | if (flags & S_ATIME) { | 421 | if (flags & S_ATIME) { |
422 | struct ovl_fs *ofs = inode->i_sb->s_fs_info; | 422 | struct ovl_fs *ofs = inode->i_sb->s_fs_info; |
diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h index 3c5e9f18b0d9..7538b9b56237 100644 --- a/fs/overlayfs/overlayfs.h +++ b/fs/overlayfs/overlayfs.h | |||
@@ -325,7 +325,7 @@ int ovl_xattr_get(struct dentry *dentry, struct inode *inode, const char *name, | |||
325 | ssize_t ovl_listxattr(struct dentry *dentry, char *list, size_t size); | 325 | ssize_t ovl_listxattr(struct dentry *dentry, char *list, size_t size); |
326 | struct posix_acl *ovl_get_acl(struct inode *inode, int type); | 326 | struct posix_acl *ovl_get_acl(struct inode *inode, int type); |
327 | int ovl_open_maybe_copy_up(struct dentry *dentry, unsigned int file_flags); | 327 | int ovl_open_maybe_copy_up(struct dentry *dentry, unsigned int file_flags); |
328 | int ovl_update_time(struct inode *inode, struct timespec *ts, int flags); | 328 | int ovl_update_time(struct inode *inode, struct timespec64 *ts, int flags); |
329 | bool ovl_is_private_xattr(const char *name); | 329 | bool ovl_is_private_xattr(const char *name); |
330 | 330 | ||
331 | struct ovl_inode_params { | 331 | struct ovl_inode_params { |
diff --git a/fs/proc/uptime.c b/fs/proc/uptime.c index 3bd12f955867..3f723cb478af 100644 --- a/fs/proc/uptime.c +++ b/fs/proc/uptime.c | |||
@@ -10,7 +10,7 @@ | |||
10 | static int uptime_proc_show(struct seq_file *m, void *v) | 10 | static int uptime_proc_show(struct seq_file *m, void *v) |
11 | { | 11 | { |
12 | struct timespec uptime; | 12 | struct timespec uptime; |
13 | struct timespec idle; | 13 | struct timespec64 idle; |
14 | u64 nsec; | 14 | u64 nsec; |
15 | u32 rem; | 15 | u32 rem; |
16 | int i; | 16 | int i; |
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index dc720573fd53..c238ab8ba31d 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c | |||
@@ -328,7 +328,7 @@ void pstore_record_init(struct pstore_record *record, | |||
328 | record->psi = psinfo; | 328 | record->psi = psinfo; |
329 | 329 | ||
330 | /* Report zeroed timestamp if called before timekeeping has resumed. */ | 330 | /* Report zeroed timestamp if called before timekeeping has resumed. */ |
331 | record->time = ns_to_timespec(ktime_get_real_fast_ns()); | 331 | record->time = ns_to_timespec64(ktime_get_real_fast_ns()); |
332 | } | 332 | } |
333 | 333 | ||
334 | /* | 334 | /* |
diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index 49b2bc114868..bbd1e357c23d 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c | |||
@@ -153,21 +153,23 @@ ramoops_get_next_prz(struct persistent_ram_zone *przs[], uint *c, uint max, | |||
153 | return prz; | 153 | return prz; |
154 | } | 154 | } |
155 | 155 | ||
156 | static int ramoops_read_kmsg_hdr(char *buffer, struct timespec *time, | 156 | static int ramoops_read_kmsg_hdr(char *buffer, struct timespec64 *time, |
157 | bool *compressed) | 157 | bool *compressed) |
158 | { | 158 | { |
159 | char data_type; | 159 | char data_type; |
160 | int header_length = 0; | 160 | int header_length = 0; |
161 | 161 | ||
162 | if (sscanf(buffer, RAMOOPS_KERNMSG_HDR "%lu.%lu-%c\n%n", &time->tv_sec, | 162 | if (sscanf(buffer, RAMOOPS_KERNMSG_HDR "%lld.%lu-%c\n%n", |
163 | &time->tv_nsec, &data_type, &header_length) == 3) { | 163 | (time64_t *)&time->tv_sec, &time->tv_nsec, &data_type, |
164 | &header_length) == 3) { | ||
164 | if (data_type == 'C') | 165 | if (data_type == 'C') |
165 | *compressed = true; | 166 | *compressed = true; |
166 | else | 167 | else |
167 | *compressed = false; | 168 | *compressed = false; |
168 | } else if (sscanf(buffer, RAMOOPS_KERNMSG_HDR "%lu.%lu\n%n", | 169 | } else if (sscanf(buffer, RAMOOPS_KERNMSG_HDR "%lld.%lu\n%n", |
169 | &time->tv_sec, &time->tv_nsec, &header_length) == 2) { | 170 | (time64_t *)&time->tv_sec, &time->tv_nsec, |
170 | *compressed = false; | 171 | &header_length) == 2) { |
172 | *compressed = false; | ||
171 | } else { | 173 | } else { |
172 | time->tv_sec = 0; | 174 | time->tv_sec = 0; |
173 | time->tv_nsec = 0; | 175 | time->tv_nsec = 0; |
@@ -360,8 +362,8 @@ static size_t ramoops_write_kmsg_hdr(struct persistent_ram_zone *prz, | |||
360 | char *hdr; | 362 | char *hdr; |
361 | size_t len; | 363 | size_t len; |
362 | 364 | ||
363 | hdr = kasprintf(GFP_ATOMIC, RAMOOPS_KERNMSG_HDR "%lu.%lu-%c\n", | 365 | hdr = kasprintf(GFP_ATOMIC, RAMOOPS_KERNMSG_HDR "%lld.%06lu-%c\n", |
364 | record->time.tv_sec, | 366 | (time64_t)record->time.tv_sec, |
365 | record->time.tv_nsec / 1000, | 367 | record->time.tv_nsec / 1000, |
366 | record->compressed ? 'C' : 'D'); | 368 | record->compressed ? 'C' : 'D'); |
367 | WARN_ON_ONCE(!hdr); | 369 | WARN_ON_ONCE(!hdr); |
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c index 5089dac02660..97f3fc4fdd79 100644 --- a/fs/reiserfs/namei.c +++ b/fs/reiserfs/namei.c | |||
@@ -1316,7 +1316,7 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1316 | int jbegin_count; | 1316 | int jbegin_count; |
1317 | umode_t old_inode_mode; | 1317 | umode_t old_inode_mode; |
1318 | unsigned long savelink = 1; | 1318 | unsigned long savelink = 1; |
1319 | struct timespec ctime; | 1319 | struct timespec64 ctime; |
1320 | 1320 | ||
1321 | if (flags & ~RENAME_NOREPLACE) | 1321 | if (flags & ~RENAME_NOREPLACE) |
1322 | return -EINVAL; | 1322 | return -EINVAL; |
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c index 5dbf5324bdda..ff94fad477e4 100644 --- a/fs/reiserfs/xattr.c +++ b/fs/reiserfs/xattr.c | |||
@@ -451,10 +451,10 @@ int reiserfs_commit_write(struct file *f, struct page *page, | |||
451 | 451 | ||
452 | static void update_ctime(struct inode *inode) | 452 | static void update_ctime(struct inode *inode) |
453 | { | 453 | { |
454 | struct timespec now = current_time(inode); | 454 | struct timespec64 now = current_time(inode); |
455 | 455 | ||
456 | if (inode_unhashed(inode) || !inode->i_nlink || | 456 | if (inode_unhashed(inode) || !inode->i_nlink || |
457 | timespec_equal(&inode->i_ctime, &now)) | 457 | timespec64_equal(&inode->i_ctime, &now)) |
458 | return; | 458 | return; |
459 | 459 | ||
460 | inode->i_ctime = current_time(inode); | 460 | inode->i_ctime = current_time(inode); |
diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index 4e267cc21c77..9da224d4f2da 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c | |||
@@ -1276,7 +1276,7 @@ static int do_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1276 | .dirtied_ino = 3 }; | 1276 | .dirtied_ino = 3 }; |
1277 | struct ubifs_budget_req ino_req = { .dirtied_ino = 1, | 1277 | struct ubifs_budget_req ino_req = { .dirtied_ino = 1, |
1278 | .dirtied_ino_d = ALIGN(old_inode_ui->data_len, 8) }; | 1278 | .dirtied_ino_d = ALIGN(old_inode_ui->data_len, 8) }; |
1279 | struct timespec time; | 1279 | struct timespec64 time; |
1280 | unsigned int uninitialized_var(saved_nlink); | 1280 | unsigned int uninitialized_var(saved_nlink); |
1281 | struct fscrypt_name old_nm, new_nm; | 1281 | struct fscrypt_name old_nm, new_nm; |
1282 | 1282 | ||
@@ -1504,7 +1504,7 @@ static int ubifs_xrename(struct inode *old_dir, struct dentry *old_dentry, | |||
1504 | int sync = IS_DIRSYNC(old_dir) || IS_DIRSYNC(new_dir); | 1504 | int sync = IS_DIRSYNC(old_dir) || IS_DIRSYNC(new_dir); |
1505 | struct inode *fst_inode = d_inode(old_dentry); | 1505 | struct inode *fst_inode = d_inode(old_dentry); |
1506 | struct inode *snd_inode = d_inode(new_dentry); | 1506 | struct inode *snd_inode = d_inode(new_dentry); |
1507 | struct timespec time; | 1507 | struct timespec64 time; |
1508 | int err; | 1508 | int err; |
1509 | struct fscrypt_name fst_nm, snd_nm; | 1509 | struct fscrypt_name fst_nm, snd_nm; |
1510 | 1510 | ||
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index 28b80713a163..fd7eb6fe9090 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c | |||
@@ -1089,14 +1089,14 @@ static void do_attr_changes(struct inode *inode, const struct iattr *attr) | |||
1089 | if (attr->ia_valid & ATTR_GID) | 1089 | if (attr->ia_valid & ATTR_GID) |
1090 | inode->i_gid = attr->ia_gid; | 1090 | inode->i_gid = attr->ia_gid; |
1091 | if (attr->ia_valid & ATTR_ATIME) | 1091 | if (attr->ia_valid & ATTR_ATIME) |
1092 | inode->i_atime = timespec_trunc(attr->ia_atime, | 1092 | inode->i_atime = timespec64_trunc(attr->ia_atime, |
1093 | inode->i_sb->s_time_gran); | 1093 | inode->i_sb->s_time_gran); |
1094 | if (attr->ia_valid & ATTR_MTIME) | 1094 | if (attr->ia_valid & ATTR_MTIME) |
1095 | inode->i_mtime = timespec_trunc(attr->ia_mtime, | 1095 | inode->i_mtime = timespec64_trunc(attr->ia_mtime, |
1096 | inode->i_sb->s_time_gran); | 1096 | inode->i_sb->s_time_gran); |
1097 | if (attr->ia_valid & ATTR_CTIME) | 1097 | if (attr->ia_valid & ATTR_CTIME) |
1098 | inode->i_ctime = timespec_trunc(attr->ia_ctime, | 1098 | inode->i_ctime = timespec64_trunc(attr->ia_ctime, |
1099 | inode->i_sb->s_time_gran); | 1099 | inode->i_sb->s_time_gran); |
1100 | if (attr->ia_valid & ATTR_MODE) { | 1100 | if (attr->ia_valid & ATTR_MODE) { |
1101 | umode_t mode = attr->ia_mode; | 1101 | umode_t mode = attr->ia_mode; |
1102 | 1102 | ||
@@ -1367,8 +1367,9 @@ out: | |||
1367 | static inline int mctime_update_needed(const struct inode *inode, | 1367 | static inline int mctime_update_needed(const struct inode *inode, |
1368 | const struct timespec *now) | 1368 | const struct timespec *now) |
1369 | { | 1369 | { |
1370 | if (!timespec_equal(&inode->i_mtime, now) || | 1370 | struct timespec64 now64 = timespec_to_timespec64(*now); |
1371 | !timespec_equal(&inode->i_ctime, now)) | 1371 | if (!timespec64_equal(&inode->i_mtime, &now64) || |
1372 | !timespec64_equal(&inode->i_ctime, &now64)) | ||
1372 | return 1; | 1373 | return 1; |
1373 | return 0; | 1374 | return 0; |
1374 | } | 1375 | } |
@@ -1380,7 +1381,7 @@ static inline int mctime_update_needed(const struct inode *inode, | |||
1380 | * | 1381 | * |
1381 | * This function updates time of the inode. | 1382 | * This function updates time of the inode. |
1382 | */ | 1383 | */ |
1383 | int ubifs_update_time(struct inode *inode, struct timespec *time, | 1384 | int ubifs_update_time(struct inode *inode, struct timespec64 *time, |
1384 | int flags) | 1385 | int flags) |
1385 | { | 1386 | { |
1386 | struct ubifs_inode *ui = ubifs_inode(inode); | 1387 | struct ubifs_inode *ui = ubifs_inode(inode); |
@@ -1424,7 +1425,7 @@ int ubifs_update_time(struct inode *inode, struct timespec *time, | |||
1424 | */ | 1425 | */ |
1425 | static int update_mctime(struct inode *inode) | 1426 | static int update_mctime(struct inode *inode) |
1426 | { | 1427 | { |
1427 | struct timespec now = current_time(inode); | 1428 | struct timespec now = timespec64_to_timespec(current_time(inode)); |
1428 | struct ubifs_inode *ui = ubifs_inode(inode); | 1429 | struct ubifs_inode *ui = ubifs_inode(inode); |
1429 | struct ubifs_info *c = inode->i_sb->s_fs_info; | 1430 | struct ubifs_info *c = inode->i_sb->s_fs_info; |
1430 | 1431 | ||
@@ -1518,7 +1519,7 @@ static vm_fault_t ubifs_vm_page_mkwrite(struct vm_fault *vmf) | |||
1518 | struct page *page = vmf->page; | 1519 | struct page *page = vmf->page; |
1519 | struct inode *inode = file_inode(vmf->vma->vm_file); | 1520 | struct inode *inode = file_inode(vmf->vma->vm_file); |
1520 | struct ubifs_info *c = inode->i_sb->s_fs_info; | 1521 | struct ubifs_info *c = inode->i_sb->s_fs_info; |
1521 | struct timespec now = current_time(inode); | 1522 | struct timespec now = timespec64_to_timespec(current_time(inode)); |
1522 | struct ubifs_budget_req req = { .new_page = 1 }; | 1523 | struct ubifs_budget_req req = { .new_page = 1 }; |
1523 | int err, update_time; | 1524 | int err, update_time; |
1524 | 1525 | ||
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index 209d6369ae71..04bf84d71e7b 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h | |||
@@ -1738,7 +1738,7 @@ int ubifs_calc_dark(const struct ubifs_info *c, int spc); | |||
1738 | int ubifs_fsync(struct file *file, loff_t start, loff_t end, int datasync); | 1738 | int ubifs_fsync(struct file *file, loff_t start, loff_t end, int datasync); |
1739 | int ubifs_setattr(struct dentry *dentry, struct iattr *attr); | 1739 | int ubifs_setattr(struct dentry *dentry, struct iattr *attr); |
1740 | #ifdef CONFIG_UBIFS_ATIME_SUPPORT | 1740 | #ifdef CONFIG_UBIFS_ATIME_SUPPORT |
1741 | int ubifs_update_time(struct inode *inode, struct timespec *time, int flags); | 1741 | int ubifs_update_time(struct inode *inode, struct timespec64 *time, int flags); |
1742 | #endif | 1742 | #endif |
1743 | 1743 | ||
1744 | /* dir.c */ | 1744 | /* dir.c */ |
diff --git a/fs/udf/ialloc.c b/fs/udf/ialloc.c index b7a0d4b4bda1..56569023783b 100644 --- a/fs/udf/ialloc.c +++ b/fs/udf/ialloc.c | |||
@@ -124,8 +124,8 @@ struct inode *udf_new_inode(struct inode *dir, umode_t mode) | |||
124 | iinfo->i_alloc_type = ICBTAG_FLAG_AD_SHORT; | 124 | iinfo->i_alloc_type = ICBTAG_FLAG_AD_SHORT; |
125 | else | 125 | else |
126 | iinfo->i_alloc_type = ICBTAG_FLAG_AD_LONG; | 126 | iinfo->i_alloc_type = ICBTAG_FLAG_AD_LONG; |
127 | inode->i_mtime = inode->i_atime = inode->i_ctime = | 127 | inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); |
128 | iinfo->i_crtime = current_time(inode); | 128 | iinfo->i_crtime = timespec64_to_timespec(inode->i_mtime); |
129 | if (unlikely(insert_inode_locked(inode) < 0)) { | 129 | if (unlikely(insert_inode_locked(inode) < 0)) { |
130 | make_bad_inode(inode); | 130 | make_bad_inode(inode); |
131 | iput(inode); | 131 | iput(inode); |
diff --git a/fs/udf/inode.c b/fs/udf/inode.c index c80765d62f7e..7f39d17352c9 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c | |||
@@ -1271,6 +1271,7 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode) | |||
1271 | struct udf_inode_info *iinfo = UDF_I(inode); | 1271 | struct udf_inode_info *iinfo = UDF_I(inode); |
1272 | struct udf_sb_info *sbi = UDF_SB(inode->i_sb); | 1272 | struct udf_sb_info *sbi = UDF_SB(inode->i_sb); |
1273 | struct kernel_lb_addr *iloc = &iinfo->i_location; | 1273 | struct kernel_lb_addr *iloc = &iinfo->i_location; |
1274 | struct timespec ts; | ||
1274 | unsigned int link_count; | 1275 | unsigned int link_count; |
1275 | unsigned int indirections = 0; | 1276 | unsigned int indirections = 0; |
1276 | int bs = inode->i_sb->s_blocksize; | 1277 | int bs = inode->i_sb->s_blocksize; |
@@ -1443,15 +1444,12 @@ reread: | |||
1443 | inode->i_blocks = le64_to_cpu(fe->logicalBlocksRecorded) << | 1444 | inode->i_blocks = le64_to_cpu(fe->logicalBlocksRecorded) << |
1444 | (inode->i_sb->s_blocksize_bits - 9); | 1445 | (inode->i_sb->s_blocksize_bits - 9); |
1445 | 1446 | ||
1446 | if (!udf_disk_stamp_to_time(&inode->i_atime, fe->accessTime)) | 1447 | udf_disk_stamp_to_time(&ts, fe->accessTime); |
1447 | inode->i_atime = sbi->s_record_time; | 1448 | inode->i_atime = timespec_to_timespec64(ts); |
1448 | 1449 | udf_disk_stamp_to_time(&ts, fe->modificationTime); | |
1449 | if (!udf_disk_stamp_to_time(&inode->i_mtime, | 1450 | inode->i_mtime = timespec_to_timespec64(ts); |
1450 | fe->modificationTime)) | 1451 | udf_disk_stamp_to_time(&ts, fe->attrTime); |
1451 | inode->i_mtime = sbi->s_record_time; | 1452 | inode->i_ctime = timespec_to_timespec64(ts); |
1452 | |||
1453 | if (!udf_disk_stamp_to_time(&inode->i_ctime, fe->attrTime)) | ||
1454 | inode->i_ctime = sbi->s_record_time; | ||
1455 | 1453 | ||
1456 | iinfo->i_unique = le64_to_cpu(fe->uniqueID); | 1454 | iinfo->i_unique = le64_to_cpu(fe->uniqueID); |
1457 | iinfo->i_lenEAttr = le32_to_cpu(fe->lengthExtendedAttr); | 1455 | iinfo->i_lenEAttr = le32_to_cpu(fe->lengthExtendedAttr); |
@@ -1461,18 +1459,13 @@ reread: | |||
1461 | inode->i_blocks = le64_to_cpu(efe->logicalBlocksRecorded) << | 1459 | inode->i_blocks = le64_to_cpu(efe->logicalBlocksRecorded) << |
1462 | (inode->i_sb->s_blocksize_bits - 9); | 1460 | (inode->i_sb->s_blocksize_bits - 9); |
1463 | 1461 | ||
1464 | if (!udf_disk_stamp_to_time(&inode->i_atime, efe->accessTime)) | 1462 | udf_disk_stamp_to_time(&ts, efe->accessTime); |
1465 | inode->i_atime = sbi->s_record_time; | 1463 | inode->i_atime = timespec_to_timespec64(ts); |
1466 | 1464 | udf_disk_stamp_to_time(&ts, efe->modificationTime); | |
1467 | if (!udf_disk_stamp_to_time(&inode->i_mtime, | 1465 | inode->i_mtime = timespec_to_timespec64(ts); |
1468 | efe->modificationTime)) | 1466 | udf_disk_stamp_to_time(&iinfo->i_crtime, efe->createTime); |
1469 | inode->i_mtime = sbi->s_record_time; | 1467 | udf_disk_stamp_to_time(&ts, efe->attrTime); |
1470 | 1468 | inode->i_ctime = timespec_to_timespec64(ts); | |
1471 | if (!udf_disk_stamp_to_time(&iinfo->i_crtime, efe->createTime)) | ||
1472 | iinfo->i_crtime = sbi->s_record_time; | ||
1473 | |||
1474 | if (!udf_disk_stamp_to_time(&inode->i_ctime, efe->attrTime)) | ||
1475 | inode->i_ctime = sbi->s_record_time; | ||
1476 | 1469 | ||
1477 | iinfo->i_unique = le64_to_cpu(efe->uniqueID); | 1470 | iinfo->i_unique = le64_to_cpu(efe->uniqueID); |
1478 | iinfo->i_lenEAttr = le32_to_cpu(efe->lengthExtendedAttr); | 1471 | iinfo->i_lenEAttr = le32_to_cpu(efe->lengthExtendedAttr); |
@@ -1722,9 +1715,12 @@ static int udf_update_inode(struct inode *inode, int do_sync) | |||
1722 | inode->i_sb->s_blocksize - sizeof(struct fileEntry)); | 1715 | inode->i_sb->s_blocksize - sizeof(struct fileEntry)); |
1723 | fe->logicalBlocksRecorded = cpu_to_le64(lb_recorded); | 1716 | fe->logicalBlocksRecorded = cpu_to_le64(lb_recorded); |
1724 | 1717 | ||
1725 | udf_time_to_disk_stamp(&fe->accessTime, inode->i_atime); | 1718 | udf_time_to_disk_stamp(&fe->accessTime, |
1726 | udf_time_to_disk_stamp(&fe->modificationTime, inode->i_mtime); | 1719 | timespec64_to_timespec(inode->i_atime)); |
1727 | udf_time_to_disk_stamp(&fe->attrTime, inode->i_ctime); | 1720 | udf_time_to_disk_stamp(&fe->modificationTime, |
1721 | timespec64_to_timespec(inode->i_mtime)); | ||
1722 | udf_time_to_disk_stamp(&fe->attrTime, | ||
1723 | timespec64_to_timespec(inode->i_ctime)); | ||
1728 | memset(&(fe->impIdent), 0, sizeof(struct regid)); | 1724 | memset(&(fe->impIdent), 0, sizeof(struct regid)); |
1729 | strcpy(fe->impIdent.ident, UDF_ID_DEVELOPER); | 1725 | strcpy(fe->impIdent.ident, UDF_ID_DEVELOPER); |
1730 | fe->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX; | 1726 | fe->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX; |
@@ -1743,14 +1739,17 @@ static int udf_update_inode(struct inode *inode, int do_sync) | |||
1743 | efe->objectSize = cpu_to_le64(inode->i_size); | 1739 | efe->objectSize = cpu_to_le64(inode->i_size); |
1744 | efe->logicalBlocksRecorded = cpu_to_le64(lb_recorded); | 1740 | efe->logicalBlocksRecorded = cpu_to_le64(lb_recorded); |
1745 | 1741 | ||
1746 | udf_adjust_time(iinfo, inode->i_atime); | 1742 | udf_adjust_time(iinfo, timespec64_to_timespec(inode->i_atime)); |
1747 | udf_adjust_time(iinfo, inode->i_mtime); | 1743 | udf_adjust_time(iinfo, timespec64_to_timespec(inode->i_mtime)); |
1748 | udf_adjust_time(iinfo, inode->i_ctime); | 1744 | udf_adjust_time(iinfo, timespec64_to_timespec(inode->i_ctime)); |
1749 | 1745 | ||
1750 | udf_time_to_disk_stamp(&efe->accessTime, inode->i_atime); | 1746 | udf_time_to_disk_stamp(&efe->accessTime, |
1751 | udf_time_to_disk_stamp(&efe->modificationTime, inode->i_mtime); | 1747 | timespec64_to_timespec(inode->i_atime)); |
1748 | udf_time_to_disk_stamp(&efe->modificationTime, | ||
1749 | timespec64_to_timespec(inode->i_mtime)); | ||
1752 | udf_time_to_disk_stamp(&efe->createTime, iinfo->i_crtime); | 1750 | udf_time_to_disk_stamp(&efe->createTime, iinfo->i_crtime); |
1753 | udf_time_to_disk_stamp(&efe->attrTime, inode->i_ctime); | 1751 | udf_time_to_disk_stamp(&efe->attrTime, |
1752 | timespec64_to_timespec(inode->i_ctime)); | ||
1754 | 1753 | ||
1755 | memset(&(efe->impIdent), 0, sizeof(efe->impIdent)); | 1754 | memset(&(efe->impIdent), 0, sizeof(efe->impIdent)); |
1756 | strcpy(efe->impIdent.ident, UDF_ID_DEVELOPER); | 1755 | strcpy(efe->impIdent.ident, UDF_ID_DEVELOPER); |
diff --git a/fs/udf/super.c b/fs/udf/super.c index fc77ea736da7..0c504c8031d3 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c | |||
@@ -862,6 +862,9 @@ static int udf_load_pvoldesc(struct super_block *sb, sector_t block) | |||
862 | struct buffer_head *bh; | 862 | struct buffer_head *bh; |
863 | uint16_t ident; | 863 | uint16_t ident; |
864 | int ret = -ENOMEM; | 864 | int ret = -ENOMEM; |
865 | #ifdef UDFFS_DEBUG | ||
866 | struct timestamp *ts; | ||
867 | #endif | ||
865 | 868 | ||
866 | outstr = kmalloc(128, GFP_NOFS); | 869 | outstr = kmalloc(128, GFP_NOFS); |
867 | if (!outstr) | 870 | if (!outstr) |
@@ -880,15 +883,15 @@ static int udf_load_pvoldesc(struct super_block *sb, sector_t block) | |||
880 | 883 | ||
881 | pvoldesc = (struct primaryVolDesc *)bh->b_data; | 884 | pvoldesc = (struct primaryVolDesc *)bh->b_data; |
882 | 885 | ||
883 | if (udf_disk_stamp_to_time(&UDF_SB(sb)->s_record_time, | 886 | udf_disk_stamp_to_time(&UDF_SB(sb)->s_record_time, |
884 | pvoldesc->recordingDateAndTime)) { | 887 | pvoldesc->recordingDateAndTime); |
885 | #ifdef UDFFS_DEBUG | 888 | #ifdef UDFFS_DEBUG |
886 | struct timestamp *ts = &pvoldesc->recordingDateAndTime; | 889 | ts = &pvoldesc->recordingDateAndTime; |
887 | udf_debug("recording time %04u/%02u/%02u %02u:%02u (%x)\n", | 890 | udf_debug("recording time %04u/%02u/%02u %02u:%02u (%x)\n", |
888 | le16_to_cpu(ts->year), ts->month, ts->day, ts->hour, | 891 | le16_to_cpu(ts->year), ts->month, ts->day, ts->hour, |
889 | ts->minute, le16_to_cpu(ts->typeAndTimezone)); | 892 | ts->minute, le16_to_cpu(ts->typeAndTimezone)); |
890 | #endif | 893 | #endif |
891 | } | 894 | |
892 | 895 | ||
893 | ret = udf_dstrCS0toChar(sb, outstr, 31, pvoldesc->volIdent, 32); | 896 | ret = udf_dstrCS0toChar(sb, outstr, 31, pvoldesc->volIdent, 32); |
894 | if (ret < 0) | 897 | if (ret < 0) |
diff --git a/fs/udf/udfdecl.h b/fs/udf/udfdecl.h index fc8d1b3384d2..bae311b59400 100644 --- a/fs/udf/udfdecl.h +++ b/fs/udf/udfdecl.h | |||
@@ -253,8 +253,8 @@ extern struct long_ad *udf_get_filelongad(uint8_t *, int, uint32_t *, int); | |||
253 | extern struct short_ad *udf_get_fileshortad(uint8_t *, int, uint32_t *, int); | 253 | extern struct short_ad *udf_get_fileshortad(uint8_t *, int, uint32_t *, int); |
254 | 254 | ||
255 | /* udftime.c */ | 255 | /* udftime.c */ |
256 | extern struct timespec *udf_disk_stamp_to_time(struct timespec *dest, | 256 | extern void udf_disk_stamp_to_time(struct timespec *dest, |
257 | struct timestamp src); | 257 | struct timestamp src); |
258 | extern struct timestamp *udf_time_to_disk_stamp(struct timestamp *dest, struct timespec src); | 258 | extern void udf_time_to_disk_stamp(struct timestamp *dest, struct timespec src); |
259 | 259 | ||
260 | #endif /* __UDF_DECL_H */ | 260 | #endif /* __UDF_DECL_H */ |
diff --git a/fs/udf/udftime.c b/fs/udf/udftime.c index 0927a4b2ecaf..67b33ac5d41b 100644 --- a/fs/udf/udftime.c +++ b/fs/udf/udftime.c | |||
@@ -40,7 +40,7 @@ | |||
40 | #include <linux/kernel.h> | 40 | #include <linux/kernel.h> |
41 | #include <linux/time.h> | 41 | #include <linux/time.h> |
42 | 42 | ||
43 | struct timespec * | 43 | void |
44 | udf_disk_stamp_to_time(struct timespec *dest, struct timestamp src) | 44 | udf_disk_stamp_to_time(struct timespec *dest, struct timestamp src) |
45 | { | 45 | { |
46 | u16 typeAndTimezone = le16_to_cpu(src.typeAndTimezone); | 46 | u16 typeAndTimezone = le16_to_cpu(src.typeAndTimezone); |
@@ -67,10 +67,9 @@ udf_disk_stamp_to_time(struct timespec *dest, struct timestamp src) | |||
67 | * recorded with bogus sub-second values. | 67 | * recorded with bogus sub-second values. |
68 | */ | 68 | */ |
69 | dest->tv_nsec %= NSEC_PER_SEC; | 69 | dest->tv_nsec %= NSEC_PER_SEC; |
70 | return dest; | ||
71 | } | 70 | } |
72 | 71 | ||
73 | struct timestamp * | 72 | void |
74 | udf_time_to_disk_stamp(struct timestamp *dest, struct timespec ts) | 73 | udf_time_to_disk_stamp(struct timestamp *dest, struct timespec ts) |
75 | { | 74 | { |
76 | long seconds; | 75 | long seconds; |
@@ -79,9 +78,6 @@ udf_time_to_disk_stamp(struct timestamp *dest, struct timespec ts) | |||
79 | 78 | ||
80 | offset = -sys_tz.tz_minuteswest; | 79 | offset = -sys_tz.tz_minuteswest; |
81 | 80 | ||
82 | if (!dest) | ||
83 | return NULL; | ||
84 | |||
85 | dest->typeAndTimezone = cpu_to_le16(0x1000 | (offset & 0x0FFF)); | 81 | dest->typeAndTimezone = cpu_to_le16(0x1000 | (offset & 0x0FFF)); |
86 | 82 | ||
87 | seconds = ts.tv_sec + offset * 60; | 83 | seconds = ts.tv_sec + offset * 60; |
@@ -97,7 +93,6 @@ udf_time_to_disk_stamp(struct timestamp *dest, struct timespec ts) | |||
97 | dest->centiseconds * 10000) / 100; | 93 | dest->centiseconds * 10000) / 100; |
98 | dest->microseconds = (ts.tv_nsec / 1000 - dest->centiseconds * 10000 - | 94 | dest->microseconds = (ts.tv_nsec / 1000 - dest->centiseconds * 10000 - |
99 | dest->hundredsOfMicroseconds * 100); | 95 | dest->hundredsOfMicroseconds * 100); |
100 | return dest; | ||
101 | } | 96 | } |
102 | 97 | ||
103 | /* EOF */ | 98 | /* EOF */ |
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 4a2e5e13c569..7a96c4e0ab5c 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -761,7 +761,7 @@ xfs_ialloc( | |||
761 | xfs_inode_t *ip; | 761 | xfs_inode_t *ip; |
762 | uint flags; | 762 | uint flags; |
763 | int error; | 763 | int error; |
764 | struct timespec tv; | 764 | struct timespec64 tv; |
765 | struct inode *inode; | 765 | struct inode *inode; |
766 | 766 | ||
767 | /* | 767 | /* |
diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index 1fce707406c6..0fa29f39d658 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c | |||
@@ -1042,7 +1042,7 @@ xfs_vn_setattr( | |||
1042 | STATIC int | 1042 | STATIC int |
1043 | xfs_vn_update_time( | 1043 | xfs_vn_update_time( |
1044 | struct inode *inode, | 1044 | struct inode *inode, |
1045 | struct timespec *now, | 1045 | struct timespec64 *now, |
1046 | int flags) | 1046 | int flags) |
1047 | { | 1047 | { |
1048 | struct xfs_inode *ip = XFS_I(inode); | 1048 | struct xfs_inode *ip = XFS_I(inode); |
diff --git a/fs/xfs/xfs_trans_inode.c b/fs/xfs/xfs_trans_inode.c index e2963a6033b2..542927321a61 100644 --- a/fs/xfs/xfs_trans_inode.c +++ b/fs/xfs/xfs_trans_inode.c | |||
@@ -58,7 +58,7 @@ xfs_trans_ichgtime( | |||
58 | int flags) | 58 | int flags) |
59 | { | 59 | { |
60 | struct inode *inode = VFS_I(ip); | 60 | struct inode *inode = VFS_I(ip); |
61 | struct timespec tv; | 61 | struct timespec64 tv; |
62 | 62 | ||
63 | ASSERT(tp); | 63 | ASSERT(tp); |
64 | ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); | 64 | ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 7207de8c4e9a..5c91108846db 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -207,9 +207,9 @@ struct iattr { | |||
207 | kuid_t ia_uid; | 207 | kuid_t ia_uid; |
208 | kgid_t ia_gid; | 208 | kgid_t ia_gid; |
209 | loff_t ia_size; | 209 | loff_t ia_size; |
210 | struct timespec ia_atime; | 210 | struct timespec64 ia_atime; |
211 | struct timespec ia_mtime; | 211 | struct timespec64 ia_mtime; |
212 | struct timespec ia_ctime; | 212 | struct timespec64 ia_ctime; |
213 | 213 | ||
214 | /* | 214 | /* |
215 | * Not an attribute, but an auxiliary info for filesystems wanting to | 215 | * Not an attribute, but an auxiliary info for filesystems wanting to |
@@ -604,9 +604,9 @@ struct inode { | |||
604 | }; | 604 | }; |
605 | dev_t i_rdev; | 605 | dev_t i_rdev; |
606 | loff_t i_size; | 606 | loff_t i_size; |
607 | struct timespec i_atime; | 607 | struct timespec64 i_atime; |
608 | struct timespec i_mtime; | 608 | struct timespec64 i_mtime; |
609 | struct timespec i_ctime; | 609 | struct timespec64 i_ctime; |
610 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ | 610 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ |
611 | unsigned short i_bytes; | 611 | unsigned short i_bytes; |
612 | unsigned int i_blkbits; | 612 | unsigned int i_blkbits; |
@@ -1093,7 +1093,7 @@ extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct | |||
1093 | extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl); | 1093 | extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl); |
1094 | extern int locks_lock_inode_wait(struct inode *inode, struct file_lock *fl); | 1094 | extern int locks_lock_inode_wait(struct inode *inode, struct file_lock *fl); |
1095 | extern int __break_lease(struct inode *inode, unsigned int flags, unsigned int type); | 1095 | extern int __break_lease(struct inode *inode, unsigned int flags, unsigned int type); |
1096 | extern void lease_get_mtime(struct inode *, struct timespec *time); | 1096 | extern void lease_get_mtime(struct inode *, struct timespec64 *time); |
1097 | extern int generic_setlease(struct file *, long, struct file_lock **, void **priv); | 1097 | extern int generic_setlease(struct file *, long, struct file_lock **, void **priv); |
1098 | extern int vfs_setlease(struct file *, long, struct file_lock **, void **); | 1098 | extern int vfs_setlease(struct file *, long, struct file_lock **, void **); |
1099 | extern int lease_modify(struct file_lock *, int, struct list_head *); | 1099 | extern int lease_modify(struct file_lock *, int, struct list_head *); |
@@ -1208,7 +1208,8 @@ static inline int __break_lease(struct inode *inode, unsigned int mode, unsigned | |||
1208 | return 0; | 1208 | return 0; |
1209 | } | 1209 | } |
1210 | 1210 | ||
1211 | static inline void lease_get_mtime(struct inode *inode, struct timespec *time) | 1211 | static inline void lease_get_mtime(struct inode *inode, |
1212 | struct timespec64 *time) | ||
1212 | { | 1213 | { |
1213 | return; | 1214 | return; |
1214 | } | 1215 | } |
@@ -1478,7 +1479,8 @@ static inline void i_gid_write(struct inode *inode, gid_t gid) | |||
1478 | inode->i_gid = make_kgid(inode->i_sb->s_user_ns, gid); | 1479 | inode->i_gid = make_kgid(inode->i_sb->s_user_ns, gid); |
1479 | } | 1480 | } |
1480 | 1481 | ||
1481 | extern struct timespec current_time(struct inode *inode); | 1482 | extern struct timespec64 timespec64_trunc(struct timespec64 t, unsigned gran); |
1483 | extern struct timespec64 current_time(struct inode *inode); | ||
1482 | 1484 | ||
1483 | /* | 1485 | /* |
1484 | * Snapshotting support. | 1486 | * Snapshotting support. |
@@ -1773,7 +1775,7 @@ struct inode_operations { | |||
1773 | ssize_t (*listxattr) (struct dentry *, char *, size_t); | 1775 | ssize_t (*listxattr) (struct dentry *, char *, size_t); |
1774 | int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, | 1776 | int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, |
1775 | u64 len); | 1777 | u64 len); |
1776 | int (*update_time)(struct inode *, struct timespec *, int); | 1778 | int (*update_time)(struct inode *, struct timespec64 *, int); |
1777 | int (*atomic_open)(struct inode *, struct dentry *, | 1779 | int (*atomic_open)(struct inode *, struct dentry *, |
1778 | struct file *, unsigned open_flag, | 1780 | struct file *, unsigned open_flag, |
1779 | umode_t create_mode, int *opened); | 1781 | umode_t create_mode, int *opened); |
@@ -2217,7 +2219,7 @@ extern int current_umask(void); | |||
2217 | 2219 | ||
2218 | extern void ihold(struct inode * inode); | 2220 | extern void ihold(struct inode * inode); |
2219 | extern void iput(struct inode *); | 2221 | extern void iput(struct inode *); |
2220 | extern int generic_update_time(struct inode *, struct timespec *, int); | 2222 | extern int generic_update_time(struct inode *, struct timespec64 *, int); |
2221 | 2223 | ||
2222 | /* /sys/fs */ | 2224 | /* /sys/fs */ |
2223 | extern struct kobject *fs_kobj; | 2225 | extern struct kobject *fs_kobj; |
diff --git a/include/linux/pstore.h b/include/linux/pstore.h index 61f806a7fe29..a15bc4d48752 100644 --- a/include/linux/pstore.h +++ b/include/linux/pstore.h | |||
@@ -71,7 +71,7 @@ struct pstore_record { | |||
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; |
diff --git a/include/linux/stat.h b/include/linux/stat.h index 22484e44544d..765573dc17d6 100644 --- a/include/linux/stat.h +++ b/include/linux/stat.h | |||
@@ -41,10 +41,10 @@ struct kstat { | |||
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 | ||