Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'vfs-timespec64' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground

Pull inode timestamps conversion to timespec64 from Arnd Bergmann:
"This is a late set of changes from Deepa Dinamani doing an automated
treewide conversion of the inode and iattr structures from 'timespec'
to 'timespec64', to push the conversion from the VFS layer into the
individual file systems.

As Deepa writes:

'The series aims to switch vfs timestamps to use struct timespec64.
Currently vfs uses struct timespec, which is not y2038 safe.

The series involves the following:
1. Add vfs helper functions for supporting struct timepec64
timestamps.
2. Cast prints of vfs timestamps to avoid warnings after the switch.
3. Simplify code using vfs timestamps so that the actual replacement
becomes easy.
4. Convert vfs timestamps to use struct timespec64 using a script.
This is a flag day patch.

Next steps:
1. Convert APIs that can handle timespec64, instead of converting
timestamps at the boundaries.
2. Update internal data structures to avoid timestamp conversions'

Thomas Gleixner adds:

'I think there is no point to drag that out for the next merge
window. The whole thing needs to be done in one go for the core
changes which means that you're going to play that catchup game
forever. Let's get over with it towards the end of the merge window'"

* tag 'vfs-timespec64' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground:
pstore: Remove bogus format string definition
vfs: change inode times to use struct timespec64
pstore: Convert internal records to timespec64
udf: Simplify calls to udf_disk_stamp_to_time
fs: nfs: get rid of memcpys for inode times
ceph: make inode time prints to be long long
lustre: Use long long type to print inode time
fs: add timespec64_truncate()

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