diff options
79 files changed, 448 insertions, 346 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 7c838b90a31d..aba59521ad48 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c | |||
@@ -867,8 +867,13 @@ static ssize_t tty_read(struct file *file, char __user *buf, size_t count, | |||
867 | i = -EIO; | 867 | i = -EIO; |
868 | tty_ldisc_deref(ld); | 868 | tty_ldisc_deref(ld); |
869 | 869 | ||
870 | if (i > 0) | 870 | if (i > 0) { |
871 | tty_update_time(&inode->i_atime); | 871 | struct timespec ts; |
872 | |||
873 | ts = timespec64_to_timespec(inode->i_atime); | ||
874 | tty_update_time(&ts); | ||
875 | inode->i_atime = timespec_to_timespec64(ts); | ||
876 | } | ||
872 | 877 | ||
873 | return i; | 878 | return i; |
874 | } | 879 | } |
@@ -969,7 +974,11 @@ static inline ssize_t do_tty_write( | |||
969 | cond_resched(); | 974 | cond_resched(); |
970 | } | 975 | } |
971 | if (written) { | 976 | if (written) { |
972 | tty_update_time(&file_inode(file)->i_mtime); | 977 | struct timespec ts; |
978 | |||
979 | ts = timespec64_to_timespec(file_inode(file)->i_mtime); | ||
980 | tty_update_time(&ts); | ||
981 | file_inode(file)->i_mtime = timespec_to_timespec64(ts); | ||
973 | ret = written; | 982 | ret = written; |
974 | } | 983 | } |
975 | out: | 984 | out: |
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index 0294e4f18873..d8a532fb935d 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c | |||
@@ -1297,7 +1297,7 @@ ffs_sb_make_inode(struct super_block *sb, void *data, | |||
1297 | inode = new_inode(sb); | 1297 | inode = new_inode(sb); |
1298 | 1298 | ||
1299 | if (likely(inode)) { | 1299 | if (likely(inode)) { |
1300 | struct timespec ts = current_time(inode); | 1300 | struct timespec64 ts = current_time(inode); |
1301 | 1301 | ||
1302 | inode->i_ino = get_next_ino(); | 1302 | inode->i_ino = get_next_ino(); |
1303 | inode->i_mode = perms->mode; | 1303 | inode->i_mode = perms->mode; |
diff --git a/fs/adfs/inode.c b/fs/adfs/inode.c index 8dbd36f5e581..c836c425ca94 100644 --- a/fs/adfs/inode.c +++ b/fs/adfs/inode.c | |||
@@ -199,7 +199,7 @@ adfs_adfs2unix_time(struct timespec *tv, struct inode *inode) | |||
199 | return; | 199 | return; |
200 | 200 | ||
201 | cur_time: | 201 | cur_time: |
202 | *tv = current_time(inode); | 202 | *tv = timespec64_to_timespec(current_time(inode)); |
203 | return; | 203 | return; |
204 | 204 | ||
205 | too_early: | 205 | too_early: |
@@ -242,6 +242,7 @@ adfs_unix2adfs_time(struct inode *inode, unsigned int secs) | |||
242 | struct inode * | 242 | struct inode * |
243 | adfs_iget(struct super_block *sb, struct object_info *obj) | 243 | adfs_iget(struct super_block *sb, struct object_info *obj) |
244 | { | 244 | { |
245 | struct timespec ts; | ||
245 | struct inode *inode; | 246 | struct inode *inode; |
246 | 247 | ||
247 | inode = new_inode(sb); | 248 | inode = new_inode(sb); |
@@ -270,7 +271,9 @@ adfs_iget(struct super_block *sb, struct object_info *obj) | |||
270 | ADFS_I(inode)->stamped = ((obj->loadaddr & 0xfff00000) == 0xfff00000); | 271 | ADFS_I(inode)->stamped = ((obj->loadaddr & 0xfff00000) == 0xfff00000); |
271 | 272 | ||
272 | inode->i_mode = adfs_atts2mode(sb, inode); | 273 | inode->i_mode = adfs_atts2mode(sb, inode); |
273 | adfs_adfs2unix_time(&inode->i_mtime, inode); | 274 | ts = timespec64_to_timespec(inode->i_mtime); |
275 | adfs_adfs2unix_time(&ts, inode); | ||
276 | inode->i_mtime = timespec_to_timespec64(ts); | ||
274 | inode->i_atime = inode->i_mtime; | 277 | inode->i_atime = inode->i_mtime; |
275 | inode->i_ctime = inode->i_mtime; | 278 | inode->i_ctime = inode->i_mtime; |
276 | 279 | ||
diff --git a/fs/afs/fsclient.c b/fs/afs/fsclient.c index b273e1d60478..5907601aafd0 100644 --- a/fs/afs/fsclient.c +++ b/fs/afs/fsclient.c | |||
@@ -72,7 +72,7 @@ void afs_update_inode_from_status(struct afs_vnode *vnode, | |||
72 | const afs_dataversion_t *expected_version, | 72 | const afs_dataversion_t *expected_version, |
73 | u8 flags) | 73 | u8 flags) |
74 | { | 74 | { |
75 | struct timespec t; | 75 | struct timespec64 t; |
76 | umode_t mode; | 76 | umode_t mode; |
77 | 77 | ||
78 | t.tv_sec = status->mtime_client; | 78 | t.tv_sec = status->mtime_client; |
@@ -163,14 +163,14 @@ void setattr_copy(struct inode *inode, const struct iattr *attr) | |||
163 | if (ia_valid & ATTR_GID) | 163 | if (ia_valid & ATTR_GID) |
164 | inode->i_gid = attr->ia_gid; | 164 | inode->i_gid = attr->ia_gid; |
165 | if (ia_valid & ATTR_ATIME) | 165 | if (ia_valid & ATTR_ATIME) |
166 | inode->i_atime = timespec_trunc(attr->ia_atime, | 166 | inode->i_atime = timespec64_trunc(attr->ia_atime, |
167 | inode->i_sb->s_time_gran); | 167 | inode->i_sb->s_time_gran); |
168 | if (ia_valid & ATTR_MTIME) | 168 | if (ia_valid & ATTR_MTIME) |
169 | inode->i_mtime = timespec_trunc(attr->ia_mtime, | 169 | inode->i_mtime = timespec64_trunc(attr->ia_mtime, |
170 | inode->i_sb->s_time_gran); | 170 | inode->i_sb->s_time_gran); |
171 | if (ia_valid & ATTR_CTIME) | 171 | if (ia_valid & ATTR_CTIME) |
172 | inode->i_ctime = timespec_trunc(attr->ia_ctime, | 172 | inode->i_ctime = timespec64_trunc(attr->ia_ctime, |
173 | inode->i_sb->s_time_gran); | 173 | inode->i_sb->s_time_gran); |
174 | if (ia_valid & ATTR_MODE) { | 174 | if (ia_valid & ATTR_MODE) { |
175 | umode_t mode = attr->ia_mode; | 175 | umode_t mode = attr->ia_mode; |
176 | 176 | ||
@@ -207,7 +207,7 @@ int notify_change(struct dentry * dentry, struct iattr * attr, struct inode **de | |||
207 | struct inode *inode = dentry->d_inode; | 207 | struct inode *inode = dentry->d_inode; |
208 | umode_t mode = inode->i_mode; | 208 | umode_t mode = inode->i_mode; |
209 | int error; | 209 | int error; |
210 | struct timespec now; | 210 | struct timespec64 now; |
211 | unsigned int ia_valid = attr->ia_valid; | 211 | unsigned int ia_valid = attr->ia_valid; |
212 | 212 | ||
213 | WARN_ON_ONCE(!inode_is_locked(inode)); | 213 | WARN_ON_ONCE(!inode_is_locked(inode)); |
diff --git a/fs/bad_inode.c b/fs/bad_inode.c index 213b51dbbb60..125e8bbd22a2 100644 --- a/fs/bad_inode.c +++ b/fs/bad_inode.c | |||
@@ -126,7 +126,7 @@ static int bad_inode_fiemap(struct inode *inode, | |||
126 | return -EIO; | 126 | return -EIO; |
127 | } | 127 | } |
128 | 128 | ||
129 | static int bad_inode_update_time(struct inode *inode, struct timespec *time, | 129 | static int bad_inode_update_time(struct inode *inode, struct timespec64 *time, |
130 | int flags) | 130 | int flags) |
131 | { | 131 | { |
132 | return -EIO; | 132 | return -EIO; |
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index f660ba1e5e58..51e77d72068a 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -1842,16 +1842,16 @@ out: | |||
1842 | 1842 | ||
1843 | static void update_time_for_write(struct inode *inode) | 1843 | static void update_time_for_write(struct inode *inode) |
1844 | { | 1844 | { |
1845 | struct timespec now; | 1845 | struct timespec64 now; |
1846 | 1846 | ||
1847 | if (IS_NOCMTIME(inode)) | 1847 | if (IS_NOCMTIME(inode)) |
1848 | return; | 1848 | return; |
1849 | 1849 | ||
1850 | now = current_time(inode); | 1850 | now = current_time(inode); |
1851 | if (!timespec_equal(&inode->i_mtime, &now)) | 1851 | if (!timespec64_equal(&inode->i_mtime, &now)) |
1852 | inode->i_mtime = now; | 1852 | inode->i_mtime = now; |
1853 | 1853 | ||
1854 | if (!timespec_equal(&inode->i_ctime, &now)) | 1854 | if (!timespec64_equal(&inode->i_ctime, &now)) |
1855 | inode->i_ctime = now; | 1855 | inode->i_ctime = now; |
1856 | 1856 | ||
1857 | if (IS_I_VERSION(inode)) | 1857 | if (IS_I_VERSION(inode)) |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 8e604e7071f1..233a2bf70351 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -5777,7 +5777,7 @@ static struct inode *new_simple_dir(struct super_block *s, | |||
5777 | inode->i_mtime = current_time(inode); | 5777 | inode->i_mtime = current_time(inode); |
5778 | inode->i_atime = inode->i_mtime; | 5778 | inode->i_atime = inode->i_mtime; |
5779 | inode->i_ctime = inode->i_mtime; | 5779 | inode->i_ctime = inode->i_mtime; |
5780 | BTRFS_I(inode)->i_otime = inode->i_mtime; | 5780 | BTRFS_I(inode)->i_otime = timespec64_to_timespec(inode->i_mtime); |
5781 | 5781 | ||
5782 | return inode; | 5782 | return inode; |
5783 | } | 5783 | } |
@@ -6131,7 +6131,7 @@ static int btrfs_dirty_inode(struct inode *inode) | |||
6131 | * This is a copy of file_update_time. We need this so we can return error on | 6131 | * This is a copy of file_update_time. We need this so we can return error on |
6132 | * ENOSPC for updating the inode in the case of file write and mmap writes. | 6132 | * ENOSPC for updating the inode in the case of file write and mmap writes. |
6133 | */ | 6133 | */ |
6134 | static int btrfs_update_time(struct inode *inode, struct timespec *now, | 6134 | static int btrfs_update_time(struct inode *inode, struct timespec64 *now, |
6135 | int flags) | 6135 | int flags) |
6136 | { | 6136 | { |
6137 | struct btrfs_root *root = BTRFS_I(inode)->root; | 6137 | struct btrfs_root *root = BTRFS_I(inode)->root; |
@@ -6386,7 +6386,7 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans, | |||
6386 | inode->i_mtime = current_time(inode); | 6386 | inode->i_mtime = current_time(inode); |
6387 | inode->i_atime = inode->i_mtime; | 6387 | inode->i_atime = inode->i_mtime; |
6388 | inode->i_ctime = inode->i_mtime; | 6388 | inode->i_ctime = inode->i_mtime; |
6389 | BTRFS_I(inode)->i_otime = inode->i_mtime; | 6389 | BTRFS_I(inode)->i_otime = timespec64_to_timespec(inode->i_mtime); |
6390 | 6390 | ||
6391 | inode_item = btrfs_item_ptr(path->nodes[0], path->slots[0], | 6391 | inode_item = btrfs_item_ptr(path->nodes[0], path->slots[0], |
6392 | struct btrfs_inode_item); | 6392 | struct btrfs_inode_item); |
@@ -9471,7 +9471,7 @@ static int btrfs_rename_exchange(struct inode *old_dir, | |||
9471 | struct btrfs_root *dest = BTRFS_I(new_dir)->root; | 9471 | struct btrfs_root *dest = BTRFS_I(new_dir)->root; |
9472 | struct inode *new_inode = new_dentry->d_inode; | 9472 | struct inode *new_inode = new_dentry->d_inode; |
9473 | struct inode *old_inode = old_dentry->d_inode; | 9473 | struct inode *old_inode = old_dentry->d_inode; |
9474 | struct timespec ctime = current_time(old_inode); | 9474 | struct timespec64 ctime = current_time(old_inode); |
9475 | struct dentry *parent; | 9475 | struct dentry *parent; |
9476 | u64 old_ino = btrfs_ino(BTRFS_I(old_inode)); | 9476 | u64 old_ino = btrfs_ino(BTRFS_I(old_inode)); |
9477 | u64 new_ino = btrfs_ino(BTRFS_I(new_inode)); | 9477 | u64 new_ino = btrfs_ino(BTRFS_I(new_inode)); |
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 632e26d6f7ce..09c6bec14956 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -417,7 +417,7 @@ static noinline int create_subvol(struct inode *dir, | |||
417 | struct btrfs_root *root = BTRFS_I(dir)->root; | 417 | struct btrfs_root *root = BTRFS_I(dir)->root; |
418 | struct btrfs_root *new_root; | 418 | struct btrfs_root *new_root; |
419 | struct btrfs_block_rsv block_rsv; | 419 | struct btrfs_block_rsv block_rsv; |
420 | struct timespec cur_time = current_time(dir); | 420 | struct timespec64 cur_time = current_time(dir); |
421 | struct inode *inode; | 421 | struct inode *inode; |
422 | int ret; | 422 | int ret; |
423 | int err; | 423 | int err; |
@@ -4996,7 +4996,7 @@ static long _btrfs_ioctl_set_received_subvol(struct file *file, | |||
4996 | struct btrfs_root *root = BTRFS_I(inode)->root; | 4996 | struct btrfs_root *root = BTRFS_I(inode)->root; |
4997 | struct btrfs_root_item *root_item = &root->root_item; | 4997 | struct btrfs_root_item *root_item = &root->root_item; |
4998 | struct btrfs_trans_handle *trans; | 4998 | struct btrfs_trans_handle *trans; |
4999 | struct timespec ct = current_time(inode); | 4999 | struct timespec64 ct = current_time(inode); |
5000 | int ret = 0; | 5000 | int ret = 0; |
5001 | int received_uuid_changed; | 5001 | int received_uuid_changed; |
5002 | 5002 | ||
diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c index 6db3bda44aa5..c451285976ac 100644 --- a/fs/btrfs/root-tree.c +++ b/fs/btrfs/root-tree.c | |||
@@ -485,9 +485,9 @@ void btrfs_update_root_times(struct btrfs_trans_handle *trans, | |||
485 | struct btrfs_root *root) | 485 | struct btrfs_root *root) |
486 | { | 486 | { |
487 | struct btrfs_root_item *item = &root->root_item; | 487 | struct btrfs_root_item *item = &root->root_item; |
488 | struct timespec ct; | 488 | struct timespec64 ct; |
489 | 489 | ||
490 | ktime_get_real_ts(&ct); | 490 | ktime_get_real_ts64(&ct); |
491 | spin_lock(&root->root_item_lock); | 491 | spin_lock(&root->root_item_lock); |
492 | btrfs_set_root_ctransid(item, trans->transid); | 492 | btrfs_set_root_ctransid(item, trans->transid); |
493 | btrfs_set_stack_timespec_sec(&item->ctime, ct.tv_sec); | 493 | btrfs_set_stack_timespec_sec(&item->ctime, ct.tv_sec); |
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index c944b4769e3c..7ac0d05571ca 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -1428,7 +1428,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, | |||
1428 | struct dentry *dentry; | 1428 | struct dentry *dentry; |
1429 | struct extent_buffer *tmp; | 1429 | struct extent_buffer *tmp; |
1430 | struct extent_buffer *old; | 1430 | struct extent_buffer *old; |
1431 | struct timespec cur_time; | 1431 | struct timespec64 cur_time; |
1432 | int ret = 0; | 1432 | int ret = 0; |
1433 | u64 to_reserve = 0; | 1433 | u64 to_reserve = 0; |
1434 | u64 index = 0; | 1434 | u64 index = 0; |
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 5f7ad3d0df2e..0133ea2b784a 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c | |||
@@ -574,6 +574,7 @@ static u64 get_writepages_data_length(struct inode *inode, | |||
574 | */ | 574 | */ |
575 | static int writepage_nounlock(struct page *page, struct writeback_control *wbc) | 575 | static int writepage_nounlock(struct page *page, struct writeback_control *wbc) |
576 | { | 576 | { |
577 | struct timespec ts; | ||
577 | struct inode *inode; | 578 | struct inode *inode; |
578 | struct ceph_inode_info *ci; | 579 | struct ceph_inode_info *ci; |
579 | struct ceph_fs_client *fsc; | 580 | struct ceph_fs_client *fsc; |
@@ -624,11 +625,12 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc) | |||
624 | set_bdi_congested(inode_to_bdi(inode), BLK_RW_ASYNC); | 625 | set_bdi_congested(inode_to_bdi(inode), BLK_RW_ASYNC); |
625 | 626 | ||
626 | set_page_writeback(page); | 627 | set_page_writeback(page); |
628 | ts = timespec64_to_timespec(inode->i_mtime); | ||
627 | err = ceph_osdc_writepages(&fsc->client->osdc, ceph_vino(inode), | 629 | err = ceph_osdc_writepages(&fsc->client->osdc, ceph_vino(inode), |
628 | &ci->i_layout, snapc, page_off, len, | 630 | &ci->i_layout, snapc, page_off, len, |
629 | ceph_wbc.truncate_seq, | 631 | ceph_wbc.truncate_seq, |
630 | ceph_wbc.truncate_size, | 632 | ceph_wbc.truncate_size, |
631 | &inode->i_mtime, &page, 1); | 633 | &ts, &page, 1); |
632 | if (err < 0) { | 634 | if (err < 0) { |
633 | struct writeback_control tmp_wbc; | 635 | struct writeback_control tmp_wbc; |
634 | if (!wbc) | 636 | if (!wbc) |
@@ -1131,7 +1133,7 @@ new_request: | |||
1131 | pages = NULL; | 1133 | pages = NULL; |
1132 | } | 1134 | } |
1133 | 1135 | ||
1134 | req->r_mtime = inode->i_mtime; | 1136 | req->r_mtime = timespec64_to_timespec(inode->i_mtime); |
1135 | rc = ceph_osdc_start_request(&fsc->client->osdc, req, true); | 1137 | rc = ceph_osdc_start_request(&fsc->client->osdc, req, true); |
1136 | BUG_ON(rc); | 1138 | BUG_ON(rc); |
1137 | req = NULL; | 1139 | req = NULL; |
@@ -1731,7 +1733,7 @@ int ceph_uninline_data(struct file *filp, struct page *locked_page) | |||
1731 | goto out; | 1733 | goto out; |
1732 | } | 1734 | } |
1733 | 1735 | ||
1734 | req->r_mtime = inode->i_mtime; | 1736 | req->r_mtime = timespec64_to_timespec(inode->i_mtime); |
1735 | err = ceph_osdc_start_request(&fsc->client->osdc, req, false); | 1737 | err = ceph_osdc_start_request(&fsc->client->osdc, req, false); |
1736 | if (!err) | 1738 | if (!err) |
1737 | err = ceph_osdc_wait_request(&fsc->client->osdc, req); | 1739 | err = ceph_osdc_wait_request(&fsc->client->osdc, req); |
@@ -1773,7 +1775,7 @@ int ceph_uninline_data(struct file *filp, struct page *locked_page) | |||
1773 | goto out_put; | 1775 | goto out_put; |
1774 | } | 1776 | } |
1775 | 1777 | ||
1776 | req->r_mtime = inode->i_mtime; | 1778 | req->r_mtime = timespec64_to_timespec(inode->i_mtime); |
1777 | err = ceph_osdc_start_request(&fsc->client->osdc, req, false); | 1779 | err = ceph_osdc_start_request(&fsc->client->osdc, req, false); |
1778 | if (!err) | 1780 | if (!err) |
1779 | err = ceph_osdc_wait_request(&fsc->client->osdc, req); | 1781 | err = ceph_osdc_wait_request(&fsc->client->osdc, req); |
@@ -1934,7 +1936,7 @@ static int __ceph_pool_perm_get(struct ceph_inode_info *ci, | |||
1934 | 0, false, true); | 1936 | 0, false, true); |
1935 | err = ceph_osdc_start_request(&fsc->client->osdc, rd_req, false); | 1937 | err = ceph_osdc_start_request(&fsc->client->osdc, rd_req, false); |
1936 | 1938 | ||
1937 | wr_req->r_mtime = ci->vfs_inode.i_mtime; | 1939 | wr_req->r_mtime = timespec64_to_timespec(ci->vfs_inode.i_mtime); |
1938 | wr_req->r_abort_on_full = true; | 1940 | wr_req->r_abort_on_full = true; |
1939 | err2 = ceph_osdc_start_request(&fsc->client->osdc, wr_req, false); | 1941 | err2 = ceph_osdc_start_request(&fsc->client->osdc, wr_req, false); |
1940 | 1942 | ||
diff --git a/fs/ceph/cache.c b/fs/ceph/cache.c index bb524c880b1e..362900e42424 100644 --- a/fs/ceph/cache.c +++ b/fs/ceph/cache.c | |||
@@ -130,7 +130,7 @@ static enum fscache_checkaux ceph_fscache_inode_check_aux( | |||
130 | 130 | ||
131 | memset(&aux, 0, sizeof(aux)); | 131 | memset(&aux, 0, sizeof(aux)); |
132 | aux.version = ci->i_version; | 132 | aux.version = ci->i_version; |
133 | aux.mtime = inode->i_mtime; | 133 | aux.mtime = timespec64_to_timespec(inode->i_mtime); |
134 | 134 | ||
135 | if (memcmp(data, &aux, sizeof(aux)) != 0) | 135 | if (memcmp(data, &aux, sizeof(aux)) != 0) |
136 | return FSCACHE_CHECKAUX_OBSOLETE; | 136 | return FSCACHE_CHECKAUX_OBSOLETE; |
@@ -163,7 +163,7 @@ void ceph_fscache_register_inode_cookie(struct inode *inode) | |||
163 | if (!ci->fscache) { | 163 | if (!ci->fscache) { |
164 | memset(&aux, 0, sizeof(aux)); | 164 | memset(&aux, 0, sizeof(aux)); |
165 | aux.version = ci->i_version; | 165 | aux.version = ci->i_version; |
166 | aux.mtime = inode->i_mtime; | 166 | aux.mtime = timespec64_to_timespec(inode->i_mtime); |
167 | ci->fscache = fscache_acquire_cookie(fsc->fscache, | 167 | ci->fscache = fscache_acquire_cookie(fsc->fscache, |
168 | &ceph_fscache_inode_object_def, | 168 | &ceph_fscache_inode_object_def, |
169 | &ci->i_vino, sizeof(ci->i_vino), | 169 | &ci->i_vino, sizeof(ci->i_vino), |
diff --git a/fs/ceph/caps.c b/fs/ceph/caps.c index 23dbfae16156..96b2ce936daa 100644 --- a/fs/ceph/caps.c +++ b/fs/ceph/caps.c | |||
@@ -1358,9 +1358,9 @@ static int __send_cap(struct ceph_mds_client *mdsc, struct ceph_cap *cap, | |||
1358 | arg.xattr_buf = NULL; | 1358 | arg.xattr_buf = NULL; |
1359 | } | 1359 | } |
1360 | 1360 | ||
1361 | arg.mtime = inode->i_mtime; | 1361 | arg.mtime = timespec64_to_timespec(inode->i_mtime); |
1362 | arg.atime = inode->i_atime; | 1362 | arg.atime = timespec64_to_timespec(inode->i_atime); |
1363 | arg.ctime = inode->i_ctime; | 1363 | arg.ctime = timespec64_to_timespec(inode->i_ctime); |
1364 | 1364 | ||
1365 | arg.op = op; | 1365 | arg.op = op; |
1366 | arg.caps = cap->implemented; | 1366 | arg.caps = cap->implemented; |
diff --git a/fs/ceph/file.c b/fs/ceph/file.c index cf0e45b10121..e962d672baf2 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c | |||
@@ -924,7 +924,7 @@ ceph_direct_read_write(struct kiocb *iocb, struct iov_iter *iter, | |||
924 | int num_pages = 0; | 924 | int num_pages = 0; |
925 | int flags; | 925 | int flags; |
926 | int ret; | 926 | int ret; |
927 | struct timespec mtime = current_time(inode); | 927 | struct timespec mtime = timespec64_to_timespec(current_time(inode)); |
928 | size_t count = iov_iter_count(iter); | 928 | size_t count = iov_iter_count(iter); |
929 | loff_t pos = iocb->ki_pos; | 929 | loff_t pos = iocb->ki_pos; |
930 | bool write = iov_iter_rw(iter) == WRITE; | 930 | bool write = iov_iter_rw(iter) == WRITE; |
@@ -1132,7 +1132,7 @@ ceph_sync_write(struct kiocb *iocb, struct iov_iter *from, loff_t pos, | |||
1132 | int flags; | 1132 | int flags; |
1133 | int ret; | 1133 | int ret; |
1134 | bool check_caps = false; | 1134 | bool check_caps = false; |
1135 | struct timespec mtime = current_time(inode); | 1135 | struct timespec mtime = timespec64_to_timespec(current_time(inode)); |
1136 | size_t count = iov_iter_count(from); | 1136 | size_t count = iov_iter_count(from); |
1137 | 1137 | ||
1138 | if (ceph_snap(file_inode(file)) != CEPH_NOSNAP) | 1138 | if (ceph_snap(file_inode(file)) != CEPH_NOSNAP) |
@@ -1664,7 +1664,7 @@ static int ceph_zero_partial_object(struct inode *inode, | |||
1664 | goto out; | 1664 | goto out; |
1665 | } | 1665 | } |
1666 | 1666 | ||
1667 | req->r_mtime = inode->i_mtime; | 1667 | req->r_mtime = timespec64_to_timespec(inode->i_mtime); |
1668 | ret = ceph_osdc_start_request(&fsc->client->osdc, req, false); | 1668 | ret = ceph_osdc_start_request(&fsc->client->osdc, req, false); |
1669 | if (!ret) { | 1669 | if (!ret) { |
1670 | ret = ceph_osdc_wait_request(&fsc->client->osdc, req); | 1670 | ret = ceph_osdc_wait_request(&fsc->client->osdc, req); |
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 676065a1ea62..700fd652cc77 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c | |||
@@ -662,6 +662,9 @@ void ceph_fill_file_time(struct inode *inode, int issued, | |||
662 | struct timespec *mtime, struct timespec *atime) | 662 | struct timespec *mtime, struct timespec *atime) |
663 | { | 663 | { |
664 | struct ceph_inode_info *ci = ceph_inode(inode); | 664 | struct ceph_inode_info *ci = ceph_inode(inode); |
665 | struct timespec64 ctime64 = timespec_to_timespec64(*ctime); | ||
666 | struct timespec64 mtime64 = timespec_to_timespec64(*mtime); | ||
667 | struct timespec64 atime64 = timespec_to_timespec64(*atime); | ||
665 | int warn = 0; | 668 | int warn = 0; |
666 | 669 | ||
667 | if (issued & (CEPH_CAP_FILE_EXCL| | 670 | if (issued & (CEPH_CAP_FILE_EXCL| |
@@ -670,11 +673,11 @@ void ceph_fill_file_time(struct inode *inode, int issued, | |||
670 | CEPH_CAP_AUTH_EXCL| | 673 | CEPH_CAP_AUTH_EXCL| |
671 | CEPH_CAP_XATTR_EXCL)) { | 674 | CEPH_CAP_XATTR_EXCL)) { |
672 | if (ci->i_version == 0 || | 675 | if (ci->i_version == 0 || |
673 | timespec_compare(ctime, &inode->i_ctime) > 0) { | 676 | timespec64_compare(&ctime64, &inode->i_ctime) > 0) { |
674 | dout("ctime %lld.%09ld -> %lld.%09ld inc w/ cap\n", | 677 | dout("ctime %lld.%09ld -> %lld.%09ld inc w/ cap\n", |
675 | (long long)inode->i_ctime.tv_sec, inode->i_ctime.tv_nsec, | 678 | (long long)inode->i_ctime.tv_sec, inode->i_ctime.tv_nsec, |
676 | (long long)ctime->tv_sec, ctime->tv_nsec); | 679 | (long long)ctime->tv_sec, ctime->tv_nsec); |
677 | inode->i_ctime = *ctime; | 680 | inode->i_ctime = ctime64; |
678 | } | 681 | } |
679 | if (ci->i_version == 0 || | 682 | if (ci->i_version == 0 || |
680 | ceph_seq_cmp(time_warp_seq, ci->i_time_warp_seq) > 0) { | 683 | ceph_seq_cmp(time_warp_seq, ci->i_time_warp_seq) > 0) { |
@@ -685,24 +688,24 @@ void ceph_fill_file_time(struct inode *inode, int issued, | |||
685 | (long long)mtime->tv_sec, mtime->tv_nsec, | 688 | (long long)mtime->tv_sec, mtime->tv_nsec, |
686 | ci->i_time_warp_seq, (int)time_warp_seq); | 689 | ci->i_time_warp_seq, (int)time_warp_seq); |
687 | 690 | ||
688 | inode->i_mtime = *mtime; | 691 | inode->i_mtime = mtime64; |
689 | inode->i_atime = *atime; | 692 | inode->i_atime = atime64; |
690 | ci->i_time_warp_seq = time_warp_seq; | 693 | ci->i_time_warp_seq = time_warp_seq; |
691 | } else if (time_warp_seq == ci->i_time_warp_seq) { | 694 | } else if (time_warp_seq == ci->i_time_warp_seq) { |
692 | /* nobody did utimes(); take the max */ | 695 | /* nobody did utimes(); take the max */ |
693 | if (timespec_compare(mtime, &inode->i_mtime) > 0) { | 696 | if (timespec64_compare(&mtime64, &inode->i_mtime) > 0) { |
694 | dout("mtime %lld.%09ld -> %lld.%09ld inc\n", | 697 | dout("mtime %lld.%09ld -> %lld.%09ld inc\n", |
695 | (long long)inode->i_mtime.tv_sec, | 698 | (long long)inode->i_mtime.tv_sec, |
696 | inode->i_mtime.tv_nsec, | 699 | inode->i_mtime.tv_nsec, |
697 | (long long)mtime->tv_sec, mtime->tv_nsec); | 700 | (long long)mtime->tv_sec, mtime->tv_nsec); |
698 | inode->i_mtime = *mtime; | 701 | inode->i_mtime = mtime64; |
699 | } | 702 | } |
700 | if (timespec_compare(atime, &inode->i_atime) > 0) { | 703 | if (timespec64_compare(&atime64, &inode->i_atime) > 0) { |
701 | dout("atime %lld.%09ld -> %lld.%09ld inc\n", | 704 | dout("atime %lld.%09ld -> %lld.%09ld inc\n", |
702 | (long long)inode->i_atime.tv_sec, | 705 | (long long)inode->i_atime.tv_sec, |
703 | inode->i_atime.tv_nsec, | 706 | inode->i_atime.tv_nsec, |
704 | (long long)atime->tv_sec, atime->tv_nsec); | 707 | (long long)atime->tv_sec, atime->tv_nsec); |
705 | inode->i_atime = *atime; | 708 | inode->i_atime = atime64; |
706 | } | 709 | } |
707 | } else if (issued & CEPH_CAP_FILE_EXCL) { | 710 | } else if (issued & CEPH_CAP_FILE_EXCL) { |
708 | /* we did a utimes(); ignore mds values */ | 711 | /* we did a utimes(); ignore mds values */ |
@@ -712,9 +715,9 @@ void ceph_fill_file_time(struct inode *inode, int issued, | |||
712 | } else { | 715 | } else { |
713 | /* we have no write|excl caps; whatever the MDS says is true */ | 716 | /* we have no write|excl caps; whatever the MDS says is true */ |
714 | if (ceph_seq_cmp(time_warp_seq, ci->i_time_warp_seq) >= 0) { | 717 | if (ceph_seq_cmp(time_warp_seq, ci->i_time_warp_seq) >= 0) { |
715 | inode->i_ctime = *ctime; | 718 | inode->i_ctime = ctime64; |
716 | inode->i_mtime = *mtime; | 719 | inode->i_mtime = mtime64; |
717 | inode->i_atime = *atime; | 720 | inode->i_atime = atime64; |
718 | ci->i_time_warp_seq = time_warp_seq; | 721 | ci->i_time_warp_seq = time_warp_seq; |
719 | } else { | 722 | } else { |
720 | warn = 1; | 723 | warn = 1; |
@@ -1941,6 +1944,7 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr) | |||
1941 | int err = 0; | 1944 | int err = 0; |
1942 | int inode_dirty_flags = 0; | 1945 | int inode_dirty_flags = 0; |
1943 | bool lock_snap_rwsem = false; | 1946 | bool lock_snap_rwsem = false; |
1947 | struct timespec ts; | ||
1944 | 1948 | ||
1945 | prealloc_cf = ceph_alloc_cap_flush(); | 1949 | prealloc_cf = ceph_alloc_cap_flush(); |
1946 | if (!prealloc_cf) | 1950 | if (!prealloc_cf) |
@@ -2023,14 +2027,14 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr) | |||
2023 | inode->i_atime = attr->ia_atime; | 2027 | inode->i_atime = attr->ia_atime; |
2024 | dirtied |= CEPH_CAP_FILE_EXCL; | 2028 | dirtied |= CEPH_CAP_FILE_EXCL; |
2025 | } else if ((issued & CEPH_CAP_FILE_WR) && | 2029 | } else if ((issued & CEPH_CAP_FILE_WR) && |
2026 | timespec_compare(&inode->i_atime, | 2030 | timespec64_compare(&inode->i_atime, |
2027 | &attr->ia_atime) < 0) { | 2031 | &attr->ia_atime) < 0) { |
2028 | inode->i_atime = attr->ia_atime; | 2032 | inode->i_atime = attr->ia_atime; |
2029 | dirtied |= CEPH_CAP_FILE_WR; | 2033 | dirtied |= CEPH_CAP_FILE_WR; |
2030 | } else if ((issued & CEPH_CAP_FILE_SHARED) == 0 || | 2034 | } else if ((issued & CEPH_CAP_FILE_SHARED) == 0 || |
2031 | !timespec_equal(&inode->i_atime, &attr->ia_atime)) { | 2035 | !timespec64_equal(&inode->i_atime, &attr->ia_atime)) { |
2032 | ceph_encode_timespec(&req->r_args.setattr.atime, | 2036 | ts = timespec64_to_timespec(attr->ia_atime); |
2033 | &attr->ia_atime); | 2037 | ceph_encode_timespec(&req->r_args.setattr.atime, &ts); |
2034 | mask |= CEPH_SETATTR_ATIME; | 2038 | mask |= CEPH_SETATTR_ATIME; |
2035 | release |= CEPH_CAP_FILE_SHARED | | 2039 | release |= CEPH_CAP_FILE_SHARED | |
2036 | CEPH_CAP_FILE_RD | CEPH_CAP_FILE_WR; | 2040 | CEPH_CAP_FILE_RD | CEPH_CAP_FILE_WR; |
@@ -2045,14 +2049,14 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr) | |||
2045 | inode->i_mtime = attr->ia_mtime; | 2049 | inode->i_mtime = attr->ia_mtime; |
2046 | dirtied |= CEPH_CAP_FILE_EXCL; | 2050 | dirtied |= CEPH_CAP_FILE_EXCL; |
2047 | } else if ((issued & CEPH_CAP_FILE_WR) && | 2051 | } else if ((issued & CEPH_CAP_FILE_WR) && |
2048 | timespec_compare(&inode->i_mtime, | 2052 | timespec64_compare(&inode->i_mtime, |
2049 | &attr->ia_mtime) < 0) { | 2053 | &attr->ia_mtime) < 0) { |
2050 | inode->i_mtime = attr->ia_mtime; | 2054 | inode->i_mtime = attr->ia_mtime; |
2051 | dirtied |= CEPH_CAP_FILE_WR; | 2055 | dirtied |= CEPH_CAP_FILE_WR; |
2052 | } else if ((issued & CEPH_CAP_FILE_SHARED) == 0 || | 2056 | } else if ((issued & CEPH_CAP_FILE_SHARED) == 0 || |
2053 | !timespec_equal(&inode->i_mtime, &attr->ia_mtime)) { | 2057 | !timespec64_equal(&inode->i_mtime, &attr->ia_mtime)) { |
2054 | ceph_encode_timespec(&req->r_args.setattr.mtime, | 2058 | ts = timespec64_to_timespec(attr->ia_mtime); |
2055 | &attr->ia_mtime); | 2059 | ceph_encode_timespec(&req->r_args.setattr.mtime, &ts); |
2056 | mask |= CEPH_SETATTR_MTIME; | 2060 | mask |= CEPH_SETATTR_MTIME; |
2057 | release |= CEPH_CAP_FILE_SHARED | | 2061 | release |= CEPH_CAP_FILE_SHARED | |
2058 | CEPH_CAP_FILE_RD | CEPH_CAP_FILE_WR; | 2062 | CEPH_CAP_FILE_RD | CEPH_CAP_FILE_WR; |
@@ -2126,7 +2130,7 @@ int __ceph_setattr(struct inode *inode, struct iattr *attr) | |||
2126 | req->r_inode_drop = release; | 2130 | req->r_inode_drop = release; |
2127 | req->r_args.setattr.mask = cpu_to_le32(mask); | 2131 | req->r_args.setattr.mask = cpu_to_le32(mask); |
2128 | req->r_num_caps = 1; | 2132 | req->r_num_caps = 1; |
2129 | req->r_stamp = attr->ia_ctime; | 2133 | req->r_stamp = timespec64_to_timespec(attr->ia_ctime); |
2130 | err = ceph_mdsc_do_request(mdsc, NULL, req); | 2134 | err = ceph_mdsc_do_request(mdsc, NULL, req); |
2131 | } | 2135 | } |
2132 | dout("setattr %p result=%d (%s locally, %d remote)\n", inode, err, | 2136 | dout("setattr %p result=%d (%s locally, %d remote)\n", inode, err, |
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 5ece2e6ad154..9460a92ce56d 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c | |||
@@ -2958,12 +2958,15 @@ static int encode_caps_cb(struct inode *inode, struct ceph_cap *cap, | |||
2958 | rec.v2.flock_len = (__force __le32) | 2958 | rec.v2.flock_len = (__force __le32) |
2959 | ((ci->i_ceph_flags & CEPH_I_ERROR_FILELOCK) ? 0 : 1); | 2959 | ((ci->i_ceph_flags & CEPH_I_ERROR_FILELOCK) ? 0 : 1); |
2960 | } else { | 2960 | } else { |
2961 | struct timespec ts; | ||
2961 | rec.v1.cap_id = cpu_to_le64(cap->cap_id); | 2962 | rec.v1.cap_id = cpu_to_le64(cap->cap_id); |
2962 | rec.v1.wanted = cpu_to_le32(__ceph_caps_wanted(ci)); | 2963 | rec.v1.wanted = cpu_to_le32(__ceph_caps_wanted(ci)); |
2963 | rec.v1.issued = cpu_to_le32(cap->issued); | 2964 | rec.v1.issued = cpu_to_le32(cap->issued); |
2964 | rec.v1.size = cpu_to_le64(inode->i_size); | 2965 | rec.v1.size = cpu_to_le64(inode->i_size); |
2965 | ceph_encode_timespec(&rec.v1.mtime, &inode->i_mtime); | 2966 | ts = timespec64_to_timespec(inode->i_mtime); |
2966 | ceph_encode_timespec(&rec.v1.atime, &inode->i_atime); | 2967 | ceph_encode_timespec(&rec.v1.mtime, &ts); |
2968 | ts = timespec64_to_timespec(inode->i_atime); | ||
2969 | ceph_encode_timespec(&rec.v1.atime, &ts); | ||
2967 | rec.v1.snaprealm = cpu_to_le64(ci->i_snap_realm->ino); | 2970 | rec.v1.snaprealm = cpu_to_le64(ci->i_snap_realm->ino); |
2968 | rec.v1.pathbase = cpu_to_le64(pathbase); | 2971 | rec.v1.pathbase = cpu_to_le64(pathbase); |
2969 | } | 2972 | } |
diff --git a/fs/ceph/snap.c b/fs/ceph/snap.c index 041c27ea8de1..af81555c14fd 100644 --- a/fs/ceph/snap.c +++ b/fs/ceph/snap.c | |||
@@ -594,9 +594,9 @@ int __ceph_finish_cap_snap(struct ceph_inode_info *ci, | |||
594 | 594 | ||
595 | BUG_ON(capsnap->writing); | 595 | BUG_ON(capsnap->writing); |
596 | capsnap->size = inode->i_size; | 596 | capsnap->size = inode->i_size; |
597 | capsnap->mtime = inode->i_mtime; | 597 | capsnap->mtime = timespec64_to_timespec(inode->i_mtime); |
598 | capsnap->atime = inode->i_atime; | 598 | capsnap->atime = timespec64_to_timespec(inode->i_atime); |
599 | capsnap->ctime = inode->i_ctime; | 599 | capsnap->ctime = timespec64_to_timespec(inode->i_ctime); |
600 | capsnap->time_warp_seq = ci->i_time_warp_seq; | 600 | capsnap->time_warp_seq = ci->i_time_warp_seq; |
601 | capsnap->truncate_size = ci->i_truncate_size; | 601 | capsnap->truncate_size = ci->i_truncate_size; |
602 | capsnap->truncate_seq = ci->i_truncate_seq; | 602 | capsnap->truncate_seq = ci->i_truncate_seq; |
diff --git a/fs/cifs/cache.c b/fs/cifs/cache.c index edf5f40898bf..e1553d1e0e50 100644 --- a/fs/cifs/cache.c +++ b/fs/cifs/cache.c | |||
@@ -128,8 +128,8 @@ fscache_checkaux cifs_fscache_inode_check_aux(void *cookie_netfs_data, | |||
128 | 128 | ||
129 | memset(&auxdata, 0, sizeof(auxdata)); | 129 | memset(&auxdata, 0, sizeof(auxdata)); |
130 | auxdata.eof = cifsi->server_eof; | 130 | auxdata.eof = cifsi->server_eof; |
131 | auxdata.last_write_time = cifsi->vfs_inode.i_mtime; | 131 | auxdata.last_write_time = timespec64_to_timespec(cifsi->vfs_inode.i_mtime); |
132 | auxdata.last_change_time = cifsi->vfs_inode.i_ctime; | 132 | auxdata.last_change_time = timespec64_to_timespec(cifsi->vfs_inode.i_ctime); |
133 | 133 | ||
134 | if (memcmp(data, &auxdata, datalen) != 0) | 134 | if (memcmp(data, &auxdata, datalen) != 0) |
135 | return FSCACHE_CHECKAUX_OBSOLETE; | 135 | return FSCACHE_CHECKAUX_OBSOLETE; |
diff --git a/fs/cifs/fscache.c b/fs/cifs/fscache.c index 25d3f66b2d50..85145a763021 100644 --- a/fs/cifs/fscache.c +++ b/fs/cifs/fscache.c | |||
@@ -129,8 +129,8 @@ static void cifs_fscache_acquire_inode_cookie(struct cifsInodeInfo *cifsi, | |||
129 | 129 | ||
130 | memset(&auxdata, 0, sizeof(auxdata)); | 130 | memset(&auxdata, 0, sizeof(auxdata)); |
131 | auxdata.eof = cifsi->server_eof; | 131 | auxdata.eof = cifsi->server_eof; |
132 | auxdata.last_write_time = cifsi->vfs_inode.i_mtime; | 132 | auxdata.last_write_time = timespec64_to_timespec(cifsi->vfs_inode.i_mtime); |
133 | auxdata.last_change_time = cifsi->vfs_inode.i_ctime; | 133 | auxdata.last_change_time = timespec64_to_timespec(cifsi->vfs_inode.i_ctime); |
134 | 134 | ||
135 | cifsi->fscache = | 135 | cifsi->fscache = |
136 | fscache_acquire_cookie(tcon->fscache, | 136 | fscache_acquire_cookie(tcon->fscache, |
@@ -166,8 +166,8 @@ void cifs_fscache_release_inode_cookie(struct inode *inode) | |||
166 | if (cifsi->fscache) { | 166 | if (cifsi->fscache) { |
167 | memset(&auxdata, 0, sizeof(auxdata)); | 167 | memset(&auxdata, 0, sizeof(auxdata)); |
168 | auxdata.eof = cifsi->server_eof; | 168 | auxdata.eof = cifsi->server_eof; |
169 | auxdata.last_write_time = cifsi->vfs_inode.i_mtime; | 169 | auxdata.last_write_time = timespec64_to_timespec(cifsi->vfs_inode.i_mtime); |
170 | auxdata.last_change_time = cifsi->vfs_inode.i_ctime; | 170 | auxdata.last_change_time = timespec64_to_timespec(cifsi->vfs_inode.i_ctime); |
171 | 171 | ||
172 | cifs_dbg(FYI, "%s: (0x%p)\n", __func__, cifsi->fscache); | 172 | cifs_dbg(FYI, "%s: (0x%p)\n", __func__, cifsi->fscache); |
173 | fscache_relinquish_cookie(cifsi->fscache, &auxdata, false); | 173 | fscache_relinquish_cookie(cifsi->fscache, &auxdata, false); |
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 3c371f7f5963..6be9a7cfaf0e 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -95,6 +95,7 @@ static void | |||
95 | cifs_revalidate_cache(struct inode *inode, struct cifs_fattr *fattr) | 95 | cifs_revalidate_cache(struct inode *inode, struct cifs_fattr *fattr) |
96 | { | 96 | { |
97 | struct cifsInodeInfo *cifs_i = CIFS_I(inode); | 97 | struct cifsInodeInfo *cifs_i = CIFS_I(inode); |
98 | struct timespec ts; | ||
98 | 99 | ||
99 | cifs_dbg(FYI, "%s: revalidating inode %llu\n", | 100 | cifs_dbg(FYI, "%s: revalidating inode %llu\n", |
100 | __func__, cifs_i->uniqueid); | 101 | __func__, cifs_i->uniqueid); |
@@ -113,7 +114,8 @@ cifs_revalidate_cache(struct inode *inode, struct cifs_fattr *fattr) | |||
113 | } | 114 | } |
114 | 115 | ||
115 | /* revalidate if mtime or size have changed */ | 116 | /* revalidate if mtime or size have changed */ |
116 | if (timespec_equal(&inode->i_mtime, &fattr->cf_mtime) && | 117 | ts = timespec64_to_timespec(inode->i_mtime); |
118 | if (timespec_equal(&ts, &fattr->cf_mtime) && | ||
117 | cifs_i->server_eof == fattr->cf_eof) { | 119 | cifs_i->server_eof == fattr->cf_eof) { |
118 | cifs_dbg(FYI, "%s: inode %llu is unchanged\n", | 120 | cifs_dbg(FYI, "%s: inode %llu is unchanged\n", |
119 | __func__, cifs_i->uniqueid); | 121 | __func__, cifs_i->uniqueid); |
@@ -162,9 +164,9 @@ cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr) | |||
162 | cifs_revalidate_cache(inode, fattr); | 164 | cifs_revalidate_cache(inode, fattr); |
163 | 165 | ||
164 | spin_lock(&inode->i_lock); | 166 | spin_lock(&inode->i_lock); |
165 | inode->i_atime = fattr->cf_atime; | 167 | inode->i_atime = timespec_to_timespec64(fattr->cf_atime); |
166 | inode->i_mtime = fattr->cf_mtime; | 168 | inode->i_mtime = timespec_to_timespec64(fattr->cf_mtime); |
167 | inode->i_ctime = fattr->cf_ctime; | 169 | inode->i_ctime = timespec_to_timespec64(fattr->cf_ctime); |
168 | inode->i_rdev = fattr->cf_rdev; | 170 | inode->i_rdev = fattr->cf_rdev; |
169 | cifs_nlink_fattr_to_inode(inode, fattr); | 171 | cifs_nlink_fattr_to_inode(inode, fattr); |
170 | inode->i_uid = fattr->cf_uid; | 172 | inode->i_uid = fattr->cf_uid; |
@@ -1122,14 +1124,14 @@ cifs_set_file_info(struct inode *inode, struct iattr *attrs, unsigned int xid, | |||
1122 | if (attrs->ia_valid & ATTR_ATIME) { | 1124 | if (attrs->ia_valid & ATTR_ATIME) { |
1123 | set_time = true; | 1125 | set_time = true; |
1124 | info_buf.LastAccessTime = | 1126 | info_buf.LastAccessTime = |
1125 | cpu_to_le64(cifs_UnixTimeToNT(attrs->ia_atime)); | 1127 | cpu_to_le64(cifs_UnixTimeToNT(timespec64_to_timespec(attrs->ia_atime))); |
1126 | } else | 1128 | } else |
1127 | info_buf.LastAccessTime = 0; | 1129 | info_buf.LastAccessTime = 0; |
1128 | 1130 | ||
1129 | if (attrs->ia_valid & ATTR_MTIME) { | 1131 | if (attrs->ia_valid & ATTR_MTIME) { |
1130 | set_time = true; | 1132 | set_time = true; |
1131 | info_buf.LastWriteTime = | 1133 | info_buf.LastWriteTime = |
1132 | cpu_to_le64(cifs_UnixTimeToNT(attrs->ia_mtime)); | 1134 | cpu_to_le64(cifs_UnixTimeToNT(timespec64_to_timespec(attrs->ia_mtime))); |
1133 | } else | 1135 | } else |
1134 | info_buf.LastWriteTime = 0; | 1136 | info_buf.LastWriteTime = 0; |
1135 | 1137 | ||
@@ -1142,7 +1144,7 @@ cifs_set_file_info(struct inode *inode, struct iattr *attrs, unsigned int xid, | |||
1142 | if (set_time && (attrs->ia_valid & ATTR_CTIME)) { | 1144 | if (set_time && (attrs->ia_valid & ATTR_CTIME)) { |
1143 | cifs_dbg(FYI, "CIFS - CTIME changed\n"); | 1145 | cifs_dbg(FYI, "CIFS - CTIME changed\n"); |
1144 | info_buf.ChangeTime = | 1146 | info_buf.ChangeTime = |
1145 | cpu_to_le64(cifs_UnixTimeToNT(attrs->ia_ctime)); | 1147 | cpu_to_le64(cifs_UnixTimeToNT(timespec64_to_timespec(attrs->ia_ctime))); |
1146 | } else | 1148 | } else |
1147 | info_buf.ChangeTime = 0; | 1149 | info_buf.ChangeTime = 0; |
1148 | 1150 | ||
@@ -2059,8 +2061,8 @@ int cifs_getattr(const struct path *path, struct kstat *stat, | |||
2059 | /* old CIFS Unix Extensions doesn't return create time */ | 2061 | /* old CIFS Unix Extensions doesn't return create time */ |
2060 | if (CIFS_I(inode)->createtime) { | 2062 | if (CIFS_I(inode)->createtime) { |
2061 | stat->result_mask |= STATX_BTIME; | 2063 | stat->result_mask |= STATX_BTIME; |
2062 | stat->btime = | 2064 | stat->btime = timespec_to_timespec64( |
2063 | cifs_NTtimeToUnix(cpu_to_le64(CIFS_I(inode)->createtime)); | 2065 | cifs_NTtimeToUnix(cpu_to_le64(CIFS_I(inode)->createtime))); |
2064 | } | 2066 | } |
2065 | 2067 | ||
2066 | stat->attributes_mask |= (STATX_ATTR_COMPRESSED | STATX_ATTR_ENCRYPTED); | 2068 | stat->attributes_mask |= (STATX_ATTR_COMPRESSED | STATX_ATTR_ENCRYPTED); |
@@ -2262,17 +2264,17 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs) | |||
2262 | args->gid = INVALID_GID; /* no change */ | 2264 | args->gid = INVALID_GID; /* no change */ |
2263 | 2265 | ||
2264 | if (attrs->ia_valid & ATTR_ATIME) | 2266 | if (attrs->ia_valid & ATTR_ATIME) |
2265 | args->atime = cifs_UnixTimeToNT(attrs->ia_atime); | 2267 | args->atime = cifs_UnixTimeToNT(timespec64_to_timespec(attrs->ia_atime)); |
2266 | else | 2268 | else |
2267 | args->atime = NO_CHANGE_64; | 2269 | args->atime = NO_CHANGE_64; |
2268 | 2270 | ||
2269 | if (attrs->ia_valid & ATTR_MTIME) | 2271 | if (attrs->ia_valid & ATTR_MTIME) |
2270 | args->mtime = cifs_UnixTimeToNT(attrs->ia_mtime); | 2272 | args->mtime = cifs_UnixTimeToNT(timespec64_to_timespec(attrs->ia_mtime)); |
2271 | else | 2273 | else |
2272 | args->mtime = NO_CHANGE_64; | 2274 | args->mtime = NO_CHANGE_64; |
2273 | 2275 | ||
2274 | if (attrs->ia_valid & ATTR_CTIME) | 2276 | if (attrs->ia_valid & ATTR_CTIME) |
2275 | args->ctime = cifs_UnixTimeToNT(attrs->ia_ctime); | 2277 | args->ctime = cifs_UnixTimeToNT(timespec64_to_timespec(attrs->ia_ctime)); |
2276 | else | 2278 | else |
2277 | args->ctime = NO_CHANGE_64; | 2279 | args->ctime = NO_CHANGE_64; |
2278 | 2280 | ||
diff --git a/fs/coda/coda_linux.c b/fs/coda/coda_linux.c index ca599df0dcb1..f3d543dd9a98 100644 --- a/fs/coda/coda_linux.c +++ b/fs/coda/coda_linux.c | |||
@@ -105,11 +105,11 @@ void coda_vattr_to_iattr(struct inode *inode, struct coda_vattr *attr) | |||
105 | if (attr->va_size != -1) | 105 | if (attr->va_size != -1) |
106 | inode->i_blocks = (attr->va_size + 511) >> 9; | 106 | inode->i_blocks = (attr->va_size + 511) >> 9; |
107 | if (attr->va_atime.tv_sec != -1) | 107 | if (attr->va_atime.tv_sec != -1) |
108 | inode->i_atime = attr->va_atime; | 108 | inode->i_atime = timespec_to_timespec64(attr->va_atime); |
109 | if (attr->va_mtime.tv_sec != -1) | 109 | if (attr->va_mtime.tv_sec != -1) |
110 | inode->i_mtime = attr->va_mtime; | 110 | inode->i_mtime = timespec_to_timespec64(attr->va_mtime); |
111 | if (attr->va_ctime.tv_sec != -1) | 111 | if (attr->va_ctime.tv_sec != -1) |
112 | inode->i_ctime = attr->va_ctime; | 112 | inode->i_ctime = timespec_to_timespec64(attr->va_ctime); |
113 | } | 113 | } |
114 | 114 | ||
115 | 115 | ||
@@ -175,13 +175,13 @@ void coda_iattr_to_vattr(struct iattr *iattr, struct coda_vattr *vattr) | |||
175 | vattr->va_size = iattr->ia_size; | 175 | vattr->va_size = iattr->ia_size; |
176 | } | 176 | } |
177 | if ( valid & ATTR_ATIME ) { | 177 | if ( valid & ATTR_ATIME ) { |
178 | vattr->va_atime = iattr->ia_atime; | 178 | vattr->va_atime = timespec64_to_timespec(iattr->ia_atime); |
179 | } | 179 | } |
180 | if ( valid & ATTR_MTIME ) { | 180 | if ( valid & ATTR_MTIME ) { |
181 | vattr->va_mtime = iattr->ia_mtime; | 181 | vattr->va_mtime = timespec64_to_timespec(iattr->ia_mtime); |
182 | } | 182 | } |
183 | if ( valid & ATTR_CTIME ) { | 183 | if ( valid & ATTR_CTIME ) { |
184 | vattr->va_ctime = iattr->ia_ctime; | 184 | vattr->va_ctime = timespec64_to_timespec(iattr->ia_ctime); |
185 | } | 185 | } |
186 | } | 186 | } |
187 | 187 | ||
diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c index ad718e5e37bb..28ef9e528853 100644 --- a/fs/configfs/inode.c +++ b/fs/configfs/inode.c | |||
@@ -90,14 +90,14 @@ int configfs_setattr(struct dentry * dentry, struct iattr * iattr) | |||
90 | if (ia_valid & ATTR_GID) | 90 | if (ia_valid & ATTR_GID) |
91 | sd_iattr->ia_gid = iattr->ia_gid; | 91 | sd_iattr->ia_gid = iattr->ia_gid; |
92 | if (ia_valid & ATTR_ATIME) | 92 | if (ia_valid & ATTR_ATIME) |
93 | sd_iattr->ia_atime = timespec_trunc(iattr->ia_atime, | 93 | sd_iattr->ia_atime = timespec64_trunc(iattr->ia_atime, |
94 | inode->i_sb->s_time_gran); | 94 | inode->i_sb->s_time_gran); |
95 | if (ia_valid & ATTR_MTIME) | 95 | if (ia_valid & ATTR_MTIME) |
96 | sd_iattr->ia_mtime = timespec_trunc(iattr->ia_mtime, | 96 | sd_iattr->ia_mtime = timespec64_trunc(iattr->ia_mtime, |
97 | inode->i_sb->s_time_gran); | 97 | inode->i_sb->s_time_gran); |
98 | if (ia_valid & ATTR_CTIME) | 98 | if (ia_valid & ATTR_CTIME) |
99 | sd_iattr->ia_ctime = timespec_trunc(iattr->ia_ctime, | 99 | sd_iattr->ia_ctime = timespec64_trunc(iattr->ia_ctime, |
100 | inode->i_sb->s_time_gran); | 100 | inode->i_sb->s_time_gran); |
101 | if (ia_valid & ATTR_MODE) { | 101 | if (ia_valid & ATTR_MODE) { |
102 | umode_t mode = iattr->ia_mode; | 102 | umode_t mode = iattr->ia_mode; |
103 | 103 | ||
diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c index 017b0ab19bc4..d7a600e00f28 100644 --- a/fs/cramfs/inode.c +++ b/fs/cramfs/inode.c | |||
@@ -90,7 +90,7 @@ static struct inode *get_cramfs_inode(struct super_block *sb, | |||
90 | const struct cramfs_inode *cramfs_inode, unsigned int offset) | 90 | const struct cramfs_inode *cramfs_inode, unsigned int offset) |
91 | { | 91 | { |
92 | struct inode *inode; | 92 | struct inode *inode; |
93 | static struct timespec zerotime; | 93 | static struct timespec64 zerotime; |
94 | 94 | ||
95 | inode = iget_locked(sb, cramino(cramfs_inode, offset)); | 95 | inode = iget_locked(sb, cramino(cramfs_inode, offset)); |
96 | if (!inode) | 96 | if (!inode) |
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index a42e71203e53..f76d0777f7ad 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -817,12 +817,14 @@ static inline void ext4_decode_extra_time(struct timespec *time, __le32 extra) | |||
817 | time->tv_nsec = (le32_to_cpu(extra) & EXT4_NSEC_MASK) >> EXT4_EPOCH_BITS; | 817 | time->tv_nsec = (le32_to_cpu(extra) & EXT4_NSEC_MASK) >> EXT4_EPOCH_BITS; |
818 | } | 818 | } |
819 | 819 | ||
820 | #define EXT4_INODE_SET_XTIME(xtime, inode, raw_inode) \ | 820 | #define EXT4_INODE_SET_XTIME(xtime, inode, raw_inode) \ |
821 | do { \ | 821 | do { \ |
822 | (raw_inode)->xtime = cpu_to_le32((inode)->xtime.tv_sec); \ | 822 | (raw_inode)->xtime = cpu_to_le32((inode)->xtime.tv_sec); \ |
823 | if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), xtime ## _extra)) \ | 823 | if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), xtime ## _extra)) {\ |
824 | (raw_inode)->xtime ## _extra = \ | 824 | struct timespec ts = timespec64_to_timespec((inode)->xtime); \ |
825 | ext4_encode_extra_time(&(inode)->xtime); \ | 825 | (raw_inode)->xtime ## _extra = \ |
826 | ext4_encode_extra_time(&ts); \ | ||
827 | } \ | ||
826 | } while (0) | 828 | } while (0) |
827 | 829 | ||
828 | #define EXT4_EINODE_SET_XTIME(xtime, einode, raw_inode) \ | 830 | #define EXT4_EINODE_SET_XTIME(xtime, einode, raw_inode) \ |
@@ -834,16 +836,20 @@ do { \ | |||
834 | ext4_encode_extra_time(&(einode)->xtime); \ | 836 | ext4_encode_extra_time(&(einode)->xtime); \ |
835 | } while (0) | 837 | } while (0) |
836 | 838 | ||
837 | #define EXT4_INODE_GET_XTIME(xtime, inode, raw_inode) \ | 839 | #define EXT4_INODE_GET_XTIME(xtime, inode, raw_inode) \ |
838 | do { \ | 840 | do { \ |
839 | (inode)->xtime.tv_sec = (signed)le32_to_cpu((raw_inode)->xtime); \ | 841 | (inode)->xtime.tv_sec = (signed)le32_to_cpu((raw_inode)->xtime); \ |
840 | if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), xtime ## _extra)) \ | 842 | if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), xtime ## _extra)) { \ |
841 | ext4_decode_extra_time(&(inode)->xtime, \ | 843 | struct timespec ts = timespec64_to_timespec((inode)->xtime); \ |
842 | raw_inode->xtime ## _extra); \ | 844 | ext4_decode_extra_time(&ts, \ |
843 | else \ | 845 | raw_inode->xtime ## _extra); \ |
844 | (inode)->xtime.tv_nsec = 0; \ | 846 | (inode)->xtime = timespec_to_timespec64(ts); \ |
847 | } \ | ||
848 | else \ | ||
849 | (inode)->xtime.tv_nsec = 0; \ | ||
845 | } while (0) | 850 | } while (0) |
846 | 851 | ||
852 | |||
847 | #define EXT4_EINODE_GET_XTIME(xtime, einode, raw_inode) \ | 853 | #define EXT4_EINODE_GET_XTIME(xtime, einode, raw_inode) \ |
848 | do { \ | 854 | do { \ |
849 | if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime)) \ | 855 | if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime)) \ |
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index df92e3ec9913..751e1be2c652 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c | |||
@@ -1078,8 +1078,8 @@ got: | |||
1078 | inode->i_ino = ino + group * EXT4_INODES_PER_GROUP(sb); | 1078 | inode->i_ino = ino + group * EXT4_INODES_PER_GROUP(sb); |
1079 | /* This is the optimal IO size (for stat), not the fs block size */ | 1079 | /* This is the optimal IO size (for stat), not the fs block size */ |
1080 | inode->i_blocks = 0; | 1080 | inode->i_blocks = 0; |
1081 | inode->i_mtime = inode->i_atime = inode->i_ctime = ei->i_crtime = | 1081 | inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); |
1082 | current_time(inode); | 1082 | ei->i_crtime = timespec64_to_timespec(inode->i_mtime); |
1083 | 1083 | ||
1084 | memset(ei->i_data, 0, sizeof(ei->i_data)); | 1084 | memset(ei->i_data, 0, sizeof(ei->i_data)); |
1085 | ei->i_dir_start_lookup = 0; | 1085 | ei->i_dir_start_lookup = 0; |
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index b1f21e3a0763..2feb546dfcaf 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c | |||
@@ -3675,7 +3675,7 @@ static int ext4_cross_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
3675 | }; | 3675 | }; |
3676 | u8 new_file_type; | 3676 | u8 new_file_type; |
3677 | int retval; | 3677 | int retval; |
3678 | struct timespec ctime; | 3678 | struct timespec64 ctime; |
3679 | 3679 | ||
3680 | if ((ext4_test_inode_flag(new_dir, EXT4_INODE_PROJINHERIT) && | 3680 | if ((ext4_test_inode_flag(new_dir, EXT4_INODE_PROJINHERIT) && |
3681 | !projid_eq(EXT4_I(new_dir)->i_projid, | 3681 | !projid_eq(EXT4_I(new_dir)->i_projid, |
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 1df7f10476d6..57e663b37dc8 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h | |||
@@ -2460,6 +2460,7 @@ static inline void clear_file(struct inode *inode, int type) | |||
2460 | 2460 | ||
2461 | static inline bool f2fs_skip_inode_update(struct inode *inode, int dsync) | 2461 | static inline bool f2fs_skip_inode_update(struct inode *inode, int dsync) |
2462 | { | 2462 | { |
2463 | struct timespec ts; | ||
2463 | bool ret; | 2464 | bool ret; |
2464 | 2465 | ||
2465 | if (dsync) { | 2466 | if (dsync) { |
@@ -2475,11 +2476,14 @@ static inline bool f2fs_skip_inode_update(struct inode *inode, int dsync) | |||
2475 | i_size_read(inode) & ~PAGE_MASK) | 2476 | i_size_read(inode) & ~PAGE_MASK) |
2476 | return false; | 2477 | return false; |
2477 | 2478 | ||
2478 | if (!timespec_equal(F2FS_I(inode)->i_disk_time, &inode->i_atime)) | 2479 | ts = timespec64_to_timespec(inode->i_atime); |
2480 | if (!timespec_equal(F2FS_I(inode)->i_disk_time, &ts)) | ||
2479 | return false; | 2481 | return false; |
2480 | if (!timespec_equal(F2FS_I(inode)->i_disk_time + 1, &inode->i_ctime)) | 2482 | ts = timespec64_to_timespec(inode->i_ctime); |
2483 | if (!timespec_equal(F2FS_I(inode)->i_disk_time + 1, &ts)) | ||
2481 | return false; | 2484 | return false; |
2482 | if (!timespec_equal(F2FS_I(inode)->i_disk_time + 2, &inode->i_mtime)) | 2485 | ts = timespec64_to_timespec(inode->i_mtime); |
2486 | if (!timespec_equal(F2FS_I(inode)->i_disk_time + 2, &ts)) | ||
2483 | return false; | 2487 | return false; |
2484 | if (!timespec_equal(F2FS_I(inode)->i_disk_time + 3, | 2488 | if (!timespec_equal(F2FS_I(inode)->i_disk_time + 3, |
2485 | &F2FS_I(inode)->i_crtime)) | 2489 | &F2FS_I(inode)->i_crtime)) |
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 6b94f19b3fa8..5f353302fdc6 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c | |||
@@ -724,14 +724,14 @@ static void __setattr_copy(struct inode *inode, const struct iattr *attr) | |||
724 | if (ia_valid & ATTR_GID) | 724 | if (ia_valid & ATTR_GID) |
725 | inode->i_gid = attr->ia_gid; | 725 | inode->i_gid = attr->ia_gid; |
726 | if (ia_valid & ATTR_ATIME) | 726 | if (ia_valid & ATTR_ATIME) |
727 | inode->i_atime = timespec_trunc(attr->ia_atime, | 727 | inode->i_atime = timespec64_trunc(attr->ia_atime, |
728 | inode->i_sb->s_time_gran); | 728 | inode->i_sb->s_time_gran); |
729 | if (ia_valid & ATTR_MTIME) | 729 | if (ia_valid & ATTR_MTIME) |
730 | inode->i_mtime = timespec_trunc(attr->ia_mtime, | 730 | inode->i_mtime = timespec64_trunc(attr->ia_mtime, |
731 | inode->i_sb->s_time_gran); | 731 | inode->i_sb->s_time_gran); |
732 | if (ia_valid & ATTR_CTIME) | 732 | if (ia_valid & ATTR_CTIME) |
733 | inode->i_ctime = timespec_trunc(attr->ia_ctime, | 733 | inode->i_ctime = timespec64_trunc(attr->ia_ctime, |
734 | inode->i_sb->s_time_gran); | 734 | inode->i_sb->s_time_gran); |
735 | if (ia_valid & ATTR_MODE) { | 735 | if (ia_valid & ATTR_MODE) { |
736 | umode_t mode = attr->ia_mode; | 736 | umode_t mode = attr->ia_mode; |
737 | 737 | ||
diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index e0d9e8f27ed2..2360a9d9a09e 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c | |||
@@ -284,9 +284,9 @@ static int do_read_inode(struct inode *inode) | |||
284 | fi->i_crtime.tv_nsec = le32_to_cpu(ri->i_crtime_nsec); | 284 | fi->i_crtime.tv_nsec = le32_to_cpu(ri->i_crtime_nsec); |
285 | } | 285 | } |
286 | 286 | ||
287 | F2FS_I(inode)->i_disk_time[0] = inode->i_atime; | 287 | F2FS_I(inode)->i_disk_time[0] = timespec64_to_timespec(inode->i_atime); |
288 | F2FS_I(inode)->i_disk_time[1] = inode->i_ctime; | 288 | F2FS_I(inode)->i_disk_time[1] = timespec64_to_timespec(inode->i_ctime); |
289 | F2FS_I(inode)->i_disk_time[2] = inode->i_mtime; | 289 | F2FS_I(inode)->i_disk_time[2] = timespec64_to_timespec(inode->i_mtime); |
290 | F2FS_I(inode)->i_disk_time[3] = F2FS_I(inode)->i_crtime; | 290 | F2FS_I(inode)->i_disk_time[3] = F2FS_I(inode)->i_crtime; |
291 | f2fs_put_page(node_page, 1); | 291 | f2fs_put_page(node_page, 1); |
292 | 292 | ||
@@ -448,9 +448,9 @@ void update_inode(struct inode *inode, struct page *node_page) | |||
448 | if (inode->i_nlink == 0) | 448 | if (inode->i_nlink == 0) |
449 | clear_inline_node(node_page); | 449 | clear_inline_node(node_page); |
450 | 450 | ||
451 | F2FS_I(inode)->i_disk_time[0] = inode->i_atime; | 451 | F2FS_I(inode)->i_disk_time[0] = timespec64_to_timespec(inode->i_atime); |
452 | F2FS_I(inode)->i_disk_time[1] = inode->i_ctime; | 452 | F2FS_I(inode)->i_disk_time[1] = timespec64_to_timespec(inode->i_ctime); |
453 | F2FS_I(inode)->i_disk_time[2] = inode->i_mtime; | 453 | F2FS_I(inode)->i_disk_time[2] = timespec64_to_timespec(inode->i_mtime); |
454 | F2FS_I(inode)->i_disk_time[3] = F2FS_I(inode)->i_crtime; | 454 | F2FS_I(inode)->i_disk_time[3] = F2FS_I(inode)->i_crtime; |
455 | } | 455 | } |
456 | 456 | ||
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c index d5098efe577c..ae10fe34f63d 100644 --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c | |||
@@ -50,8 +50,8 @@ static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode) | |||
50 | 50 | ||
51 | inode->i_ino = ino; | 51 | inode->i_ino = ino; |
52 | inode->i_blocks = 0; | 52 | inode->i_blocks = 0; |
53 | inode->i_mtime = inode->i_atime = inode->i_ctime = | 53 | inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); |
54 | F2FS_I(inode)->i_crtime = current_time(inode); | 54 | F2FS_I(inode)->i_crtime = timespec64_to_timespec(inode->i_mtime); |
55 | inode->i_generation = sbi->s_next_generation++; | 55 | inode->i_generation = sbi->s_next_generation++; |
56 | 56 | ||
57 | err = insert_inode_locked(inode); | 57 | err = insert_inode_locked(inode); |
diff --git a/fs/fat/inode.c b/fs/fat/inode.c index ffbbf0520d9e..13271ea2b453 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c | |||
@@ -502,6 +502,7 @@ static int fat_validate_dir(struct inode *dir) | |||
502 | /* doesn't deal with root inode */ | 502 | /* doesn't deal with root inode */ |
503 | int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de) | 503 | int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de) |
504 | { | 504 | { |
505 | struct timespec ts; | ||
505 | struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb); | 506 | struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb); |
506 | int error; | 507 | int error; |
507 | 508 | ||
@@ -552,11 +553,14 @@ int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de) | |||
552 | inode->i_blocks = ((inode->i_size + (sbi->cluster_size - 1)) | 553 | inode->i_blocks = ((inode->i_size + (sbi->cluster_size - 1)) |
553 | & ~((loff_t)sbi->cluster_size - 1)) >> 9; | 554 | & ~((loff_t)sbi->cluster_size - 1)) >> 9; |
554 | 555 | ||
555 | fat_time_fat2unix(sbi, &inode->i_mtime, de->time, de->date, 0); | 556 | fat_time_fat2unix(sbi, &ts, de->time, de->date, 0); |
557 | inode->i_mtime = timespec_to_timespec64(ts); | ||
556 | if (sbi->options.isvfat) { | 558 | if (sbi->options.isvfat) { |
557 | fat_time_fat2unix(sbi, &inode->i_ctime, de->ctime, | 559 | fat_time_fat2unix(sbi, &ts, de->ctime, |
558 | de->cdate, de->ctime_cs); | 560 | de->cdate, de->ctime_cs); |
559 | fat_time_fat2unix(sbi, &inode->i_atime, 0, de->adate, 0); | 561 | inode->i_ctime = timespec_to_timespec64(ts); |
562 | fat_time_fat2unix(sbi, &ts, 0, de->adate, 0); | ||
563 | inode->i_atime = timespec_to_timespec64(ts); | ||
560 | } else | 564 | } else |
561 | inode->i_ctime = inode->i_atime = inode->i_mtime; | 565 | inode->i_ctime = inode->i_atime = inode->i_mtime; |
562 | 566 | ||
@@ -825,6 +829,7 @@ static int fat_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
825 | 829 | ||
826 | static int __fat_write_inode(struct inode *inode, int wait) | 830 | static int __fat_write_inode(struct inode *inode, int wait) |
827 | { | 831 | { |
832 | struct timespec ts; | ||
828 | struct super_block *sb = inode->i_sb; | 833 | struct super_block *sb = inode->i_sb; |
829 | struct msdos_sb_info *sbi = MSDOS_SB(sb); | 834 | struct msdos_sb_info *sbi = MSDOS_SB(sb); |
830 | struct buffer_head *bh; | 835 | struct buffer_head *bh; |
@@ -862,13 +867,16 @@ retry: | |||
862 | raw_entry->size = cpu_to_le32(inode->i_size); | 867 | raw_entry->size = cpu_to_le32(inode->i_size); |
863 | raw_entry->attr = fat_make_attrs(inode); | 868 | raw_entry->attr = fat_make_attrs(inode); |
864 | fat_set_start(raw_entry, MSDOS_I(inode)->i_logstart); | 869 | fat_set_start(raw_entry, MSDOS_I(inode)->i_logstart); |
865 | fat_time_unix2fat(sbi, &inode->i_mtime, &raw_entry->time, | 870 | ts = timespec64_to_timespec(inode->i_mtime); |
871 | fat_time_unix2fat(sbi, &ts, &raw_entry->time, | ||
866 | &raw_entry->date, NULL); | 872 | &raw_entry->date, NULL); |
867 | if (sbi->options.isvfat) { | 873 | if (sbi->options.isvfat) { |
868 | __le16 atime; | 874 | __le16 atime; |
869 | fat_time_unix2fat(sbi, &inode->i_ctime, &raw_entry->ctime, | 875 | ts = timespec64_to_timespec(inode->i_ctime); |
876 | fat_time_unix2fat(sbi, &ts, &raw_entry->ctime, | ||
870 | &raw_entry->cdate, &raw_entry->ctime_cs); | 877 | &raw_entry->cdate, &raw_entry->ctime_cs); |
871 | fat_time_unix2fat(sbi, &inode->i_atime, &atime, | 878 | ts = timespec64_to_timespec(inode->i_atime); |
879 | fat_time_unix2fat(sbi, &ts, &atime, | ||
872 | &raw_entry->adate, NULL); | 880 | &raw_entry->adate, NULL); |
873 | } | 881 | } |
874 | spin_unlock(&sbi->inode_hash_lock); | 882 | spin_unlock(&sbi->inode_hash_lock); |
diff --git a/fs/fat/namei_msdos.c b/fs/fat/namei_msdos.c index 582ca731a6c9..df6eb551f713 100644 --- a/fs/fat/namei_msdos.c +++ b/fs/fat/namei_msdos.c | |||
@@ -250,7 +250,7 @@ static int msdos_add_entry(struct inode *dir, const unsigned char *name, | |||
250 | if (err) | 250 | if (err) |
251 | return err; | 251 | return err; |
252 | 252 | ||
253 | dir->i_ctime = dir->i_mtime = *ts; | 253 | dir->i_ctime = dir->i_mtime = timespec_to_timespec64(*ts); |
254 | if (IS_DIRSYNC(dir)) | 254 | if (IS_DIRSYNC(dir)) |
255 | (void)fat_sync_inode(dir); | 255 | (void)fat_sync_inode(dir); |
256 | else | 256 | else |
@@ -266,7 +266,8 @@ static int msdos_create(struct inode *dir, struct dentry *dentry, umode_t mode, | |||
266 | struct super_block *sb = dir->i_sb; | 266 | struct super_block *sb = dir->i_sb; |
267 | struct inode *inode = NULL; | 267 | struct inode *inode = NULL; |
268 | struct fat_slot_info sinfo; | 268 | struct fat_slot_info sinfo; |
269 | struct timespec ts; | 269 | struct timespec64 ts; |
270 | struct timespec t; | ||
270 | unsigned char msdos_name[MSDOS_NAME]; | 271 | unsigned char msdos_name[MSDOS_NAME]; |
271 | int err, is_hid; | 272 | int err, is_hid; |
272 | 273 | ||
@@ -285,7 +286,8 @@ static int msdos_create(struct inode *dir, struct dentry *dentry, umode_t mode, | |||
285 | } | 286 | } |
286 | 287 | ||
287 | ts = current_time(dir); | 288 | ts = current_time(dir); |
288 | err = msdos_add_entry(dir, msdos_name, 0, is_hid, 0, &ts, &sinfo); | 289 | t = timespec64_to_timespec(ts); |
290 | err = msdos_add_entry(dir, msdos_name, 0, is_hid, 0, &t, &sinfo); | ||
289 | if (err) | 291 | if (err) |
290 | goto out; | 292 | goto out; |
291 | inode = fat_build_inode(sb, sinfo.de, sinfo.i_pos); | 293 | inode = fat_build_inode(sb, sinfo.de, sinfo.i_pos); |
@@ -348,7 +350,8 @@ static int msdos_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) | |||
348 | struct fat_slot_info sinfo; | 350 | struct fat_slot_info sinfo; |
349 | struct inode *inode; | 351 | struct inode *inode; |
350 | unsigned char msdos_name[MSDOS_NAME]; | 352 | unsigned char msdos_name[MSDOS_NAME]; |
351 | struct timespec ts; | 353 | struct timespec64 ts; |
354 | struct timespec t; | ||
352 | int err, is_hid, cluster; | 355 | int err, is_hid, cluster; |
353 | 356 | ||
354 | mutex_lock(&MSDOS_SB(sb)->s_lock); | 357 | mutex_lock(&MSDOS_SB(sb)->s_lock); |
@@ -366,12 +369,13 @@ static int msdos_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) | |||
366 | } | 369 | } |
367 | 370 | ||
368 | ts = current_time(dir); | 371 | ts = current_time(dir); |
369 | cluster = fat_alloc_new_dir(dir, &ts); | 372 | t = timespec64_to_timespec(ts); |
373 | cluster = fat_alloc_new_dir(dir, &t); | ||
370 | if (cluster < 0) { | 374 | if (cluster < 0) { |
371 | err = cluster; | 375 | err = cluster; |
372 | goto out; | 376 | goto out; |
373 | } | 377 | } |
374 | err = msdos_add_entry(dir, msdos_name, 1, is_hid, cluster, &ts, &sinfo); | 378 | err = msdos_add_entry(dir, msdos_name, 1, is_hid, cluster, &t, &sinfo); |
375 | if (err) | 379 | if (err) |
376 | goto out_free; | 380 | goto out_free; |
377 | inc_nlink(dir); | 381 | inc_nlink(dir); |
@@ -436,7 +440,7 @@ static int do_msdos_rename(struct inode *old_dir, unsigned char *old_name, | |||
436 | struct msdos_dir_entry *dotdot_de; | 440 | struct msdos_dir_entry *dotdot_de; |
437 | struct inode *old_inode, *new_inode; | 441 | struct inode *old_inode, *new_inode; |
438 | struct fat_slot_info old_sinfo, sinfo; | 442 | struct fat_slot_info old_sinfo, sinfo; |
439 | struct timespec ts; | 443 | struct timespec64 ts; |
440 | loff_t new_i_pos; | 444 | loff_t new_i_pos; |
441 | int err, old_attrs, is_dir, update_dotdot, corrupt = 0; | 445 | int err, old_attrs, is_dir, update_dotdot, corrupt = 0; |
442 | 446 | ||
@@ -503,8 +507,9 @@ static int do_msdos_rename(struct inode *old_dir, unsigned char *old_name, | |||
503 | new_i_pos = MSDOS_I(new_inode)->i_pos; | 507 | new_i_pos = MSDOS_I(new_inode)->i_pos; |
504 | fat_detach(new_inode); | 508 | fat_detach(new_inode); |
505 | } else { | 509 | } else { |
510 | struct timespec t = timespec64_to_timespec(ts); | ||
506 | err = msdos_add_entry(new_dir, new_name, is_dir, is_hid, 0, | 511 | err = msdos_add_entry(new_dir, new_name, is_dir, is_hid, 0, |
507 | &ts, &sinfo); | 512 | &t, &sinfo); |
508 | if (err) | 513 | if (err) |
509 | goto out; | 514 | goto out; |
510 | new_i_pos = sinfo.i_pos; | 515 | new_i_pos = sinfo.i_pos; |
diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c index 2649759c478a..caa229423327 100644 --- a/fs/fat/namei_vfat.c +++ b/fs/fat/namei_vfat.c | |||
@@ -678,7 +678,7 @@ static int vfat_add_entry(struct inode *dir, const struct qstr *qname, | |||
678 | goto cleanup; | 678 | goto cleanup; |
679 | 679 | ||
680 | /* update timestamp */ | 680 | /* update timestamp */ |
681 | dir->i_ctime = dir->i_mtime = dir->i_atime = *ts; | 681 | dir->i_ctime = dir->i_mtime = dir->i_atime = timespec_to_timespec64(*ts); |
682 | if (IS_DIRSYNC(dir)) | 682 | if (IS_DIRSYNC(dir)) |
683 | (void)fat_sync_inode(dir); | 683 | (void)fat_sync_inode(dir); |
684 | else | 684 | else |
@@ -772,13 +772,15 @@ static int vfat_create(struct inode *dir, struct dentry *dentry, umode_t mode, | |||
772 | struct super_block *sb = dir->i_sb; | 772 | struct super_block *sb = dir->i_sb; |
773 | struct inode *inode; | 773 | struct inode *inode; |
774 | struct fat_slot_info sinfo; | 774 | struct fat_slot_info sinfo; |
775 | struct timespec ts; | 775 | struct timespec64 ts; |
776 | struct timespec t; | ||
776 | int err; | 777 | int err; |
777 | 778 | ||
778 | mutex_lock(&MSDOS_SB(sb)->s_lock); | 779 | mutex_lock(&MSDOS_SB(sb)->s_lock); |
779 | 780 | ||
780 | ts = current_time(dir); | 781 | ts = current_time(dir); |
781 | err = vfat_add_entry(dir, &dentry->d_name, 0, 0, &ts, &sinfo); | 782 | t = timespec64_to_timespec(ts); |
783 | err = vfat_add_entry(dir, &dentry->d_name, 0, 0, &t, &sinfo); | ||
782 | if (err) | 784 | if (err) |
783 | goto out; | 785 | goto out; |
784 | inode_inc_iversion(dir); | 786 | inode_inc_iversion(dir); |
@@ -861,18 +863,20 @@ static int vfat_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) | |||
861 | struct super_block *sb = dir->i_sb; | 863 | struct super_block *sb = dir->i_sb; |
862 | struct inode *inode; | 864 | struct inode *inode; |
863 | struct fat_slot_info sinfo; | 865 | struct fat_slot_info sinfo; |
864 | struct timespec ts; | 866 | struct timespec64 ts; |
867 | struct timespec t; | ||
865 | int err, cluster; | 868 | int err, cluster; |
866 | 869 | ||
867 | mutex_lock(&MSDOS_SB(sb)->s_lock); | 870 | mutex_lock(&MSDOS_SB(sb)->s_lock); |
868 | 871 | ||
869 | ts = current_time(dir); | 872 | ts = current_time(dir); |
870 | cluster = fat_alloc_new_dir(dir, &ts); | 873 | t = timespec64_to_timespec(ts); |
874 | cluster = fat_alloc_new_dir(dir, &t); | ||
871 | if (cluster < 0) { | 875 | if (cluster < 0) { |
872 | err = cluster; | 876 | err = cluster; |
873 | goto out; | 877 | goto out; |
874 | } | 878 | } |
875 | err = vfat_add_entry(dir, &dentry->d_name, 1, cluster, &ts, &sinfo); | 879 | err = vfat_add_entry(dir, &dentry->d_name, 1, cluster, &t, &sinfo); |
876 | if (err) | 880 | if (err) |
877 | goto out_free; | 881 | goto out_free; |
878 | inode_inc_iversion(dir); | 882 | inode_inc_iversion(dir); |
@@ -910,7 +914,8 @@ static int vfat_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
910 | struct msdos_dir_entry *dotdot_de; | 914 | struct msdos_dir_entry *dotdot_de; |
911 | struct inode *old_inode, *new_inode; | 915 | struct inode *old_inode, *new_inode; |
912 | struct fat_slot_info old_sinfo, sinfo; | 916 | struct fat_slot_info old_sinfo, sinfo; |
913 | struct timespec ts; | 917 | struct timespec64 ts; |
918 | struct timespec t; | ||
914 | loff_t new_i_pos; | 919 | loff_t new_i_pos; |
915 | int err, is_dir, update_dotdot, corrupt = 0; | 920 | int err, is_dir, update_dotdot, corrupt = 0; |
916 | struct super_block *sb = old_dir->i_sb; | 921 | struct super_block *sb = old_dir->i_sb; |
@@ -945,8 +950,9 @@ static int vfat_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
945 | new_i_pos = MSDOS_I(new_inode)->i_pos; | 950 | new_i_pos = MSDOS_I(new_inode)->i_pos; |
946 | fat_detach(new_inode); | 951 | fat_detach(new_inode); |
947 | } else { | 952 | } else { |
953 | t = timespec64_to_timespec(ts); | ||
948 | err = vfat_add_entry(new_dir, &new_dentry->d_name, is_dir, 0, | 954 | err = vfat_add_entry(new_dir, &new_dentry->d_name, is_dir, 0, |
949 | &ts, &sinfo); | 955 | &t, &sinfo); |
950 | if (err) | 956 | if (err) |
951 | goto out; | 957 | goto out; |
952 | new_i_pos = sinfo.i_pos; | 958 | new_i_pos = sinfo.i_pos; |
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index ef309958e060..e9e938947723 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c | |||
@@ -217,7 +217,7 @@ void fuse_change_attributes(struct inode *inode, struct fuse_attr *attr, | |||
217 | return; | 217 | return; |
218 | } | 218 | } |
219 | 219 | ||
220 | old_mtime = inode->i_mtime; | 220 | old_mtime = timespec64_to_timespec(inode->i_mtime); |
221 | fuse_change_attributes_common(inode, attr, attr_valid); | 221 | fuse_change_attributes_common(inode, attr, attr_valid); |
222 | 222 | ||
223 | oldsize = inode->i_size; | 223 | oldsize = inode->i_size; |
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index d9fb0ad6cc30..c22090e97ff0 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c | |||
@@ -871,7 +871,7 @@ static struct gfs2_leaf *new_leaf(struct inode *inode, struct buffer_head **pbh, | |||
871 | struct buffer_head *bh; | 871 | struct buffer_head *bh; |
872 | struct gfs2_leaf *leaf; | 872 | struct gfs2_leaf *leaf; |
873 | struct gfs2_dirent *dent; | 873 | struct gfs2_dirent *dent; |
874 | struct timespec tv = current_time(inode); | 874 | struct timespec64 tv = current_time(inode); |
875 | 875 | ||
876 | error = gfs2_alloc_blocks(ip, &bn, &n, 0, NULL); | 876 | error = gfs2_alloc_blocks(ip, &bn, &n, 0, NULL); |
877 | if (error) | 877 | if (error) |
@@ -1802,7 +1802,7 @@ int gfs2_dir_add(struct inode *inode, const struct qstr *name, | |||
1802 | struct gfs2_inode *ip = GFS2_I(inode); | 1802 | struct gfs2_inode *ip = GFS2_I(inode); |
1803 | struct buffer_head *bh = da->bh; | 1803 | struct buffer_head *bh = da->bh; |
1804 | struct gfs2_dirent *dent = da->dent; | 1804 | struct gfs2_dirent *dent = da->dent; |
1805 | struct timespec tv; | 1805 | struct timespec64 tv; |
1806 | struct gfs2_leaf *leaf; | 1806 | struct gfs2_leaf *leaf; |
1807 | int error; | 1807 | int error; |
1808 | 1808 | ||
@@ -1880,7 +1880,7 @@ int gfs2_dir_del(struct gfs2_inode *dip, const struct dentry *dentry) | |||
1880 | const struct qstr *name = &dentry->d_name; | 1880 | const struct qstr *name = &dentry->d_name; |
1881 | struct gfs2_dirent *dent, *prev = NULL; | 1881 | struct gfs2_dirent *dent, *prev = NULL; |
1882 | struct buffer_head *bh; | 1882 | struct buffer_head *bh; |
1883 | struct timespec tv = current_time(&dip->i_inode); | 1883 | struct timespec64 tv = current_time(&dip->i_inode); |
1884 | 1884 | ||
1885 | /* Returns _either_ the entry (if its first in block) or the | 1885 | /* Returns _either_ the entry (if its first in block) or the |
1886 | previous entry otherwise */ | 1886 | previous entry otherwise */ |
diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c index d8782a7a1e7d..c63bee9adb6a 100644 --- a/fs/gfs2/glops.c +++ b/fs/gfs2/glops.c | |||
@@ -338,7 +338,7 @@ static int inode_go_demote_ok(const struct gfs2_glock *gl) | |||
338 | static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf) | 338 | static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf) |
339 | { | 339 | { |
340 | const struct gfs2_dinode *str = buf; | 340 | const struct gfs2_dinode *str = buf; |
341 | struct timespec atime; | 341 | struct timespec64 atime; |
342 | u16 height, depth; | 342 | u16 height, depth; |
343 | 343 | ||
344 | if (unlikely(ip->i_no_addr != be64_to_cpu(str->di_num.no_addr))) | 344 | if (unlikely(ip->i_no_addr != be64_to_cpu(str->di_num.no_addr))) |
@@ -361,7 +361,7 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf) | |||
361 | gfs2_set_inode_blocks(&ip->i_inode, be64_to_cpu(str->di_blocks)); | 361 | gfs2_set_inode_blocks(&ip->i_inode, be64_to_cpu(str->di_blocks)); |
362 | atime.tv_sec = be64_to_cpu(str->di_atime); | 362 | atime.tv_sec = be64_to_cpu(str->di_atime); |
363 | atime.tv_nsec = be32_to_cpu(str->di_atime_nsec); | 363 | atime.tv_nsec = be32_to_cpu(str->di_atime_nsec); |
364 | if (timespec_compare(&ip->i_inode.i_atime, &atime) < 0) | 364 | if (timespec64_compare(&ip->i_inode.i_atime, &atime) < 0) |
365 | ip->i_inode.i_atime = atime; | 365 | ip->i_inode.i_atime = atime; |
366 | ip->i_inode.i_mtime.tv_sec = be64_to_cpu(str->di_mtime); | 366 | ip->i_inode.i_mtime.tv_sec = be64_to_cpu(str->di_mtime); |
367 | ip->i_inode.i_mtime.tv_nsec = be32_to_cpu(str->di_mtime_nsec); | 367 | ip->i_inode.i_mtime.tv_nsec = be32_to_cpu(str->di_mtime_nsec); |
diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c index 2538b49cc349..8ea683f01cda 100644 --- a/fs/hfs/inode.c +++ b/fs/hfs/inode.c | |||
@@ -351,7 +351,7 @@ static int hfs_read_inode(struct inode *inode, void *data) | |||
351 | inode->i_mode &= ~hsb->s_file_umask; | 351 | inode->i_mode &= ~hsb->s_file_umask; |
352 | inode->i_mode |= S_IFREG; | 352 | inode->i_mode |= S_IFREG; |
353 | inode->i_ctime = inode->i_atime = inode->i_mtime = | 353 | inode->i_ctime = inode->i_atime = inode->i_mtime = |
354 | hfs_m_to_utime(rec->file.MdDat); | 354 | timespec_to_timespec64(hfs_m_to_utime(rec->file.MdDat)); |
355 | inode->i_op = &hfs_file_inode_operations; | 355 | inode->i_op = &hfs_file_inode_operations; |
356 | inode->i_fop = &hfs_file_operations; | 356 | inode->i_fop = &hfs_file_operations; |
357 | inode->i_mapping->a_ops = &hfs_aops; | 357 | inode->i_mapping->a_ops = &hfs_aops; |
@@ -362,7 +362,7 @@ static int hfs_read_inode(struct inode *inode, void *data) | |||
362 | HFS_I(inode)->fs_blocks = 0; | 362 | HFS_I(inode)->fs_blocks = 0; |
363 | inode->i_mode = S_IFDIR | (S_IRWXUGO & ~hsb->s_dir_umask); | 363 | inode->i_mode = S_IFDIR | (S_IRWXUGO & ~hsb->s_dir_umask); |
364 | inode->i_ctime = inode->i_atime = inode->i_mtime = | 364 | inode->i_ctime = inode->i_atime = inode->i_mtime = |
365 | hfs_m_to_utime(rec->dir.MdDat); | 365 | timespec_to_timespec64(hfs_m_to_utime(rec->dir.MdDat)); |
366 | inode->i_op = &hfs_dir_inode_operations; | 366 | inode->i_op = &hfs_dir_inode_operations; |
367 | inode->i_fop = &hfs_dir_operations; | 367 | inode->i_fop = &hfs_dir_operations; |
368 | break; | 368 | break; |
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index c0c8d433864f..c824f702feec 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c | |||
@@ -493,9 +493,9 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd) | |||
493 | hfsplus_get_perms(inode, &folder->permissions, 1); | 493 | hfsplus_get_perms(inode, &folder->permissions, 1); |
494 | set_nlink(inode, 1); | 494 | set_nlink(inode, 1); |
495 | inode->i_size = 2 + be32_to_cpu(folder->valence); | 495 | inode->i_size = 2 + be32_to_cpu(folder->valence); |
496 | inode->i_atime = hfsp_mt2ut(folder->access_date); | 496 | inode->i_atime = timespec_to_timespec64(hfsp_mt2ut(folder->access_date)); |
497 | inode->i_mtime = hfsp_mt2ut(folder->content_mod_date); | 497 | inode->i_mtime = timespec_to_timespec64(hfsp_mt2ut(folder->content_mod_date)); |
498 | inode->i_ctime = hfsp_mt2ut(folder->attribute_mod_date); | 498 | inode->i_ctime = timespec_to_timespec64(hfsp_mt2ut(folder->attribute_mod_date)); |
499 | HFSPLUS_I(inode)->create_date = folder->create_date; | 499 | HFSPLUS_I(inode)->create_date = folder->create_date; |
500 | HFSPLUS_I(inode)->fs_blocks = 0; | 500 | HFSPLUS_I(inode)->fs_blocks = 0; |
501 | if (folder->flags & cpu_to_be16(HFSPLUS_HAS_FOLDER_COUNT)) { | 501 | if (folder->flags & cpu_to_be16(HFSPLUS_HAS_FOLDER_COUNT)) { |
@@ -531,9 +531,9 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd) | |||
531 | init_special_inode(inode, inode->i_mode, | 531 | init_special_inode(inode, inode->i_mode, |
532 | be32_to_cpu(file->permissions.dev)); | 532 | be32_to_cpu(file->permissions.dev)); |
533 | } | 533 | } |
534 | inode->i_atime = hfsp_mt2ut(file->access_date); | 534 | inode->i_atime = timespec_to_timespec64(hfsp_mt2ut(file->access_date)); |
535 | inode->i_mtime = hfsp_mt2ut(file->content_mod_date); | 535 | inode->i_mtime = timespec_to_timespec64(hfsp_mt2ut(file->content_mod_date)); |
536 | inode->i_ctime = hfsp_mt2ut(file->attribute_mod_date); | 536 | inode->i_ctime = timespec_to_timespec64(hfsp_mt2ut(file->attribute_mod_date)); |
537 | HFSPLUS_I(inode)->create_date = file->create_date; | 537 | HFSPLUS_I(inode)->create_date = file->create_date; |
538 | } else { | 538 | } else { |
539 | pr_err("bad catalog entry used to create inode\n"); | 539 | pr_err("bad catalog entry used to create inode\n"); |
diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index 3cd85eb5bbb1..2597b290c2a5 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c | |||
@@ -555,9 +555,9 @@ static int read_name(struct inode *ino, char *name) | |||
555 | set_nlink(ino, st.nlink); | 555 | set_nlink(ino, st.nlink); |
556 | i_uid_write(ino, st.uid); | 556 | i_uid_write(ino, st.uid); |
557 | i_gid_write(ino, st.gid); | 557 | i_gid_write(ino, st.gid); |
558 | ino->i_atime = st.atime; | 558 | ino->i_atime = timespec_to_timespec64(st.atime); |
559 | ino->i_mtime = st.mtime; | 559 | ino->i_mtime = timespec_to_timespec64(st.mtime); |
560 | ino->i_ctime = st.ctime; | 560 | ino->i_ctime = timespec_to_timespec64(st.ctime); |
561 | ino->i_size = st.size; | 561 | ino->i_size = st.size; |
562 | ino->i_blocks = st.blocks; | 562 | ino->i_blocks = st.blocks; |
563 | return 0; | 563 | return 0; |
@@ -838,15 +838,15 @@ static int hostfs_setattr(struct dentry *dentry, struct iattr *attr) | |||
838 | } | 838 | } |
839 | if (attr->ia_valid & ATTR_ATIME) { | 839 | if (attr->ia_valid & ATTR_ATIME) { |
840 | attrs.ia_valid |= HOSTFS_ATTR_ATIME; | 840 | attrs.ia_valid |= HOSTFS_ATTR_ATIME; |
841 | attrs.ia_atime = attr->ia_atime; | 841 | attrs.ia_atime = timespec64_to_timespec(attr->ia_atime); |
842 | } | 842 | } |
843 | if (attr->ia_valid & ATTR_MTIME) { | 843 | if (attr->ia_valid & ATTR_MTIME) { |
844 | attrs.ia_valid |= HOSTFS_ATTR_MTIME; | 844 | attrs.ia_valid |= HOSTFS_ATTR_MTIME; |
845 | attrs.ia_mtime = attr->ia_mtime; | 845 | attrs.ia_mtime = timespec64_to_timespec(attr->ia_mtime); |
846 | } | 846 | } |
847 | if (attr->ia_valid & ATTR_CTIME) { | 847 | if (attr->ia_valid & ATTR_CTIME) { |
848 | attrs.ia_valid |= HOSTFS_ATTR_CTIME; | 848 | attrs.ia_valid |= HOSTFS_ATTR_CTIME; |
849 | attrs.ia_ctime = attr->ia_ctime; | 849 | attrs.ia_ctime = timespec64_to_timespec(attr->ia_ctime); |
850 | } | 850 | } |
851 | if (attr->ia_valid & ATTR_ATIME_SET) { | 851 | if (attr->ia_valid & ATTR_ATIME_SET) { |
852 | attrs.ia_valid |= HOSTFS_ATTR_ATIME_SET; | 852 | attrs.ia_valid |= HOSTFS_ATTR_ATIME_SET; |
diff --git a/fs/inode.c b/fs/inode.c index 93af998ee290..9fe1f941be02 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
@@ -1590,8 +1590,8 @@ static void update_ovl_inode_times(struct dentry *dentry, struct inode *inode, | |||
1590 | if (upperdentry) { | 1590 | if (upperdentry) { |
1591 | struct inode *realinode = d_inode(upperdentry); | 1591 | struct inode *realinode = d_inode(upperdentry); |
1592 | 1592 | ||
1593 | if ((!timespec_equal(&inode->i_mtime, &realinode->i_mtime) || | 1593 | if ((!timespec64_equal(&inode->i_mtime, &realinode->i_mtime) || |
1594 | !timespec_equal(&inode->i_ctime, &realinode->i_ctime))) { | 1594 | !timespec64_equal(&inode->i_ctime, &realinode->i_ctime))) { |
1595 | inode->i_mtime = realinode->i_mtime; | 1595 | inode->i_mtime = realinode->i_mtime; |
1596 | inode->i_ctime = realinode->i_ctime; | 1596 | inode->i_ctime = realinode->i_ctime; |
1597 | } | 1597 | } |
@@ -1614,12 +1614,12 @@ static int relatime_need_update(const struct path *path, struct inode *inode, | |||
1614 | /* | 1614 | /* |
1615 | * Is mtime younger than atime? If yes, update atime: | 1615 | * Is mtime younger than atime? If yes, update atime: |
1616 | */ | 1616 | */ |
1617 | if (timespec_compare(&inode->i_mtime, &inode->i_atime) >= 0) | 1617 | if (timespec64_compare(&inode->i_mtime, &inode->i_atime) >= 0) |
1618 | return 1; | 1618 | return 1; |
1619 | /* | 1619 | /* |
1620 | * Is ctime younger than atime? If yes, update atime: | 1620 | * Is ctime younger than atime? If yes, update atime: |
1621 | */ | 1621 | */ |
1622 | if (timespec_compare(&inode->i_ctime, &inode->i_atime) >= 0) | 1622 | if (timespec64_compare(&inode->i_ctime, &inode->i_atime) >= 0) |
1623 | return 1; | 1623 | return 1; |
1624 | 1624 | ||
1625 | /* | 1625 | /* |
@@ -1634,7 +1634,7 @@ static int relatime_need_update(const struct path *path, struct inode *inode, | |||
1634 | return 0; | 1634 | return 0; |
1635 | } | 1635 | } |
1636 | 1636 | ||
1637 | int generic_update_time(struct inode *inode, struct timespec *time, int flags) | 1637 | int generic_update_time(struct inode *inode, struct timespec64 *time, int flags) |
1638 | { | 1638 | { |
1639 | int iflags = I_DIRTY_TIME; | 1639 | int iflags = I_DIRTY_TIME; |
1640 | bool dirty = false; | 1640 | bool dirty = false; |
@@ -1662,9 +1662,9 @@ EXPORT_SYMBOL(generic_update_time); | |||
1662 | * This does the actual work of updating an inodes time or version. Must have | 1662 | * This does the actual work of updating an inodes time or version. Must have |
1663 | * had called mnt_want_write() before calling this. | 1663 | * had called mnt_want_write() before calling this. |
1664 | */ | 1664 | */ |
1665 | static int update_time(struct inode *inode, struct timespec *time, int flags) | 1665 | static int update_time(struct inode *inode, struct timespec64 *time, int flags) |
1666 | { | 1666 | { |
1667 | int (*update_time)(struct inode *, struct timespec *, int); | 1667 | int (*update_time)(struct inode *, struct timespec64 *, int); |
1668 | 1668 | ||
1669 | update_time = inode->i_op->update_time ? inode->i_op->update_time : | 1669 | update_time = inode->i_op->update_time ? inode->i_op->update_time : |
1670 | generic_update_time; | 1670 | generic_update_time; |
@@ -1685,7 +1685,7 @@ bool __atime_needs_update(const struct path *path, struct inode *inode, | |||
1685 | bool rcu) | 1685 | bool rcu) |
1686 | { | 1686 | { |
1687 | struct vfsmount *mnt = path->mnt; | 1687 | struct vfsmount *mnt = path->mnt; |
1688 | struct timespec now; | 1688 | struct timespec64 now; |
1689 | 1689 | ||
1690 | if (inode->i_flags & S_NOATIME) | 1690 | if (inode->i_flags & S_NOATIME) |
1691 | return false; | 1691 | return false; |
@@ -1708,10 +1708,10 @@ bool __atime_needs_update(const struct path *path, struct inode *inode, | |||
1708 | 1708 | ||
1709 | now = current_time(inode); | 1709 | now = current_time(inode); |
1710 | 1710 | ||
1711 | if (!relatime_need_update(path, inode, now, rcu)) | 1711 | if (!relatime_need_update(path, inode, timespec64_to_timespec(now), rcu)) |
1712 | return false; | 1712 | return false; |
1713 | 1713 | ||
1714 | if (timespec_equal(&inode->i_atime, &now)) | 1714 | if (timespec64_equal(&inode->i_atime, &now)) |
1715 | return false; | 1715 | return false; |
1716 | 1716 | ||
1717 | return true; | 1717 | return true; |
@@ -1721,7 +1721,7 @@ void touch_atime(const struct path *path) | |||
1721 | { | 1721 | { |
1722 | struct vfsmount *mnt = path->mnt; | 1722 | struct vfsmount *mnt = path->mnt; |
1723 | struct inode *inode = d_inode(path->dentry); | 1723 | struct inode *inode = d_inode(path->dentry); |
1724 | struct timespec now; | 1724 | struct timespec64 now; |
1725 | 1725 | ||
1726 | if (!__atime_needs_update(path, inode, false)) | 1726 | if (!__atime_needs_update(path, inode, false)) |
1727 | return; | 1727 | return; |
@@ -1855,7 +1855,7 @@ EXPORT_SYMBOL(file_remove_privs); | |||
1855 | int file_update_time(struct file *file) | 1855 | int file_update_time(struct file *file) |
1856 | { | 1856 | { |
1857 | struct inode *inode = file_inode(file); | 1857 | struct inode *inode = file_inode(file); |
1858 | struct timespec now; | 1858 | struct timespec64 now; |
1859 | int sync_it = 0; | 1859 | int sync_it = 0; |
1860 | int ret; | 1860 | int ret; |
1861 | 1861 | ||
@@ -1864,10 +1864,10 @@ int file_update_time(struct file *file) | |||
1864 | return 0; | 1864 | return 0; |
1865 | 1865 | ||
1866 | now = current_time(inode); | 1866 | now = current_time(inode); |
1867 | if (!timespec_equal(&inode->i_mtime, &now)) | 1867 | if (!timespec64_equal(&inode->i_mtime, &now)) |
1868 | sync_it = S_MTIME; | 1868 | sync_it = S_MTIME; |
1869 | 1869 | ||
1870 | if (!timespec_equal(&inode->i_ctime, &now)) | 1870 | if (!timespec64_equal(&inode->i_ctime, &now)) |
1871 | sync_it |= S_CTIME; | 1871 | sync_it |= S_CTIME; |
1872 | 1872 | ||
1873 | if (IS_I_VERSION(inode) && inode_iversion_need_inc(inode)) | 1873 | if (IS_I_VERSION(inode) && inode_iversion_need_inc(inode)) |
@@ -2144,15 +2144,15 @@ EXPORT_SYMBOL(timespec64_trunc); | |||
2144 | * Note that inode and inode->sb cannot be NULL. | 2144 | * Note that inode and inode->sb cannot be NULL. |
2145 | * Otherwise, the function warns and returns time without truncation. | 2145 | * Otherwise, the function warns and returns time without truncation. |
2146 | */ | 2146 | */ |
2147 | struct timespec current_time(struct inode *inode) | 2147 | struct timespec64 current_time(struct inode *inode) |
2148 | { | 2148 | { |
2149 | struct timespec now = current_kernel_time(); | 2149 | struct timespec64 now = current_kernel_time64(); |
2150 | 2150 | ||
2151 | if (unlikely(!inode->i_sb)) { | 2151 | if (unlikely(!inode->i_sb)) { |
2152 | WARN(1, "current_time() called with uninitialized super_block in the inode"); | 2152 | WARN(1, "current_time() called with uninitialized super_block in the inode"); |
2153 | return now; | 2153 | return now; |
2154 | } | 2154 | } |
2155 | 2155 | ||
2156 | return timespec_trunc(now, inode->i_sb->s_time_gran); | 2156 | return timespec64_trunc(now, inode->i_sb->s_time_gran); |
2157 | } | 2157 | } |
2158 | EXPORT_SYMBOL(current_time); | 2158 | EXPORT_SYMBOL(current_time); |
diff --git a/fs/jffs2/dir.c b/fs/jffs2/dir.c index 0a754f38462e..4ef97805eb27 100644 --- a/fs/jffs2/dir.c +++ b/fs/jffs2/dir.c | |||
@@ -201,7 +201,7 @@ static int jffs2_create(struct inode *dir_i, struct dentry *dentry, | |||
201 | if (ret) | 201 | if (ret) |
202 | goto fail; | 202 | goto fail; |
203 | 203 | ||
204 | dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(ri->ctime)); | 204 | dir_i->i_mtime = dir_i->i_ctime = timespec_to_timespec64(ITIME(je32_to_cpu(ri->ctime))); |
205 | 205 | ||
206 | jffs2_free_raw_inode(ri); | 206 | jffs2_free_raw_inode(ri); |
207 | 207 | ||
@@ -235,7 +235,7 @@ static int jffs2_unlink(struct inode *dir_i, struct dentry *dentry) | |||
235 | if (dead_f->inocache) | 235 | if (dead_f->inocache) |
236 | set_nlink(d_inode(dentry), dead_f->inocache->pino_nlink); | 236 | set_nlink(d_inode(dentry), dead_f->inocache->pino_nlink); |
237 | if (!ret) | 237 | if (!ret) |
238 | dir_i->i_mtime = dir_i->i_ctime = ITIME(now); | 238 | dir_i->i_mtime = dir_i->i_ctime = timespec_to_timespec64(ITIME(now)); |
239 | return ret; | 239 | return ret; |
240 | } | 240 | } |
241 | /***********************************************************************/ | 241 | /***********************************************************************/ |
@@ -269,7 +269,7 @@ static int jffs2_link (struct dentry *old_dentry, struct inode *dir_i, struct de | |||
269 | set_nlink(d_inode(old_dentry), ++f->inocache->pino_nlink); | 269 | set_nlink(d_inode(old_dentry), ++f->inocache->pino_nlink); |
270 | mutex_unlock(&f->sem); | 270 | mutex_unlock(&f->sem); |
271 | d_instantiate(dentry, d_inode(old_dentry)); | 271 | d_instantiate(dentry, d_inode(old_dentry)); |
272 | dir_i->i_mtime = dir_i->i_ctime = ITIME(now); | 272 | dir_i->i_mtime = dir_i->i_ctime = timespec_to_timespec64(ITIME(now)); |
273 | ihold(d_inode(old_dentry)); | 273 | ihold(d_inode(old_dentry)); |
274 | } | 274 | } |
275 | return ret; | 275 | return ret; |
@@ -419,7 +419,7 @@ static int jffs2_symlink (struct inode *dir_i, struct dentry *dentry, const char | |||
419 | goto fail; | 419 | goto fail; |
420 | } | 420 | } |
421 | 421 | ||
422 | dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(rd->mctime)); | 422 | dir_i->i_mtime = dir_i->i_ctime = timespec_to_timespec64(ITIME(je32_to_cpu(rd->mctime))); |
423 | 423 | ||
424 | jffs2_free_raw_dirent(rd); | 424 | jffs2_free_raw_dirent(rd); |
425 | 425 | ||
@@ -563,7 +563,7 @@ static int jffs2_mkdir (struct inode *dir_i, struct dentry *dentry, umode_t mode | |||
563 | goto fail; | 563 | goto fail; |
564 | } | 564 | } |
565 | 565 | ||
566 | dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(rd->mctime)); | 566 | dir_i->i_mtime = dir_i->i_ctime = timespec_to_timespec64(ITIME(je32_to_cpu(rd->mctime))); |
567 | inc_nlink(dir_i); | 567 | inc_nlink(dir_i); |
568 | 568 | ||
569 | jffs2_free_raw_dirent(rd); | 569 | jffs2_free_raw_dirent(rd); |
@@ -601,7 +601,7 @@ static int jffs2_rmdir (struct inode *dir_i, struct dentry *dentry) | |||
601 | ret = jffs2_do_unlink(c, dir_f, dentry->d_name.name, | 601 | ret = jffs2_do_unlink(c, dir_f, dentry->d_name.name, |
602 | dentry->d_name.len, f, now); | 602 | dentry->d_name.len, f, now); |
603 | if (!ret) { | 603 | if (!ret) { |
604 | dir_i->i_mtime = dir_i->i_ctime = ITIME(now); | 604 | dir_i->i_mtime = dir_i->i_ctime = timespec_to_timespec64(ITIME(now)); |
605 | clear_nlink(d_inode(dentry)); | 605 | clear_nlink(d_inode(dentry)); |
606 | drop_nlink(dir_i); | 606 | drop_nlink(dir_i); |
607 | } | 607 | } |
@@ -736,7 +736,7 @@ static int jffs2_mknod (struct inode *dir_i, struct dentry *dentry, umode_t mode | |||
736 | goto fail; | 736 | goto fail; |
737 | } | 737 | } |
738 | 738 | ||
739 | dir_i->i_mtime = dir_i->i_ctime = ITIME(je32_to_cpu(rd->mctime)); | 739 | dir_i->i_mtime = dir_i->i_ctime = timespec_to_timespec64(ITIME(je32_to_cpu(rd->mctime))); |
740 | 740 | ||
741 | jffs2_free_raw_dirent(rd); | 741 | jffs2_free_raw_dirent(rd); |
742 | 742 | ||
@@ -857,14 +857,14 @@ static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry, | |||
857 | * caller won't do it on its own since we are returning an error. | 857 | * caller won't do it on its own since we are returning an error. |
858 | */ | 858 | */ |
859 | d_invalidate(new_dentry); | 859 | d_invalidate(new_dentry); |
860 | new_dir_i->i_mtime = new_dir_i->i_ctime = ITIME(now); | 860 | new_dir_i->i_mtime = new_dir_i->i_ctime = timespec_to_timespec64(ITIME(now)); |
861 | return ret; | 861 | return ret; |
862 | } | 862 | } |
863 | 863 | ||
864 | if (d_is_dir(old_dentry)) | 864 | if (d_is_dir(old_dentry)) |
865 | drop_nlink(old_dir_i); | 865 | drop_nlink(old_dir_i); |
866 | 866 | ||
867 | new_dir_i->i_mtime = new_dir_i->i_ctime = old_dir_i->i_mtime = old_dir_i->i_ctime = ITIME(now); | 867 | 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)); |
868 | 868 | ||
869 | return 0; | 869 | return 0; |
870 | } | 870 | } |
diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c index bd0428bebe9b..481afd4c2e1a 100644 --- a/fs/jffs2/file.c +++ b/fs/jffs2/file.c | |||
@@ -308,7 +308,7 @@ static int jffs2_write_end(struct file *filp, struct address_space *mapping, | |||
308 | inode->i_size = pos + writtenlen; | 308 | inode->i_size = pos + writtenlen; |
309 | inode->i_blocks = (inode->i_size + 511) >> 9; | 309 | inode->i_blocks = (inode->i_size + 511) >> 9; |
310 | 310 | ||
311 | inode->i_ctime = inode->i_mtime = ITIME(je32_to_cpu(ri->ctime)); | 311 | inode->i_ctime = inode->i_mtime = timespec_to_timespec64(ITIME(je32_to_cpu(ri->ctime))); |
312 | } | 312 | } |
313 | } | 313 | } |
314 | 314 | ||
diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c index eab04eca95a3..0ecfb8ea38cd 100644 --- a/fs/jffs2/fs.c +++ b/fs/jffs2/fs.c | |||
@@ -146,9 +146,9 @@ int jffs2_do_setattr (struct inode *inode, struct iattr *iattr) | |||
146 | return PTR_ERR(new_metadata); | 146 | return PTR_ERR(new_metadata); |
147 | } | 147 | } |
148 | /* It worked. Update the inode */ | 148 | /* It worked. Update the inode */ |
149 | inode->i_atime = ITIME(je32_to_cpu(ri->atime)); | 149 | inode->i_atime = timespec_to_timespec64(ITIME(je32_to_cpu(ri->atime))); |
150 | inode->i_ctime = ITIME(je32_to_cpu(ri->ctime)); | 150 | inode->i_ctime = timespec_to_timespec64(ITIME(je32_to_cpu(ri->ctime))); |
151 | inode->i_mtime = ITIME(je32_to_cpu(ri->mtime)); | 151 | inode->i_mtime = timespec_to_timespec64(ITIME(je32_to_cpu(ri->mtime))); |
152 | inode->i_mode = jemode_to_cpu(ri->mode); | 152 | inode->i_mode = jemode_to_cpu(ri->mode); |
153 | i_uid_write(inode, je16_to_cpu(ri->uid)); | 153 | i_uid_write(inode, je16_to_cpu(ri->uid)); |
154 | i_gid_write(inode, je16_to_cpu(ri->gid)); | 154 | i_gid_write(inode, je16_to_cpu(ri->gid)); |
@@ -280,9 +280,9 @@ struct inode *jffs2_iget(struct super_block *sb, unsigned long ino) | |||
280 | i_uid_write(inode, je16_to_cpu(latest_node.uid)); | 280 | i_uid_write(inode, je16_to_cpu(latest_node.uid)); |
281 | i_gid_write(inode, je16_to_cpu(latest_node.gid)); | 281 | i_gid_write(inode, je16_to_cpu(latest_node.gid)); |
282 | inode->i_size = je32_to_cpu(latest_node.isize); | 282 | inode->i_size = je32_to_cpu(latest_node.isize); |
283 | inode->i_atime = ITIME(je32_to_cpu(latest_node.atime)); | 283 | inode->i_atime = timespec_to_timespec64(ITIME(je32_to_cpu(latest_node.atime))); |
284 | inode->i_mtime = ITIME(je32_to_cpu(latest_node.mtime)); | 284 | inode->i_mtime = timespec_to_timespec64(ITIME(je32_to_cpu(latest_node.mtime))); |
285 | inode->i_ctime = ITIME(je32_to_cpu(latest_node.ctime)); | 285 | inode->i_ctime = timespec_to_timespec64(ITIME(je32_to_cpu(latest_node.ctime))); |
286 | 286 | ||
287 | set_nlink(inode, f->inocache->pino_nlink); | 287 | set_nlink(inode, f->inocache->pino_nlink); |
288 | 288 | ||
diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c index 89d1dc19340b..d66cc0777303 100644 --- a/fs/kernfs/dir.c +++ b/fs/kernfs/dir.c | |||
@@ -779,7 +779,7 @@ int kernfs_add_one(struct kernfs_node *kn) | |||
779 | ps_iattr = parent->iattr; | 779 | ps_iattr = parent->iattr; |
780 | if (ps_iattr) { | 780 | if (ps_iattr) { |
781 | struct iattr *ps_iattrs = &ps_iattr->ia_iattr; | 781 | struct iattr *ps_iattrs = &ps_iattr->ia_iattr; |
782 | ktime_get_real_ts(&ps_iattrs->ia_ctime); | 782 | ktime_get_real_ts64(&ps_iattrs->ia_ctime); |
783 | ps_iattrs->ia_mtime = ps_iattrs->ia_ctime; | 783 | ps_iattrs->ia_mtime = ps_iattrs->ia_ctime; |
784 | } | 784 | } |
785 | 785 | ||
@@ -1306,7 +1306,7 @@ static void __kernfs_remove(struct kernfs_node *kn) | |||
1306 | 1306 | ||
1307 | /* update timestamps on the parent */ | 1307 | /* update timestamps on the parent */ |
1308 | if (ps_iattr) { | 1308 | if (ps_iattr) { |
1309 | ktime_get_real_ts(&ps_iattr->ia_iattr.ia_ctime); | 1309 | ktime_get_real_ts64(&ps_iattr->ia_iattr.ia_ctime); |
1310 | ps_iattr->ia_iattr.ia_mtime = | 1310 | ps_iattr->ia_iattr.ia_mtime = |
1311 | ps_iattr->ia_iattr.ia_ctime; | 1311 | ps_iattr->ia_iattr.ia_ctime; |
1312 | } | 1312 | } |
diff --git a/fs/kernfs/inode.c b/fs/kernfs/inode.c index a34303981deb..3d73fe9d56e2 100644 --- a/fs/kernfs/inode.c +++ b/fs/kernfs/inode.c | |||
@@ -52,7 +52,7 @@ static struct kernfs_iattrs *kernfs_iattrs(struct kernfs_node *kn) | |||
52 | iattrs->ia_uid = GLOBAL_ROOT_UID; | 52 | iattrs->ia_uid = GLOBAL_ROOT_UID; |
53 | iattrs->ia_gid = GLOBAL_ROOT_GID; | 53 | iattrs->ia_gid = GLOBAL_ROOT_GID; |
54 | 54 | ||
55 | ktime_get_real_ts(&iattrs->ia_atime); | 55 | ktime_get_real_ts64(&iattrs->ia_atime); |
56 | iattrs->ia_mtime = iattrs->ia_atime; | 56 | iattrs->ia_mtime = iattrs->ia_atime; |
57 | iattrs->ia_ctime = iattrs->ia_atime; | 57 | iattrs->ia_ctime = iattrs->ia_atime; |
58 | 58 | ||
@@ -176,9 +176,9 @@ static inline void set_inode_attr(struct inode *inode, struct iattr *iattr) | |||
176 | struct super_block *sb = inode->i_sb; | 176 | struct super_block *sb = inode->i_sb; |
177 | inode->i_uid = iattr->ia_uid; | 177 | inode->i_uid = iattr->ia_uid; |
178 | inode->i_gid = iattr->ia_gid; | 178 | inode->i_gid = iattr->ia_gid; |
179 | inode->i_atime = timespec_trunc(iattr->ia_atime, sb->s_time_gran); | 179 | inode->i_atime = timespec64_trunc(iattr->ia_atime, sb->s_time_gran); |
180 | inode->i_mtime = timespec_trunc(iattr->ia_mtime, sb->s_time_gran); | 180 | inode->i_mtime = timespec64_trunc(iattr->ia_mtime, sb->s_time_gran); |
181 | inode->i_ctime = timespec_trunc(iattr->ia_ctime, sb->s_time_gran); | 181 | inode->i_ctime = timespec64_trunc(iattr->ia_ctime, sb->s_time_gran); |
182 | } | 182 | } |
183 | 183 | ||
184 | static void kernfs_refresh_inode(struct kernfs_node *kn, struct inode *inode) | 184 | static void kernfs_refresh_inode(struct kernfs_node *kn, struct inode *inode) |
diff --git a/fs/locks.c b/fs/locks.c index 62bbe8b31f26..7356c405ec46 100644 --- a/fs/locks.c +++ b/fs/locks.c | |||
@@ -1562,7 +1562,7 @@ EXPORT_SYMBOL(__break_lease); | |||
1562 | * exclusive leases. The justification is that if someone has an | 1562 | * exclusive leases. The justification is that if someone has an |
1563 | * exclusive lease, then they could be modifying it. | 1563 | * exclusive lease, then they could be modifying it. |
1564 | */ | 1564 | */ |
1565 | void lease_get_mtime(struct inode *inode, struct timespec *time) | 1565 | void lease_get_mtime(struct inode *inode, struct timespec64 *time) |
1566 | { | 1566 | { |
1567 | bool has_lease = false; | 1567 | bool has_lease = false; |
1568 | struct file_lock_context *ctx; | 1568 | struct file_lock_context *ctx; |
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c index a50d7813e3ea..9d24aabcd8bb 100644 --- a/fs/nfs/callback_proc.c +++ b/fs/nfs/callback_proc.c | |||
@@ -54,8 +54,8 @@ __be32 nfs4_callback_getattr(void *argp, void *resp, | |||
54 | res->change_attr = delegation->change_attr; | 54 | res->change_attr = delegation->change_attr; |
55 | if (nfs_have_writebacks(inode)) | 55 | if (nfs_have_writebacks(inode)) |
56 | res->change_attr++; | 56 | res->change_attr++; |
57 | res->ctime = inode->i_ctime; | 57 | res->ctime = timespec64_to_timespec(inode->i_ctime); |
58 | res->mtime = inode->i_mtime; | 58 | res->mtime = timespec64_to_timespec(inode->i_mtime); |
59 | res->bitmap[0] = (FATTR4_WORD0_CHANGE|FATTR4_WORD0_SIZE) & | 59 | res->bitmap[0] = (FATTR4_WORD0_CHANGE|FATTR4_WORD0_SIZE) & |
60 | args->bitmap[0]; | 60 | args->bitmap[0]; |
61 | res->bitmap[1] = (FATTR4_WORD1_TIME_METADATA|FATTR4_WORD1_TIME_MODIFY) & | 61 | res->bitmap[1] = (FATTR4_WORD1_TIME_METADATA|FATTR4_WORD1_TIME_MODIFY) & |
diff --git a/fs/nfs/fscache-index.c b/fs/nfs/fscache-index.c index 1c5d8d31fc0a..666415d13d52 100644 --- a/fs/nfs/fscache-index.c +++ b/fs/nfs/fscache-index.c | |||
@@ -88,8 +88,8 @@ enum fscache_checkaux nfs_fscache_inode_check_aux(void *cookie_netfs_data, | |||
88 | return FSCACHE_CHECKAUX_OBSOLETE; | 88 | return FSCACHE_CHECKAUX_OBSOLETE; |
89 | 89 | ||
90 | memset(&auxdata, 0, sizeof(auxdata)); | 90 | memset(&auxdata, 0, sizeof(auxdata)); |
91 | auxdata.mtime = nfsi->vfs_inode.i_mtime; | 91 | auxdata.mtime = timespec64_to_timespec(nfsi->vfs_inode.i_mtime); |
92 | auxdata.ctime = nfsi->vfs_inode.i_ctime; | 92 | auxdata.ctime = timespec64_to_timespec(nfsi->vfs_inode.i_ctime); |
93 | 93 | ||
94 | if (NFS_SERVER(&nfsi->vfs_inode)->nfs_client->rpc_ops->version == 4) | 94 | if (NFS_SERVER(&nfsi->vfs_inode)->nfs_client->rpc_ops->version == 4) |
95 | auxdata.change_attr = inode_peek_iversion_raw(&nfsi->vfs_inode); | 95 | auxdata.change_attr = inode_peek_iversion_raw(&nfsi->vfs_inode); |
diff --git a/fs/nfs/fscache.c b/fs/nfs/fscache.c index b55fc7920c3b..4dc887813c71 100644 --- a/fs/nfs/fscache.c +++ b/fs/nfs/fscache.c | |||
@@ -237,8 +237,8 @@ void nfs_fscache_init_inode(struct inode *inode) | |||
237 | return; | 237 | return; |
238 | 238 | ||
239 | memset(&auxdata, 0, sizeof(auxdata)); | 239 | memset(&auxdata, 0, sizeof(auxdata)); |
240 | auxdata.mtime = nfsi->vfs_inode.i_mtime; | 240 | auxdata.mtime = timespec64_to_timespec(nfsi->vfs_inode.i_mtime); |
241 | auxdata.ctime = nfsi->vfs_inode.i_ctime; | 241 | auxdata.ctime = timespec64_to_timespec(nfsi->vfs_inode.i_ctime); |
242 | 242 | ||
243 | if (NFS_SERVER(&nfsi->vfs_inode)->nfs_client->rpc_ops->version == 4) | 243 | if (NFS_SERVER(&nfsi->vfs_inode)->nfs_client->rpc_ops->version == 4) |
244 | auxdata.change_attr = inode_peek_iversion_raw(&nfsi->vfs_inode); | 244 | auxdata.change_attr = inode_peek_iversion_raw(&nfsi->vfs_inode); |
@@ -262,8 +262,8 @@ void nfs_fscache_clear_inode(struct inode *inode) | |||
262 | dfprintk(FSCACHE, "NFS: clear cookie (0x%p/0x%p)\n", nfsi, cookie); | 262 | dfprintk(FSCACHE, "NFS: clear cookie (0x%p/0x%p)\n", nfsi, cookie); |
263 | 263 | ||
264 | memset(&auxdata, 0, sizeof(auxdata)); | 264 | memset(&auxdata, 0, sizeof(auxdata)); |
265 | auxdata.mtime = nfsi->vfs_inode.i_mtime; | 265 | auxdata.mtime = timespec64_to_timespec(nfsi->vfs_inode.i_mtime); |
266 | auxdata.ctime = nfsi->vfs_inode.i_ctime; | 266 | auxdata.ctime = timespec64_to_timespec(nfsi->vfs_inode.i_ctime); |
267 | fscache_relinquish_cookie(cookie, &auxdata, false); | 267 | fscache_relinquish_cookie(cookie, &auxdata, false); |
268 | nfsi->fscache = NULL; | 268 | nfsi->fscache = NULL; |
269 | } | 269 | } |
@@ -304,8 +304,8 @@ void nfs_fscache_open_file(struct inode *inode, struct file *filp) | |||
304 | return; | 304 | return; |
305 | 305 | ||
306 | memset(&auxdata, 0, sizeof(auxdata)); | 306 | memset(&auxdata, 0, sizeof(auxdata)); |
307 | auxdata.mtime = nfsi->vfs_inode.i_mtime; | 307 | auxdata.mtime = timespec64_to_timespec(nfsi->vfs_inode.i_mtime); |
308 | auxdata.ctime = nfsi->vfs_inode.i_ctime; | 308 | auxdata.ctime = timespec64_to_timespec(nfsi->vfs_inode.i_ctime); |
309 | 309 | ||
310 | if (inode_is_open_for_write(inode)) { | 310 | if (inode_is_open_for_write(inode)) { |
311 | dfprintk(FSCACHE, "NFS: nfsi 0x%p disabling cache\n", nfsi); | 311 | dfprintk(FSCACHE, "NFS: nfsi 0x%p disabling cache\n", nfsi); |
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 55b62254dd7c..138941a97327 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -494,15 +494,15 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr, st | |||
494 | nfsi->read_cache_jiffies = fattr->time_start; | 494 | nfsi->read_cache_jiffies = fattr->time_start; |
495 | nfsi->attr_gencount = fattr->gencount; | 495 | nfsi->attr_gencount = fattr->gencount; |
496 | if (fattr->valid & NFS_ATTR_FATTR_ATIME) | 496 | if (fattr->valid & NFS_ATTR_FATTR_ATIME) |
497 | inode->i_atime = fattr->atime; | 497 | inode->i_atime = timespec_to_timespec64(fattr->atime); |
498 | else if (nfs_server_capable(inode, NFS_CAP_ATIME)) | 498 | else if (nfs_server_capable(inode, NFS_CAP_ATIME)) |
499 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_ATIME); | 499 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_ATIME); |
500 | if (fattr->valid & NFS_ATTR_FATTR_MTIME) | 500 | if (fattr->valid & NFS_ATTR_FATTR_MTIME) |
501 | inode->i_mtime = fattr->mtime; | 501 | inode->i_mtime = timespec_to_timespec64(fattr->mtime); |
502 | else if (nfs_server_capable(inode, NFS_CAP_MTIME)) | 502 | else if (nfs_server_capable(inode, NFS_CAP_MTIME)) |
503 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_MTIME); | 503 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_MTIME); |
504 | if (fattr->valid & NFS_ATTR_FATTR_CTIME) | 504 | if (fattr->valid & NFS_ATTR_FATTR_CTIME) |
505 | inode->i_ctime = fattr->ctime; | 505 | inode->i_ctime = timespec_to_timespec64(fattr->ctime); |
506 | else if (nfs_server_capable(inode, NFS_CAP_CTIME)) | 506 | else if (nfs_server_capable(inode, NFS_CAP_CTIME)) |
507 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_CTIME); | 507 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_CTIME); |
508 | if (fattr->valid & NFS_ATTR_FATTR_CHANGE) | 508 | if (fattr->valid & NFS_ATTR_FATTR_CHANGE) |
@@ -1304,6 +1304,8 @@ static bool nfs_file_has_buffered_writers(struct nfs_inode *nfsi) | |||
1304 | 1304 | ||
1305 | static void nfs_wcc_update_inode(struct inode *inode, struct nfs_fattr *fattr) | 1305 | static void nfs_wcc_update_inode(struct inode *inode, struct nfs_fattr *fattr) |
1306 | { | 1306 | { |
1307 | struct timespec ts; | ||
1308 | |||
1307 | if ((fattr->valid & NFS_ATTR_FATTR_PRECHANGE) | 1309 | if ((fattr->valid & NFS_ATTR_FATTR_PRECHANGE) |
1308 | && (fattr->valid & NFS_ATTR_FATTR_CHANGE) | 1310 | && (fattr->valid & NFS_ATTR_FATTR_CHANGE) |
1309 | && inode_eq_iversion_raw(inode, fattr->pre_change_attr)) { | 1311 | && inode_eq_iversion_raw(inode, fattr->pre_change_attr)) { |
@@ -1312,16 +1314,18 @@ static void nfs_wcc_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1312 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_DATA); | 1314 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_DATA); |
1313 | } | 1315 | } |
1314 | /* If we have atomic WCC data, we may update some attributes */ | 1316 | /* If we have atomic WCC data, we may update some attributes */ |
1317 | ts = timespec64_to_timespec(inode->i_ctime); | ||
1315 | if ((fattr->valid & NFS_ATTR_FATTR_PRECTIME) | 1318 | if ((fattr->valid & NFS_ATTR_FATTR_PRECTIME) |
1316 | && (fattr->valid & NFS_ATTR_FATTR_CTIME) | 1319 | && (fattr->valid & NFS_ATTR_FATTR_CTIME) |
1317 | && timespec_equal(&inode->i_ctime, &fattr->pre_ctime)) { | 1320 | && timespec_equal(&ts, &fattr->pre_ctime)) { |
1318 | inode->i_ctime = fattr->ctime; | 1321 | inode->i_ctime = timespec_to_timespec64(fattr->ctime); |
1319 | } | 1322 | } |
1320 | 1323 | ||
1324 | ts = timespec64_to_timespec(inode->i_mtime); | ||
1321 | if ((fattr->valid & NFS_ATTR_FATTR_PREMTIME) | 1325 | if ((fattr->valid & NFS_ATTR_FATTR_PREMTIME) |
1322 | && (fattr->valid & NFS_ATTR_FATTR_MTIME) | 1326 | && (fattr->valid & NFS_ATTR_FATTR_MTIME) |
1323 | && timespec_equal(&inode->i_mtime, &fattr->pre_mtime)) { | 1327 | && timespec_equal(&ts, &fattr->pre_mtime)) { |
1324 | inode->i_mtime = fattr->mtime; | 1328 | inode->i_mtime = timespec_to_timespec64(fattr->mtime); |
1325 | if (S_ISDIR(inode->i_mode)) | 1329 | if (S_ISDIR(inode->i_mode)) |
1326 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_DATA); | 1330 | nfs_set_cache_invalid(inode, NFS_INO_INVALID_DATA); |
1327 | } | 1331 | } |
@@ -1347,7 +1351,7 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fat | |||
1347 | struct nfs_inode *nfsi = NFS_I(inode); | 1351 | struct nfs_inode *nfsi = NFS_I(inode); |
1348 | loff_t cur_size, new_isize; | 1352 | loff_t cur_size, new_isize; |
1349 | unsigned long invalid = 0; | 1353 | unsigned long invalid = 0; |
1350 | 1354 | struct timespec ts; | |
1351 | 1355 | ||
1352 | if (nfs_have_delegated_attributes(inode)) | 1356 | if (nfs_have_delegated_attributes(inode)) |
1353 | return 0; | 1357 | return 0; |
@@ -1363,10 +1367,12 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fat | |||
1363 | invalid |= NFS_INO_INVALID_CHANGE | 1367 | invalid |= NFS_INO_INVALID_CHANGE |
1364 | | NFS_INO_REVAL_PAGECACHE; | 1368 | | NFS_INO_REVAL_PAGECACHE; |
1365 | 1369 | ||
1366 | if ((fattr->valid & NFS_ATTR_FATTR_MTIME) && !timespec_equal(&inode->i_mtime, &fattr->mtime)) | 1370 | ts = timespec64_to_timespec(inode->i_mtime); |
1371 | if ((fattr->valid & NFS_ATTR_FATTR_MTIME) && !timespec_equal(&ts, &fattr->mtime)) | ||
1367 | invalid |= NFS_INO_INVALID_MTIME; | 1372 | invalid |= NFS_INO_INVALID_MTIME; |
1368 | 1373 | ||
1369 | if ((fattr->valid & NFS_ATTR_FATTR_CTIME) && !timespec_equal(&inode->i_ctime, &fattr->ctime)) | 1374 | ts = timespec64_to_timespec(inode->i_ctime); |
1375 | if ((fattr->valid & NFS_ATTR_FATTR_CTIME) && !timespec_equal(&ts, &fattr->ctime)) | ||
1370 | invalid |= NFS_INO_INVALID_CTIME; | 1376 | invalid |= NFS_INO_INVALID_CTIME; |
1371 | 1377 | ||
1372 | if (fattr->valid & NFS_ATTR_FATTR_SIZE) { | 1378 | if (fattr->valid & NFS_ATTR_FATTR_SIZE) { |
@@ -1396,7 +1402,8 @@ static int nfs_check_inode_attributes(struct inode *inode, struct nfs_fattr *fat | |||
1396 | if ((fattr->valid & NFS_ATTR_FATTR_NLINK) && inode->i_nlink != fattr->nlink) | 1402 | if ((fattr->valid & NFS_ATTR_FATTR_NLINK) && inode->i_nlink != fattr->nlink) |
1397 | invalid |= NFS_INO_INVALID_OTHER; | 1403 | invalid |= NFS_INO_INVALID_OTHER; |
1398 | 1404 | ||
1399 | if ((fattr->valid & NFS_ATTR_FATTR_ATIME) && !timespec_equal(&inode->i_atime, &fattr->atime)) | 1405 | ts = timespec64_to_timespec(inode->i_atime); |
1406 | if ((fattr->valid & NFS_ATTR_FATTR_ATIME) && !timespec_equal(&ts, &fattr->atime)) | ||
1400 | invalid |= NFS_INO_INVALID_ATIME; | 1407 | invalid |= NFS_INO_INVALID_ATIME; |
1401 | 1408 | ||
1402 | if (invalid != 0) | 1409 | if (invalid != 0) |
@@ -1667,12 +1674,12 @@ int nfs_post_op_update_inode_force_wcc_locked(struct inode *inode, struct nfs_fa | |||
1667 | } | 1674 | } |
1668 | if ((fattr->valid & NFS_ATTR_FATTR_CTIME) != 0 && | 1675 | if ((fattr->valid & NFS_ATTR_FATTR_CTIME) != 0 && |
1669 | (fattr->valid & NFS_ATTR_FATTR_PRECTIME) == 0) { | 1676 | (fattr->valid & NFS_ATTR_FATTR_PRECTIME) == 0) { |
1670 | fattr->pre_ctime = inode->i_ctime; | 1677 | fattr->pre_ctime = timespec64_to_timespec(inode->i_ctime); |
1671 | fattr->valid |= NFS_ATTR_FATTR_PRECTIME; | 1678 | fattr->valid |= NFS_ATTR_FATTR_PRECTIME; |
1672 | } | 1679 | } |
1673 | if ((fattr->valid & NFS_ATTR_FATTR_MTIME) != 0 && | 1680 | if ((fattr->valid & NFS_ATTR_FATTR_MTIME) != 0 && |
1674 | (fattr->valid & NFS_ATTR_FATTR_PREMTIME) == 0) { | 1681 | (fattr->valid & NFS_ATTR_FATTR_PREMTIME) == 0) { |
1675 | fattr->pre_mtime = inode->i_mtime; | 1682 | fattr->pre_mtime = timespec64_to_timespec(inode->i_mtime); |
1676 | fattr->valid |= NFS_ATTR_FATTR_PREMTIME; | 1683 | fattr->valid |= NFS_ATTR_FATTR_PREMTIME; |
1677 | } | 1684 | } |
1678 | if ((fattr->valid & NFS_ATTR_FATTR_SIZE) != 0 && | 1685 | if ((fattr->valid & NFS_ATTR_FATTR_SIZE) != 0 && |
@@ -1829,7 +1836,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1829 | } | 1836 | } |
1830 | 1837 | ||
1831 | if (fattr->valid & NFS_ATTR_FATTR_MTIME) { | 1838 | if (fattr->valid & NFS_ATTR_FATTR_MTIME) { |
1832 | inode->i_mtime = fattr->mtime; | 1839 | inode->i_mtime = timespec_to_timespec64(fattr->mtime); |
1833 | } else if (server->caps & NFS_CAP_MTIME) { | 1840 | } else if (server->caps & NFS_CAP_MTIME) { |
1834 | nfsi->cache_validity |= save_cache_validity & | 1841 | nfsi->cache_validity |= save_cache_validity & |
1835 | (NFS_INO_INVALID_MTIME | 1842 | (NFS_INO_INVALID_MTIME |
@@ -1838,7 +1845,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1838 | } | 1845 | } |
1839 | 1846 | ||
1840 | if (fattr->valid & NFS_ATTR_FATTR_CTIME) { | 1847 | if (fattr->valid & NFS_ATTR_FATTR_CTIME) { |
1841 | inode->i_ctime = fattr->ctime; | 1848 | inode->i_ctime = timespec_to_timespec64(fattr->ctime); |
1842 | } else if (server->caps & NFS_CAP_CTIME) { | 1849 | } else if (server->caps & NFS_CAP_CTIME) { |
1843 | nfsi->cache_validity |= save_cache_validity & | 1850 | nfsi->cache_validity |= save_cache_validity & |
1844 | (NFS_INO_INVALID_CTIME | 1851 | (NFS_INO_INVALID_CTIME |
@@ -1875,7 +1882,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr) | |||
1875 | 1882 | ||
1876 | 1883 | ||
1877 | if (fattr->valid & NFS_ATTR_FATTR_ATIME) | 1884 | if (fattr->valid & NFS_ATTR_FATTR_ATIME) |
1878 | inode->i_atime = fattr->atime; | 1885 | inode->i_atime = timespec_to_timespec64(fattr->atime); |
1879 | else if (server->caps & NFS_CAP_ATIME) { | 1886 | else if (server->caps & NFS_CAP_ATIME) { |
1880 | nfsi->cache_validity |= save_cache_validity & | 1887 | nfsi->cache_validity |= save_cache_validity & |
1881 | (NFS_INO_INVALID_ATIME | 1888 | (NFS_INO_INVALID_ATIME |
diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c index 85e4b4a233f9..350675e3ed47 100644 --- a/fs/nfs/nfs2xdr.c +++ b/fs/nfs/nfs2xdr.c | |||
@@ -354,6 +354,7 @@ static __be32 *xdr_time_not_set(__be32 *p) | |||
354 | 354 | ||
355 | static void encode_sattr(struct xdr_stream *xdr, const struct iattr *attr) | 355 | static void encode_sattr(struct xdr_stream *xdr, const struct iattr *attr) |
356 | { | 356 | { |
357 | struct timespec ts; | ||
357 | __be32 *p; | 358 | __be32 *p; |
358 | 359 | ||
359 | p = xdr_reserve_space(xdr, NFS_sattr_sz << 2); | 360 | p = xdr_reserve_space(xdr, NFS_sattr_sz << 2); |
@@ -375,17 +376,21 @@ static void encode_sattr(struct xdr_stream *xdr, const struct iattr *attr) | |||
375 | else | 376 | else |
376 | *p++ = cpu_to_be32(NFS2_SATTR_NOT_SET); | 377 | *p++ = cpu_to_be32(NFS2_SATTR_NOT_SET); |
377 | 378 | ||
378 | if (attr->ia_valid & ATTR_ATIME_SET) | 379 | if (attr->ia_valid & ATTR_ATIME_SET) { |
379 | p = xdr_encode_time(p, &attr->ia_atime); | 380 | ts = timespec64_to_timespec(attr->ia_atime); |
380 | else if (attr->ia_valid & ATTR_ATIME) | 381 | p = xdr_encode_time(p, &ts); |
381 | p = xdr_encode_current_server_time(p, &attr->ia_atime); | 382 | } else if (attr->ia_valid & ATTR_ATIME) { |
382 | else | 383 | ts = timespec64_to_timespec(attr->ia_atime); |
384 | p = xdr_encode_current_server_time(p, &ts); | ||
385 | } else | ||
383 | p = xdr_time_not_set(p); | 386 | p = xdr_time_not_set(p); |
384 | if (attr->ia_valid & ATTR_MTIME_SET) | 387 | if (attr->ia_valid & ATTR_MTIME_SET) { |
385 | xdr_encode_time(p, &attr->ia_mtime); | 388 | ts = timespec64_to_timespec(attr->ia_atime); |
386 | else if (attr->ia_valid & ATTR_MTIME) | 389 | xdr_encode_time(p, &ts); |
387 | xdr_encode_current_server_time(p, &attr->ia_mtime); | 390 | } else if (attr->ia_valid & ATTR_MTIME) { |
388 | else | 391 | ts = timespec64_to_timespec(attr->ia_mtime); |
392 | xdr_encode_current_server_time(p, &ts); | ||
393 | } else | ||
389 | xdr_time_not_set(p); | 394 | xdr_time_not_set(p); |
390 | } | 395 | } |
391 | 396 | ||
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c index 09ee36dd8426..64e4fa33d89f 100644 --- a/fs/nfs/nfs3xdr.c +++ b/fs/nfs/nfs3xdr.c | |||
@@ -561,6 +561,7 @@ static __be32 *xdr_decode_nfstime3(__be32 *p, struct timespec *timep) | |||
561 | */ | 561 | */ |
562 | static void encode_sattr3(struct xdr_stream *xdr, const struct iattr *attr) | 562 | static void encode_sattr3(struct xdr_stream *xdr, const struct iattr *attr) |
563 | { | 563 | { |
564 | struct timespec ts; | ||
564 | u32 nbytes; | 565 | u32 nbytes; |
565 | __be32 *p; | 566 | __be32 *p; |
566 | 567 | ||
@@ -610,8 +611,10 @@ static void encode_sattr3(struct xdr_stream *xdr, const struct iattr *attr) | |||
610 | *p++ = xdr_zero; | 611 | *p++ = xdr_zero; |
611 | 612 | ||
612 | if (attr->ia_valid & ATTR_ATIME_SET) { | 613 | if (attr->ia_valid & ATTR_ATIME_SET) { |
614 | struct timespec ts; | ||
613 | *p++ = xdr_two; | 615 | *p++ = xdr_two; |
614 | p = xdr_encode_nfstime3(p, &attr->ia_atime); | 616 | ts = timespec64_to_timespec(attr->ia_atime); |
617 | p = xdr_encode_nfstime3(p, &ts); | ||
615 | } else if (attr->ia_valid & ATTR_ATIME) { | 618 | } else if (attr->ia_valid & ATTR_ATIME) { |
616 | *p++ = xdr_one; | 619 | *p++ = xdr_one; |
617 | } else | 620 | } else |
@@ -619,7 +622,8 @@ static void encode_sattr3(struct xdr_stream *xdr, const struct iattr *attr) | |||
619 | 622 | ||
620 | if (attr->ia_valid & ATTR_MTIME_SET) { | 623 | if (attr->ia_valid & ATTR_MTIME_SET) { |
621 | *p++ = xdr_two; | 624 | *p++ = xdr_two; |
622 | xdr_encode_nfstime3(p, &attr->ia_mtime); | 625 | ts = timespec64_to_timespec(attr->ia_mtime); |
626 | xdr_encode_nfstime3(p, &ts); | ||
623 | } else if (attr->ia_valid & ATTR_MTIME) { | 627 | } else if (attr->ia_valid & ATTR_MTIME) { |
624 | *p = xdr_one; | 628 | *p = xdr_one; |
625 | } else | 629 | } else |
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 9b7392032321..481426e9e6f0 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -1057,6 +1057,7 @@ static void encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, | |||
1057 | const struct nfs_server *server, | 1057 | const struct nfs_server *server, |
1058 | const uint32_t attrmask[]) | 1058 | const uint32_t attrmask[]) |
1059 | { | 1059 | { |
1060 | struct timespec ts; | ||
1060 | char owner_name[IDMAP_NAMESZ]; | 1061 | char owner_name[IDMAP_NAMESZ]; |
1061 | char owner_group[IDMAP_NAMESZ]; | 1062 | char owner_group[IDMAP_NAMESZ]; |
1062 | int owner_namelen = 0; | 1063 | int owner_namelen = 0; |
@@ -1145,14 +1146,16 @@ static void encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, | |||
1145 | if (bmval[1] & FATTR4_WORD1_TIME_ACCESS_SET) { | 1146 | if (bmval[1] & FATTR4_WORD1_TIME_ACCESS_SET) { |
1146 | if (iap->ia_valid & ATTR_ATIME_SET) { | 1147 | if (iap->ia_valid & ATTR_ATIME_SET) { |
1147 | *p++ = cpu_to_be32(NFS4_SET_TO_CLIENT_TIME); | 1148 | *p++ = cpu_to_be32(NFS4_SET_TO_CLIENT_TIME); |
1148 | p = xdr_encode_nfstime4(p, &iap->ia_atime); | 1149 | ts = timespec64_to_timespec(iap->ia_atime); |
1150 | p = xdr_encode_nfstime4(p, &ts); | ||
1149 | } else | 1151 | } else |
1150 | *p++ = cpu_to_be32(NFS4_SET_TO_SERVER_TIME); | 1152 | *p++ = cpu_to_be32(NFS4_SET_TO_SERVER_TIME); |
1151 | } | 1153 | } |
1152 | if (bmval[1] & FATTR4_WORD1_TIME_MODIFY_SET) { | 1154 | if (bmval[1] & FATTR4_WORD1_TIME_MODIFY_SET) { |
1153 | if (iap->ia_valid & ATTR_MTIME_SET) { | 1155 | if (iap->ia_valid & ATTR_MTIME_SET) { |
1154 | *p++ = cpu_to_be32(NFS4_SET_TO_CLIENT_TIME); | 1156 | *p++ = cpu_to_be32(NFS4_SET_TO_CLIENT_TIME); |
1155 | p = xdr_encode_nfstime4(p, &iap->ia_mtime); | 1157 | ts = timespec64_to_timespec(iap->ia_mtime); |
1158 | p = xdr_encode_nfstime4(p, &ts); | ||
1156 | } else | 1159 | } else |
1157 | *p++ = cpu_to_be32(NFS4_SET_TO_SERVER_TIME); | 1160 | *p++ = cpu_to_be32(NFS4_SET_TO_SERVER_TIME); |
1158 | } | 1161 | } |
diff --git a/fs/nfsd/blocklayout.c b/fs/nfsd/blocklayout.c index 70b8bf781fce..72b21eaffc50 100644 --- a/fs/nfsd/blocklayout.c +++ b/fs/nfsd/blocklayout.c | |||
@@ -121,13 +121,15 @@ nfsd4_block_commit_blocks(struct inode *inode, struct nfsd4_layoutcommit *lcp, | |||
121 | { | 121 | { |
122 | loff_t new_size = lcp->lc_last_wr + 1; | 122 | loff_t new_size = lcp->lc_last_wr + 1; |
123 | struct iattr iattr = { .ia_valid = 0 }; | 123 | struct iattr iattr = { .ia_valid = 0 }; |
124 | struct timespec ts; | ||
124 | int error; | 125 | int error; |
125 | 126 | ||
127 | ts = timespec64_to_timespec(inode->i_mtime); | ||
126 | if (lcp->lc_mtime.tv_nsec == UTIME_NOW || | 128 | if (lcp->lc_mtime.tv_nsec == UTIME_NOW || |
127 | timespec_compare(&lcp->lc_mtime, &inode->i_mtime) < 0) | 129 | timespec_compare(&lcp->lc_mtime, &ts) < 0) |
128 | lcp->lc_mtime = current_time(inode); | 130 | lcp->lc_mtime = timespec64_to_timespec(current_time(inode)); |
129 | iattr.ia_valid |= ATTR_ATIME | ATTR_CTIME | ATTR_MTIME; | 131 | iattr.ia_valid |= ATTR_ATIME | ATTR_CTIME | ATTR_MTIME; |
130 | iattr.ia_atime = iattr.ia_ctime = iattr.ia_mtime = lcp->lc_mtime; | 132 | iattr.ia_atime = iattr.ia_ctime = iattr.ia_mtime = timespec_to_timespec64(lcp->lc_mtime); |
131 | 133 | ||
132 | if (new_size > i_size_read(inode)) { | 134 | if (new_size > i_size_read(inode)) { |
133 | iattr.ia_valid |= ATTR_SIZE; | 135 | iattr.ia_valid |= ATTR_SIZE; |
diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c index 3192b544a441..9b973f4f7d01 100644 --- a/fs/nfsd/nfs3xdr.c +++ b/fs/nfsd/nfs3xdr.c | |||
@@ -165,6 +165,7 @@ static __be32 * | |||
165 | encode_fattr3(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp, | 165 | encode_fattr3(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp, |
166 | struct kstat *stat) | 166 | struct kstat *stat) |
167 | { | 167 | { |
168 | struct timespec ts; | ||
168 | *p++ = htonl(nfs3_ftypes[(stat->mode & S_IFMT) >> 12]); | 169 | *p++ = htonl(nfs3_ftypes[(stat->mode & S_IFMT) >> 12]); |
169 | *p++ = htonl((u32) (stat->mode & S_IALLUGO)); | 170 | *p++ = htonl((u32) (stat->mode & S_IALLUGO)); |
170 | *p++ = htonl((u32) stat->nlink); | 171 | *p++ = htonl((u32) stat->nlink); |
@@ -180,9 +181,12 @@ encode_fattr3(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp, | |||
180 | *p++ = htonl((u32) MINOR(stat->rdev)); | 181 | *p++ = htonl((u32) MINOR(stat->rdev)); |
181 | p = encode_fsid(p, fhp); | 182 | p = encode_fsid(p, fhp); |
182 | p = xdr_encode_hyper(p, stat->ino); | 183 | p = xdr_encode_hyper(p, stat->ino); |
183 | p = encode_time3(p, &stat->atime); | 184 | ts = timespec64_to_timespec(stat->atime); |
184 | p = encode_time3(p, &stat->mtime); | 185 | p = encode_time3(p, &ts); |
185 | p = encode_time3(p, &stat->ctime); | 186 | ts = timespec64_to_timespec(stat->mtime); |
187 | p = encode_time3(p, &ts); | ||
188 | ts = timespec64_to_timespec(stat->ctime); | ||
189 | p = encode_time3(p, &ts); | ||
186 | 190 | ||
187 | return p; | 191 | return p; |
188 | } | 192 | } |
@@ -271,8 +275,8 @@ void fill_pre_wcc(struct svc_fh *fhp) | |||
271 | stat.size = inode->i_size; | 275 | stat.size = inode->i_size; |
272 | } | 276 | } |
273 | 277 | ||
274 | fhp->fh_pre_mtime = stat.mtime; | 278 | fhp->fh_pre_mtime = timespec64_to_timespec(stat.mtime); |
275 | fhp->fh_pre_ctime = stat.ctime; | 279 | fhp->fh_pre_ctime = timespec64_to_timespec(stat.ctime); |
276 | fhp->fh_pre_size = stat.size; | 280 | fhp->fh_pre_size = stat.size; |
277 | fhp->fh_pre_change = nfsd4_change_attribute(&stat, inode); | 281 | fhp->fh_pre_change = nfsd4_change_attribute(&stat, inode); |
278 | fhp->fh_pre_saved = true; | 282 | fhp->fh_pre_saved = true; |
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 1d048dd95464..c09323c3b419 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c | |||
@@ -320,6 +320,7 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, | |||
320 | struct iattr *iattr, struct nfs4_acl **acl, | 320 | struct iattr *iattr, struct nfs4_acl **acl, |
321 | struct xdr_netobj *label, int *umask) | 321 | struct xdr_netobj *label, int *umask) |
322 | { | 322 | { |
323 | struct timespec ts; | ||
323 | int expected_len, len = 0; | 324 | int expected_len, len = 0; |
324 | u32 dummy32; | 325 | u32 dummy32; |
325 | char *buf; | 326 | char *buf; |
@@ -421,7 +422,8 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, | |||
421 | switch (dummy32) { | 422 | switch (dummy32) { |
422 | case NFS4_SET_TO_CLIENT_TIME: | 423 | case NFS4_SET_TO_CLIENT_TIME: |
423 | len += 12; | 424 | len += 12; |
424 | status = nfsd4_decode_time(argp, &iattr->ia_atime); | 425 | status = nfsd4_decode_time(argp, &ts); |
426 | iattr->ia_atime = timespec_to_timespec64(ts); | ||
425 | if (status) | 427 | if (status) |
426 | return status; | 428 | return status; |
427 | iattr->ia_valid |= (ATTR_ATIME | ATTR_ATIME_SET); | 429 | iattr->ia_valid |= (ATTR_ATIME | ATTR_ATIME_SET); |
@@ -440,7 +442,8 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, | |||
440 | switch (dummy32) { | 442 | switch (dummy32) { |
441 | case NFS4_SET_TO_CLIENT_TIME: | 443 | case NFS4_SET_TO_CLIENT_TIME: |
442 | len += 12; | 444 | len += 12; |
443 | status = nfsd4_decode_time(argp, &iattr->ia_mtime); | 445 | status = nfsd4_decode_time(argp, &ts); |
446 | iattr->ia_mtime = timespec_to_timespec64(ts); | ||
444 | if (status) | 447 | if (status) |
445 | return status; | 448 | return status; |
446 | iattr->ia_valid |= (ATTR_MTIME | ATTR_MTIME_SET); | 449 | iattr->ia_valid |= (ATTR_MTIME | ATTR_MTIME_SET); |
diff --git a/fs/nfsd/nfsxdr.c b/fs/nfsd/nfsxdr.c index a43e8260520a..6b2e8b73d36e 100644 --- a/fs/nfsd/nfsxdr.c +++ b/fs/nfsd/nfsxdr.c | |||
@@ -131,7 +131,7 @@ encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp, | |||
131 | { | 131 | { |
132 | struct dentry *dentry = fhp->fh_dentry; | 132 | struct dentry *dentry = fhp->fh_dentry; |
133 | int type; | 133 | int type; |
134 | struct timespec time; | 134 | struct timespec64 time; |
135 | u32 f; | 135 | u32 f; |
136 | 136 | ||
137 | type = (stat->mode & S_IFMT); | 137 | type = (stat->mode & S_IFMT); |
diff --git a/fs/ntfs/inode.c b/fs/ntfs/inode.c index 1c1ee489284b..decaf75d1cd5 100644 --- a/fs/ntfs/inode.c +++ b/fs/ntfs/inode.c | |||
@@ -667,18 +667,18 @@ static int ntfs_read_locked_inode(struct inode *vi) | |||
667 | * mtime is the last change of the data within the file. Not changed | 667 | * mtime is the last change of the data within the file. Not changed |
668 | * when only metadata is changed, e.g. a rename doesn't affect mtime. | 668 | * when only metadata is changed, e.g. a rename doesn't affect mtime. |
669 | */ | 669 | */ |
670 | vi->i_mtime = ntfs2utc(si->last_data_change_time); | 670 | vi->i_mtime = timespec_to_timespec64(ntfs2utc(si->last_data_change_time)); |
671 | /* | 671 | /* |
672 | * ctime is the last change of the metadata of the file. This obviously | 672 | * ctime is the last change of the metadata of the file. This obviously |
673 | * always changes, when mtime is changed. ctime can be changed on its | 673 | * always changes, when mtime is changed. ctime can be changed on its |
674 | * own, mtime is then not changed, e.g. when a file is renamed. | 674 | * own, mtime is then not changed, e.g. when a file is renamed. |
675 | */ | 675 | */ |
676 | vi->i_ctime = ntfs2utc(si->last_mft_change_time); | 676 | vi->i_ctime = timespec_to_timespec64(ntfs2utc(si->last_mft_change_time)); |
677 | /* | 677 | /* |
678 | * Last access to the data within the file. Not changed during a rename | 678 | * Last access to the data within the file. Not changed during a rename |
679 | * for example but changed whenever the file is written to. | 679 | * for example but changed whenever the file is written to. |
680 | */ | 680 | */ |
681 | vi->i_atime = ntfs2utc(si->last_access_time); | 681 | vi->i_atime = timespec_to_timespec64(ntfs2utc(si->last_access_time)); |
682 | 682 | ||
683 | /* Find the attribute list attribute if present. */ | 683 | /* Find the attribute list attribute if present. */ |
684 | ntfs_attr_reinit_search_ctx(ctx); | 684 | ntfs_attr_reinit_search_ctx(ctx); |
@@ -2804,11 +2804,11 @@ done: | |||
2804 | * for real. | 2804 | * for real. |
2805 | */ | 2805 | */ |
2806 | if (!IS_NOCMTIME(VFS_I(base_ni)) && !IS_RDONLY(VFS_I(base_ni))) { | 2806 | if (!IS_NOCMTIME(VFS_I(base_ni)) && !IS_RDONLY(VFS_I(base_ni))) { |
2807 | struct timespec now = current_time(VFS_I(base_ni)); | 2807 | struct timespec64 now = current_time(VFS_I(base_ni)); |
2808 | int sync_it = 0; | 2808 | int sync_it = 0; |
2809 | 2809 | ||
2810 | if (!timespec_equal(&VFS_I(base_ni)->i_mtime, &now) || | 2810 | if (!timespec64_equal(&VFS_I(base_ni)->i_mtime, &now) || |
2811 | !timespec_equal(&VFS_I(base_ni)->i_ctime, &now)) | 2811 | !timespec64_equal(&VFS_I(base_ni)->i_ctime, &now)) |
2812 | sync_it = 1; | 2812 | sync_it = 1; |
2813 | VFS_I(base_ni)->i_mtime = now; | 2813 | VFS_I(base_ni)->i_mtime = now; |
2814 | VFS_I(base_ni)->i_ctime = now; | 2814 | VFS_I(base_ni)->i_ctime = now; |
@@ -2923,14 +2923,14 @@ int ntfs_setattr(struct dentry *dentry, struct iattr *attr) | |||
2923 | } | 2923 | } |
2924 | } | 2924 | } |
2925 | if (ia_valid & ATTR_ATIME) | 2925 | if (ia_valid & ATTR_ATIME) |
2926 | vi->i_atime = timespec_trunc(attr->ia_atime, | 2926 | vi->i_atime = timespec64_trunc(attr->ia_atime, |
2927 | vi->i_sb->s_time_gran); | 2927 | vi->i_sb->s_time_gran); |
2928 | if (ia_valid & ATTR_MTIME) | 2928 | if (ia_valid & ATTR_MTIME) |
2929 | vi->i_mtime = timespec_trunc(attr->ia_mtime, | 2929 | vi->i_mtime = timespec64_trunc(attr->ia_mtime, |
2930 | vi->i_sb->s_time_gran); | 2930 | vi->i_sb->s_time_gran); |
2931 | if (ia_valid & ATTR_CTIME) | 2931 | if (ia_valid & ATTR_CTIME) |
2932 | vi->i_ctime = timespec_trunc(attr->ia_ctime, | 2932 | vi->i_ctime = timespec64_trunc(attr->ia_ctime, |
2933 | vi->i_sb->s_time_gran); | 2933 | vi->i_sb->s_time_gran); |
2934 | mark_inode_dirty(vi); | 2934 | mark_inode_dirty(vi); |
2935 | out: | 2935 | out: |
2936 | return err; | 2936 | return err; |
@@ -2997,7 +2997,7 @@ int __ntfs_write_inode(struct inode *vi, int sync) | |||
2997 | si = (STANDARD_INFORMATION*)((u8*)ctx->attr + | 2997 | si = (STANDARD_INFORMATION*)((u8*)ctx->attr + |
2998 | le16_to_cpu(ctx->attr->data.resident.value_offset)); | 2998 | le16_to_cpu(ctx->attr->data.resident.value_offset)); |
2999 | /* Update the access times if they have changed. */ | 2999 | /* Update the access times if they have changed. */ |
3000 | nt = utc2ntfs(vi->i_mtime); | 3000 | nt = utc2ntfs(timespec64_to_timespec(vi->i_mtime)); |
3001 | if (si->last_data_change_time != nt) { | 3001 | if (si->last_data_change_time != nt) { |
3002 | ntfs_debug("Updating mtime for inode 0x%lx: old = 0x%llx, " | 3002 | ntfs_debug("Updating mtime for inode 0x%lx: old = 0x%llx, " |
3003 | "new = 0x%llx", vi->i_ino, (long long) | 3003 | "new = 0x%llx", vi->i_ino, (long long) |
@@ -3006,7 +3006,7 @@ int __ntfs_write_inode(struct inode *vi, int sync) | |||
3006 | si->last_data_change_time = nt; | 3006 | si->last_data_change_time = nt; |
3007 | modified = true; | 3007 | modified = true; |
3008 | } | 3008 | } |
3009 | nt = utc2ntfs(vi->i_ctime); | 3009 | nt = utc2ntfs(timespec64_to_timespec(vi->i_ctime)); |
3010 | if (si->last_mft_change_time != nt) { | 3010 | if (si->last_mft_change_time != nt) { |
3011 | ntfs_debug("Updating ctime for inode 0x%lx: old = 0x%llx, " | 3011 | ntfs_debug("Updating ctime for inode 0x%lx: old = 0x%llx, " |
3012 | "new = 0x%llx", vi->i_ino, (long long) | 3012 | "new = 0x%llx", vi->i_ino, (long long) |
@@ -3015,7 +3015,7 @@ int __ntfs_write_inode(struct inode *vi, int sync) | |||
3015 | si->last_mft_change_time = nt; | 3015 | si->last_mft_change_time = nt; |
3016 | modified = true; | 3016 | modified = true; |
3017 | } | 3017 | } |
3018 | nt = utc2ntfs(vi->i_atime); | 3018 | nt = utc2ntfs(timespec64_to_timespec(vi->i_atime)); |
3019 | if (si->last_access_time != nt) { | 3019 | if (si->last_access_time != nt) { |
3020 | ntfs_debug("Updating atime for inode 0x%lx: old = 0x%llx, " | 3020 | ntfs_debug("Updating atime for inode 0x%lx: old = 0x%llx, " |
3021 | "new = 0x%llx", vi->i_ino, | 3021 | "new = 0x%llx", vi->i_ino, |
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index 97a972efab83..3eb665187d46 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c | |||
@@ -2141,6 +2141,7 @@ static void __ocfs2_stuff_meta_lvb(struct inode *inode) | |||
2141 | struct ocfs2_inode_info *oi = OCFS2_I(inode); | 2141 | struct ocfs2_inode_info *oi = OCFS2_I(inode); |
2142 | struct ocfs2_lock_res *lockres = &oi->ip_inode_lockres; | 2142 | struct ocfs2_lock_res *lockres = &oi->ip_inode_lockres; |
2143 | struct ocfs2_meta_lvb *lvb; | 2143 | struct ocfs2_meta_lvb *lvb; |
2144 | struct timespec ts; | ||
2144 | 2145 | ||
2145 | lvb = ocfs2_dlm_lvb(&lockres->l_lksb); | 2146 | lvb = ocfs2_dlm_lvb(&lockres->l_lksb); |
2146 | 2147 | ||
@@ -2161,12 +2162,15 @@ static void __ocfs2_stuff_meta_lvb(struct inode *inode) | |||
2161 | lvb->lvb_igid = cpu_to_be32(i_gid_read(inode)); | 2162 | lvb->lvb_igid = cpu_to_be32(i_gid_read(inode)); |
2162 | lvb->lvb_imode = cpu_to_be16(inode->i_mode); | 2163 | lvb->lvb_imode = cpu_to_be16(inode->i_mode); |
2163 | lvb->lvb_inlink = cpu_to_be16(inode->i_nlink); | 2164 | lvb->lvb_inlink = cpu_to_be16(inode->i_nlink); |
2165 | ts = timespec64_to_timespec(inode->i_atime); | ||
2164 | lvb->lvb_iatime_packed = | 2166 | lvb->lvb_iatime_packed = |
2165 | cpu_to_be64(ocfs2_pack_timespec(&inode->i_atime)); | 2167 | cpu_to_be64(ocfs2_pack_timespec(&ts)); |
2168 | ts = timespec64_to_timespec(inode->i_ctime); | ||
2166 | lvb->lvb_ictime_packed = | 2169 | lvb->lvb_ictime_packed = |
2167 | cpu_to_be64(ocfs2_pack_timespec(&inode->i_ctime)); | 2170 | cpu_to_be64(ocfs2_pack_timespec(&ts)); |
2171 | ts = timespec64_to_timespec(inode->i_mtime); | ||
2168 | lvb->lvb_imtime_packed = | 2172 | lvb->lvb_imtime_packed = |
2169 | cpu_to_be64(ocfs2_pack_timespec(&inode->i_mtime)); | 2173 | cpu_to_be64(ocfs2_pack_timespec(&ts)); |
2170 | lvb->lvb_iattr = cpu_to_be32(oi->ip_attr); | 2174 | lvb->lvb_iattr = cpu_to_be32(oi->ip_attr); |
2171 | lvb->lvb_idynfeatures = cpu_to_be16(oi->ip_dyn_features); | 2175 | lvb->lvb_idynfeatures = cpu_to_be16(oi->ip_dyn_features); |
2172 | lvb->lvb_igeneration = cpu_to_be32(inode->i_generation); | 2176 | lvb->lvb_igeneration = cpu_to_be32(inode->i_generation); |
@@ -2184,6 +2188,7 @@ static void ocfs2_unpack_timespec(struct timespec *spec, | |||
2184 | 2188 | ||
2185 | static void ocfs2_refresh_inode_from_lvb(struct inode *inode) | 2189 | static void ocfs2_refresh_inode_from_lvb(struct inode *inode) |
2186 | { | 2190 | { |
2191 | struct timespec ts; | ||
2187 | struct ocfs2_inode_info *oi = OCFS2_I(inode); | 2192 | struct ocfs2_inode_info *oi = OCFS2_I(inode); |
2188 | struct ocfs2_lock_res *lockres = &oi->ip_inode_lockres; | 2193 | struct ocfs2_lock_res *lockres = &oi->ip_inode_lockres; |
2189 | struct ocfs2_meta_lvb *lvb; | 2194 | struct ocfs2_meta_lvb *lvb; |
@@ -2211,12 +2216,15 @@ static void ocfs2_refresh_inode_from_lvb(struct inode *inode) | |||
2211 | i_gid_write(inode, be32_to_cpu(lvb->lvb_igid)); | 2216 | i_gid_write(inode, be32_to_cpu(lvb->lvb_igid)); |
2212 | inode->i_mode = be16_to_cpu(lvb->lvb_imode); | 2217 | inode->i_mode = be16_to_cpu(lvb->lvb_imode); |
2213 | set_nlink(inode, be16_to_cpu(lvb->lvb_inlink)); | 2218 | set_nlink(inode, be16_to_cpu(lvb->lvb_inlink)); |
2214 | ocfs2_unpack_timespec(&inode->i_atime, | 2219 | ocfs2_unpack_timespec(&ts, |
2215 | be64_to_cpu(lvb->lvb_iatime_packed)); | 2220 | be64_to_cpu(lvb->lvb_iatime_packed)); |
2216 | ocfs2_unpack_timespec(&inode->i_mtime, | 2221 | inode->i_atime = timespec_to_timespec64(ts); |
2222 | ocfs2_unpack_timespec(&ts, | ||
2217 | be64_to_cpu(lvb->lvb_imtime_packed)); | 2223 | be64_to_cpu(lvb->lvb_imtime_packed)); |
2218 | ocfs2_unpack_timespec(&inode->i_ctime, | 2224 | inode->i_mtime = timespec_to_timespec64(ts); |
2225 | ocfs2_unpack_timespec(&ts, | ||
2219 | be64_to_cpu(lvb->lvb_ictime_packed)); | 2226 | be64_to_cpu(lvb->lvb_ictime_packed)); |
2227 | inode->i_ctime = timespec_to_timespec64(ts); | ||
2220 | spin_unlock(&oi->ip_lock); | 2228 | spin_unlock(&oi->ip_lock); |
2221 | } | 2229 | } |
2222 | 2230 | ||
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 6ee94bc23f5b..4b32069d4390 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -222,7 +222,7 @@ static int ocfs2_sync_file(struct file *file, loff_t start, loff_t end, | |||
222 | int ocfs2_should_update_atime(struct inode *inode, | 222 | int ocfs2_should_update_atime(struct inode *inode, |
223 | struct vfsmount *vfsmnt) | 223 | struct vfsmount *vfsmnt) |
224 | { | 224 | { |
225 | struct timespec now; | 225 | struct timespec64 now; |
226 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 226 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
227 | 227 | ||
228 | if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb)) | 228 | if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb)) |
@@ -248,8 +248,8 @@ int ocfs2_should_update_atime(struct inode *inode, | |||
248 | return 0; | 248 | return 0; |
249 | 249 | ||
250 | if (vfsmnt->mnt_flags & MNT_RELATIME) { | 250 | if (vfsmnt->mnt_flags & MNT_RELATIME) { |
251 | if ((timespec_compare(&inode->i_atime, &inode->i_mtime) <= 0) || | 251 | if ((timespec64_compare(&inode->i_atime, &inode->i_mtime) <= 0) || |
252 | (timespec_compare(&inode->i_atime, &inode->i_ctime) <= 0)) | 252 | (timespec64_compare(&inode->i_atime, &inode->i_ctime) <= 0)) |
253 | return 1; | 253 | return 1; |
254 | 254 | ||
255 | return 0; | 255 | return 0; |
diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c index 79c61da8b1bc..7e3400b90bc9 100644 --- a/fs/orangefs/inode.c +++ b/fs/orangefs/inode.c | |||
@@ -290,7 +290,7 @@ int orangefs_permission(struct inode *inode, int mask) | |||
290 | return generic_permission(inode, mask); | 290 | return generic_permission(inode, mask); |
291 | } | 291 | } |
292 | 292 | ||
293 | int orangefs_update_time(struct inode *inode, struct timespec *time, int flags) | 293 | int orangefs_update_time(struct inode *inode, struct timespec64 *time, int flags) |
294 | { | 294 | { |
295 | struct iattr iattr; | 295 | struct iattr iattr; |
296 | gossip_debug(GOSSIP_INODE_DEBUG, "orangefs_update_time: %pU\n", | 296 | gossip_debug(GOSSIP_INODE_DEBUG, "orangefs_update_time: %pU\n", |
diff --git a/fs/orangefs/orangefs-kernel.h b/fs/orangefs/orangefs-kernel.h index c29bb0ebc6bb..7ed50ee3db8a 100644 --- a/fs/orangefs/orangefs-kernel.h +++ b/fs/orangefs/orangefs-kernel.h | |||
@@ -343,7 +343,7 @@ int orangefs_getattr(const struct path *path, struct kstat *stat, | |||
343 | 343 | ||
344 | int orangefs_permission(struct inode *inode, int mask); | 344 | int orangefs_permission(struct inode *inode, int mask); |
345 | 345 | ||
346 | int orangefs_update_time(struct inode *, struct timespec *, int); | 346 | int orangefs_update_time(struct inode *, struct timespec64 *, int); |
347 | 347 | ||
348 | /* | 348 | /* |
349 | * defined in xattr.c | 349 | * defined in xattr.c |
diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index 6e3815fb006b..d7cca60f28e6 100644 --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c | |||
@@ -416,7 +416,7 @@ int ovl_open_maybe_copy_up(struct dentry *dentry, unsigned int file_flags) | |||
416 | return err; | 416 | return err; |
417 | } | 417 | } |
418 | 418 | ||
419 | int ovl_update_time(struct inode *inode, struct timespec *ts, int flags) | 419 | int ovl_update_time(struct inode *inode, struct timespec64 *ts, int flags) |
420 | { | 420 | { |
421 | if (flags & S_ATIME) { | 421 | if (flags & S_ATIME) { |
422 | struct ovl_fs *ofs = inode->i_sb->s_fs_info; | 422 | struct ovl_fs *ofs = inode->i_sb->s_fs_info; |
diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h index e0b7de799f6b..9fe10247f9d4 100644 --- a/fs/overlayfs/overlayfs.h +++ b/fs/overlayfs/overlayfs.h | |||
@@ -331,7 +331,7 @@ int ovl_xattr_get(struct dentry *dentry, struct inode *inode, const char *name, | |||
331 | ssize_t ovl_listxattr(struct dentry *dentry, char *list, size_t size); | 331 | ssize_t ovl_listxattr(struct dentry *dentry, char *list, size_t size); |
332 | struct posix_acl *ovl_get_acl(struct inode *inode, int type); | 332 | struct posix_acl *ovl_get_acl(struct inode *inode, int type); |
333 | int ovl_open_maybe_copy_up(struct dentry *dentry, unsigned int file_flags); | 333 | int ovl_open_maybe_copy_up(struct dentry *dentry, unsigned int file_flags); |
334 | int ovl_update_time(struct inode *inode, struct timespec *ts, int flags); | 334 | int ovl_update_time(struct inode *inode, struct timespec64 *ts, int flags); |
335 | bool ovl_is_private_xattr(const char *name); | 335 | bool ovl_is_private_xattr(const char *name); |
336 | 336 | ||
337 | struct inode *ovl_new_inode(struct super_block *sb, umode_t mode, dev_t rdev); | 337 | struct inode *ovl_new_inode(struct super_block *sb, umode_t mode, dev_t rdev); |
diff --git a/fs/proc/uptime.c b/fs/proc/uptime.c index 95a708d83721..f18e6f949e0c 100644 --- a/fs/proc/uptime.c +++ b/fs/proc/uptime.c | |||
@@ -10,7 +10,7 @@ | |||
10 | static int uptime_proc_show(struct seq_file *m, void *v) | 10 | static int uptime_proc_show(struct seq_file *m, void *v) |
11 | { | 11 | { |
12 | struct timespec uptime; | 12 | struct timespec uptime; |
13 | struct timespec idle; | 13 | struct timespec64 idle; |
14 | u64 nsec; | 14 | u64 nsec; |
15 | u32 rem; | 15 | u32 rem; |
16 | int i; | 16 | int i; |
diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index 75afe5eb0574..5fcb845b9fec 100644 --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c | |||
@@ -392,8 +392,7 @@ int pstore_mkfile(struct dentry *root, struct pstore_record *record) | |||
392 | inode->i_private = private; | 392 | inode->i_private = private; |
393 | 393 | ||
394 | if (record->time.tv_sec) | 394 | if (record->time.tv_sec) |
395 | inode->i_mtime = inode->i_ctime = | 395 | inode->i_mtime = inode->i_ctime = record->time; |
396 | timespec64_to_timespec(record->time); | ||
397 | 396 | ||
398 | d_add(dentry, inode); | 397 | d_add(dentry, inode); |
399 | 398 | ||
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c index bd39a998843d..d2869ced6d39 100644 --- a/fs/reiserfs/namei.c +++ b/fs/reiserfs/namei.c | |||
@@ -1320,7 +1320,7 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1320 | int jbegin_count; | 1320 | int jbegin_count; |
1321 | umode_t old_inode_mode; | 1321 | umode_t old_inode_mode; |
1322 | unsigned long savelink = 1; | 1322 | unsigned long savelink = 1; |
1323 | struct timespec ctime; | 1323 | struct timespec64 ctime; |
1324 | 1324 | ||
1325 | if (flags & ~RENAME_NOREPLACE) | 1325 | if (flags & ~RENAME_NOREPLACE) |
1326 | return -EINVAL; | 1326 | return -EINVAL; |
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c index 5dbf5324bdda..ff94fad477e4 100644 --- a/fs/reiserfs/xattr.c +++ b/fs/reiserfs/xattr.c | |||
@@ -451,10 +451,10 @@ int reiserfs_commit_write(struct file *f, struct page *page, | |||
451 | 451 | ||
452 | static void update_ctime(struct inode *inode) | 452 | static void update_ctime(struct inode *inode) |
453 | { | 453 | { |
454 | struct timespec now = current_time(inode); | 454 | struct timespec64 now = current_time(inode); |
455 | 455 | ||
456 | if (inode_unhashed(inode) || !inode->i_nlink || | 456 | if (inode_unhashed(inode) || !inode->i_nlink || |
457 | timespec_equal(&inode->i_ctime, &now)) | 457 | timespec64_equal(&inode->i_ctime, &now)) |
458 | return; | 458 | return; |
459 | 459 | ||
460 | inode->i_ctime = current_time(inode); | 460 | inode->i_ctime = current_time(inode); |
diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index 9d7fb88e172e..ba53517448b4 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c | |||
@@ -1289,7 +1289,7 @@ static int do_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1289 | .dirtied_ino = 3 }; | 1289 | .dirtied_ino = 3 }; |
1290 | struct ubifs_budget_req ino_req = { .dirtied_ino = 1, | 1290 | struct ubifs_budget_req ino_req = { .dirtied_ino = 1, |
1291 | .dirtied_ino_d = ALIGN(old_inode_ui->data_len, 8) }; | 1291 | .dirtied_ino_d = ALIGN(old_inode_ui->data_len, 8) }; |
1292 | struct timespec time; | 1292 | struct timespec64 time; |
1293 | unsigned int uninitialized_var(saved_nlink); | 1293 | unsigned int uninitialized_var(saved_nlink); |
1294 | struct fscrypt_name old_nm, new_nm; | 1294 | struct fscrypt_name old_nm, new_nm; |
1295 | 1295 | ||
@@ -1517,7 +1517,7 @@ static int ubifs_xrename(struct inode *old_dir, struct dentry *old_dentry, | |||
1517 | int sync = IS_DIRSYNC(old_dir) || IS_DIRSYNC(new_dir); | 1517 | int sync = IS_DIRSYNC(old_dir) || IS_DIRSYNC(new_dir); |
1518 | struct inode *fst_inode = d_inode(old_dentry); | 1518 | struct inode *fst_inode = d_inode(old_dentry); |
1519 | struct inode *snd_inode = d_inode(new_dentry); | 1519 | struct inode *snd_inode = d_inode(new_dentry); |
1520 | struct timespec time; | 1520 | struct timespec64 time; |
1521 | int err; | 1521 | int err; |
1522 | struct fscrypt_name fst_nm, snd_nm; | 1522 | struct fscrypt_name fst_nm, snd_nm; |
1523 | 1523 | ||
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index 1acb2ff505e6..ddb252109945 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c | |||
@@ -1089,14 +1089,14 @@ static void do_attr_changes(struct inode *inode, const struct iattr *attr) | |||
1089 | if (attr->ia_valid & ATTR_GID) | 1089 | if (attr->ia_valid & ATTR_GID) |
1090 | inode->i_gid = attr->ia_gid; | 1090 | inode->i_gid = attr->ia_gid; |
1091 | if (attr->ia_valid & ATTR_ATIME) | 1091 | if (attr->ia_valid & ATTR_ATIME) |
1092 | inode->i_atime = timespec_trunc(attr->ia_atime, | 1092 | inode->i_atime = timespec64_trunc(attr->ia_atime, |
1093 | inode->i_sb->s_time_gran); | 1093 | inode->i_sb->s_time_gran); |
1094 | if (attr->ia_valid & ATTR_MTIME) | 1094 | if (attr->ia_valid & ATTR_MTIME) |
1095 | inode->i_mtime = timespec_trunc(attr->ia_mtime, | 1095 | inode->i_mtime = timespec64_trunc(attr->ia_mtime, |
1096 | inode->i_sb->s_time_gran); | 1096 | inode->i_sb->s_time_gran); |
1097 | if (attr->ia_valid & ATTR_CTIME) | 1097 | if (attr->ia_valid & ATTR_CTIME) |
1098 | inode->i_ctime = timespec_trunc(attr->ia_ctime, | 1098 | inode->i_ctime = timespec64_trunc(attr->ia_ctime, |
1099 | inode->i_sb->s_time_gran); | 1099 | inode->i_sb->s_time_gran); |
1100 | if (attr->ia_valid & ATTR_MODE) { | 1100 | if (attr->ia_valid & ATTR_MODE) { |
1101 | umode_t mode = attr->ia_mode; | 1101 | umode_t mode = attr->ia_mode; |
1102 | 1102 | ||
@@ -1367,8 +1367,9 @@ out: | |||
1367 | static inline int mctime_update_needed(const struct inode *inode, | 1367 | static inline int mctime_update_needed(const struct inode *inode, |
1368 | const struct timespec *now) | 1368 | const struct timespec *now) |
1369 | { | 1369 | { |
1370 | if (!timespec_equal(&inode->i_mtime, now) || | 1370 | struct timespec64 now64 = timespec_to_timespec64(*now); |
1371 | !timespec_equal(&inode->i_ctime, now)) | 1371 | if (!timespec64_equal(&inode->i_mtime, &now64) || |
1372 | !timespec64_equal(&inode->i_ctime, &now64)) | ||
1372 | return 1; | 1373 | return 1; |
1373 | return 0; | 1374 | return 0; |
1374 | } | 1375 | } |
@@ -1380,7 +1381,7 @@ static inline int mctime_update_needed(const struct inode *inode, | |||
1380 | * | 1381 | * |
1381 | * This function updates time of the inode. | 1382 | * This function updates time of the inode. |
1382 | */ | 1383 | */ |
1383 | int ubifs_update_time(struct inode *inode, struct timespec *time, | 1384 | int ubifs_update_time(struct inode *inode, struct timespec64 *time, |
1384 | int flags) | 1385 | int flags) |
1385 | { | 1386 | { |
1386 | struct ubifs_inode *ui = ubifs_inode(inode); | 1387 | struct ubifs_inode *ui = ubifs_inode(inode); |
@@ -1424,7 +1425,7 @@ int ubifs_update_time(struct inode *inode, struct timespec *time, | |||
1424 | */ | 1425 | */ |
1425 | static int update_mctime(struct inode *inode) | 1426 | static int update_mctime(struct inode *inode) |
1426 | { | 1427 | { |
1427 | struct timespec now = current_time(inode); | 1428 | struct timespec now = timespec64_to_timespec(current_time(inode)); |
1428 | struct ubifs_inode *ui = ubifs_inode(inode); | 1429 | struct ubifs_inode *ui = ubifs_inode(inode); |
1429 | struct ubifs_info *c = inode->i_sb->s_fs_info; | 1430 | struct ubifs_info *c = inode->i_sb->s_fs_info; |
1430 | 1431 | ||
@@ -1518,7 +1519,7 @@ static int ubifs_vm_page_mkwrite(struct vm_fault *vmf) | |||
1518 | struct page *page = vmf->page; | 1519 | struct page *page = vmf->page; |
1519 | struct inode *inode = file_inode(vmf->vma->vm_file); | 1520 | struct inode *inode = file_inode(vmf->vma->vm_file); |
1520 | struct ubifs_info *c = inode->i_sb->s_fs_info; | 1521 | struct ubifs_info *c = inode->i_sb->s_fs_info; |
1521 | struct timespec now = current_time(inode); | 1522 | struct timespec now = timespec64_to_timespec(current_time(inode)); |
1522 | struct ubifs_budget_req req = { .new_page = 1 }; | 1523 | struct ubifs_budget_req req = { .new_page = 1 }; |
1523 | int err, update_time; | 1524 | int err, update_time; |
1524 | 1525 | ||
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index 5ee7af879cc4..ac61ba9921c8 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h | |||
@@ -1740,7 +1740,7 @@ int ubifs_calc_dark(const struct ubifs_info *c, int spc); | |||
1740 | int ubifs_fsync(struct file *file, loff_t start, loff_t end, int datasync); | 1740 | int ubifs_fsync(struct file *file, loff_t start, loff_t end, int datasync); |
1741 | int ubifs_setattr(struct dentry *dentry, struct iattr *attr); | 1741 | int ubifs_setattr(struct dentry *dentry, struct iattr *attr); |
1742 | #ifdef CONFIG_UBIFS_ATIME_SUPPORT | 1742 | #ifdef CONFIG_UBIFS_ATIME_SUPPORT |
1743 | int ubifs_update_time(struct inode *inode, struct timespec *time, int flags); | 1743 | int ubifs_update_time(struct inode *inode, struct timespec64 *time, int flags); |
1744 | #endif | 1744 | #endif |
1745 | 1745 | ||
1746 | /* dir.c */ | 1746 | /* dir.c */ |
diff --git a/fs/udf/ialloc.c b/fs/udf/ialloc.c index b7a0d4b4bda1..56569023783b 100644 --- a/fs/udf/ialloc.c +++ b/fs/udf/ialloc.c | |||
@@ -124,8 +124,8 @@ struct inode *udf_new_inode(struct inode *dir, umode_t mode) | |||
124 | iinfo->i_alloc_type = ICBTAG_FLAG_AD_SHORT; | 124 | iinfo->i_alloc_type = ICBTAG_FLAG_AD_SHORT; |
125 | else | 125 | else |
126 | iinfo->i_alloc_type = ICBTAG_FLAG_AD_LONG; | 126 | iinfo->i_alloc_type = ICBTAG_FLAG_AD_LONG; |
127 | inode->i_mtime = inode->i_atime = inode->i_ctime = | 127 | inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); |
128 | iinfo->i_crtime = current_time(inode); | 128 | iinfo->i_crtime = timespec64_to_timespec(inode->i_mtime); |
129 | if (unlikely(insert_inode_locked(inode) < 0)) { | 129 | if (unlikely(insert_inode_locked(inode) < 0)) { |
130 | make_bad_inode(inode); | 130 | make_bad_inode(inode); |
131 | iput(inode); | 131 | iput(inode); |
diff --git a/fs/udf/inode.c b/fs/udf/inode.c index df2378d6ebb4..7f39d17352c9 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c | |||
@@ -1271,6 +1271,7 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode) | |||
1271 | struct udf_inode_info *iinfo = UDF_I(inode); | 1271 | struct udf_inode_info *iinfo = UDF_I(inode); |
1272 | struct udf_sb_info *sbi = UDF_SB(inode->i_sb); | 1272 | struct udf_sb_info *sbi = UDF_SB(inode->i_sb); |
1273 | struct kernel_lb_addr *iloc = &iinfo->i_location; | 1273 | struct kernel_lb_addr *iloc = &iinfo->i_location; |
1274 | struct timespec ts; | ||
1274 | unsigned int link_count; | 1275 | unsigned int link_count; |
1275 | unsigned int indirections = 0; | 1276 | unsigned int indirections = 0; |
1276 | int bs = inode->i_sb->s_blocksize; | 1277 | int bs = inode->i_sb->s_blocksize; |
@@ -1443,9 +1444,12 @@ reread: | |||
1443 | inode->i_blocks = le64_to_cpu(fe->logicalBlocksRecorded) << | 1444 | inode->i_blocks = le64_to_cpu(fe->logicalBlocksRecorded) << |
1444 | (inode->i_sb->s_blocksize_bits - 9); | 1445 | (inode->i_sb->s_blocksize_bits - 9); |
1445 | 1446 | ||
1446 | udf_disk_stamp_to_time(&inode->i_atime, fe->accessTime); | 1447 | udf_disk_stamp_to_time(&ts, fe->accessTime); |
1447 | udf_disk_stamp_to_time(&inode->i_mtime, fe->modificationTime); | 1448 | inode->i_atime = timespec_to_timespec64(ts); |
1448 | udf_disk_stamp_to_time(&inode->i_ctime, fe->attrTime); | 1449 | udf_disk_stamp_to_time(&ts, fe->modificationTime); |
1450 | inode->i_mtime = timespec_to_timespec64(ts); | ||
1451 | udf_disk_stamp_to_time(&ts, fe->attrTime); | ||
1452 | inode->i_ctime = timespec_to_timespec64(ts); | ||
1449 | 1453 | ||
1450 | iinfo->i_unique = le64_to_cpu(fe->uniqueID); | 1454 | iinfo->i_unique = le64_to_cpu(fe->uniqueID); |
1451 | iinfo->i_lenEAttr = le32_to_cpu(fe->lengthExtendedAttr); | 1455 | iinfo->i_lenEAttr = le32_to_cpu(fe->lengthExtendedAttr); |
@@ -1455,10 +1459,13 @@ reread: | |||
1455 | inode->i_blocks = le64_to_cpu(efe->logicalBlocksRecorded) << | 1459 | inode->i_blocks = le64_to_cpu(efe->logicalBlocksRecorded) << |
1456 | (inode->i_sb->s_blocksize_bits - 9); | 1460 | (inode->i_sb->s_blocksize_bits - 9); |
1457 | 1461 | ||
1458 | udf_disk_stamp_to_time(&inode->i_atime, efe->accessTime); | 1462 | udf_disk_stamp_to_time(&ts, efe->accessTime); |
1459 | udf_disk_stamp_to_time(&inode->i_mtime, efe->modificationTime); | 1463 | inode->i_atime = timespec_to_timespec64(ts); |
1464 | udf_disk_stamp_to_time(&ts, efe->modificationTime); | ||
1465 | inode->i_mtime = timespec_to_timespec64(ts); | ||
1460 | udf_disk_stamp_to_time(&iinfo->i_crtime, efe->createTime); | 1466 | udf_disk_stamp_to_time(&iinfo->i_crtime, efe->createTime); |
1461 | udf_disk_stamp_to_time(&inode->i_ctime, efe->attrTime); | 1467 | udf_disk_stamp_to_time(&ts, efe->attrTime); |
1468 | inode->i_ctime = timespec_to_timespec64(ts); | ||
1462 | 1469 | ||
1463 | iinfo->i_unique = le64_to_cpu(efe->uniqueID); | 1470 | iinfo->i_unique = le64_to_cpu(efe->uniqueID); |
1464 | iinfo->i_lenEAttr = le32_to_cpu(efe->lengthExtendedAttr); | 1471 | iinfo->i_lenEAttr = le32_to_cpu(efe->lengthExtendedAttr); |
@@ -1708,9 +1715,12 @@ static int udf_update_inode(struct inode *inode, int do_sync) | |||
1708 | inode->i_sb->s_blocksize - sizeof(struct fileEntry)); | 1715 | inode->i_sb->s_blocksize - sizeof(struct fileEntry)); |
1709 | fe->logicalBlocksRecorded = cpu_to_le64(lb_recorded); | 1716 | fe->logicalBlocksRecorded = cpu_to_le64(lb_recorded); |
1710 | 1717 | ||
1711 | udf_time_to_disk_stamp(&fe->accessTime, inode->i_atime); | 1718 | udf_time_to_disk_stamp(&fe->accessTime, |
1712 | udf_time_to_disk_stamp(&fe->modificationTime, inode->i_mtime); | 1719 | timespec64_to_timespec(inode->i_atime)); |
1713 | udf_time_to_disk_stamp(&fe->attrTime, inode->i_ctime); | 1720 | udf_time_to_disk_stamp(&fe->modificationTime, |
1721 | timespec64_to_timespec(inode->i_mtime)); | ||
1722 | udf_time_to_disk_stamp(&fe->attrTime, | ||
1723 | timespec64_to_timespec(inode->i_ctime)); | ||
1714 | memset(&(fe->impIdent), 0, sizeof(struct regid)); | 1724 | memset(&(fe->impIdent), 0, sizeof(struct regid)); |
1715 | strcpy(fe->impIdent.ident, UDF_ID_DEVELOPER); | 1725 | strcpy(fe->impIdent.ident, UDF_ID_DEVELOPER); |
1716 | fe->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX; | 1726 | fe->impIdent.identSuffix[0] = UDF_OS_CLASS_UNIX; |
@@ -1729,14 +1739,17 @@ static int udf_update_inode(struct inode *inode, int do_sync) | |||
1729 | efe->objectSize = cpu_to_le64(inode->i_size); | 1739 | efe->objectSize = cpu_to_le64(inode->i_size); |
1730 | efe->logicalBlocksRecorded = cpu_to_le64(lb_recorded); | 1740 | efe->logicalBlocksRecorded = cpu_to_le64(lb_recorded); |
1731 | 1741 | ||
1732 | udf_adjust_time(iinfo, inode->i_atime); | 1742 | udf_adjust_time(iinfo, timespec64_to_timespec(inode->i_atime)); |
1733 | udf_adjust_time(iinfo, inode->i_mtime); | 1743 | udf_adjust_time(iinfo, timespec64_to_timespec(inode->i_mtime)); |
1734 | udf_adjust_time(iinfo, inode->i_ctime); | 1744 | udf_adjust_time(iinfo, timespec64_to_timespec(inode->i_ctime)); |
1735 | 1745 | ||
1736 | udf_time_to_disk_stamp(&efe->accessTime, inode->i_atime); | 1746 | udf_time_to_disk_stamp(&efe->accessTime, |
1737 | udf_time_to_disk_stamp(&efe->modificationTime, inode->i_mtime); | 1747 | timespec64_to_timespec(inode->i_atime)); |
1748 | udf_time_to_disk_stamp(&efe->modificationTime, | ||
1749 | timespec64_to_timespec(inode->i_mtime)); | ||
1738 | udf_time_to_disk_stamp(&efe->createTime, iinfo->i_crtime); | 1750 | udf_time_to_disk_stamp(&efe->createTime, iinfo->i_crtime); |
1739 | udf_time_to_disk_stamp(&efe->attrTime, inode->i_ctime); | 1751 | udf_time_to_disk_stamp(&efe->attrTime, |
1752 | timespec64_to_timespec(inode->i_ctime)); | ||
1740 | 1753 | ||
1741 | memset(&(efe->impIdent), 0, sizeof(efe->impIdent)); | 1754 | memset(&(efe->impIdent), 0, sizeof(efe->impIdent)); |
1742 | strcpy(efe->impIdent.ident, UDF_ID_DEVELOPER); | 1755 | strcpy(efe->impIdent.ident, UDF_ID_DEVELOPER); |
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 2b70c8b4cee2..0043812897af 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -773,7 +773,7 @@ xfs_ialloc( | |||
773 | xfs_inode_t *ip; | 773 | xfs_inode_t *ip; |
774 | uint flags; | 774 | uint flags; |
775 | int error; | 775 | int error; |
776 | struct timespec tv; | 776 | struct timespec64 tv; |
777 | struct inode *inode; | 777 | struct inode *inode; |
778 | 778 | ||
779 | /* | 779 | /* |
diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c index a3ed3c811dfa..b89601b445c2 100644 --- a/fs/xfs/xfs_iops.c +++ b/fs/xfs/xfs_iops.c | |||
@@ -1050,7 +1050,7 @@ xfs_vn_setattr( | |||
1050 | STATIC int | 1050 | STATIC int |
1051 | xfs_vn_update_time( | 1051 | xfs_vn_update_time( |
1052 | struct inode *inode, | 1052 | struct inode *inode, |
1053 | struct timespec *now, | 1053 | struct timespec64 *now, |
1054 | int flags) | 1054 | int flags) |
1055 | { | 1055 | { |
1056 | struct xfs_inode *ip = XFS_I(inode); | 1056 | struct xfs_inode *ip = XFS_I(inode); |
diff --git a/fs/xfs/xfs_trans_inode.c b/fs/xfs/xfs_trans_inode.c index 07cea592dc01..a1b3ce132f2f 100644 --- a/fs/xfs/xfs_trans_inode.c +++ b/fs/xfs/xfs_trans_inode.c | |||
@@ -70,7 +70,7 @@ xfs_trans_ichgtime( | |||
70 | int flags) | 70 | int flags) |
71 | { | 71 | { |
72 | struct inode *inode = VFS_I(ip); | 72 | struct inode *inode = VFS_I(ip); |
73 | struct timespec tv; | 73 | struct timespec64 tv; |
74 | 74 | ||
75 | ASSERT(tp); | 75 | ASSERT(tp); |
76 | ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); | 76 | ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 7f6997e0dabf..f15329aa9cad 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -206,9 +206,9 @@ struct iattr { | |||
206 | kuid_t ia_uid; | 206 | kuid_t ia_uid; |
207 | kgid_t ia_gid; | 207 | kgid_t ia_gid; |
208 | loff_t ia_size; | 208 | loff_t ia_size; |
209 | struct timespec ia_atime; | 209 | struct timespec64 ia_atime; |
210 | struct timespec ia_mtime; | 210 | struct timespec64 ia_mtime; |
211 | struct timespec ia_ctime; | 211 | struct timespec64 ia_ctime; |
212 | 212 | ||
213 | /* | 213 | /* |
214 | * Not an attribute, but an auxiliary info for filesystems wanting to | 214 | * Not an attribute, but an auxiliary info for filesystems wanting to |
@@ -602,9 +602,9 @@ struct inode { | |||
602 | }; | 602 | }; |
603 | dev_t i_rdev; | 603 | dev_t i_rdev; |
604 | loff_t i_size; | 604 | loff_t i_size; |
605 | struct timespec i_atime; | 605 | struct timespec64 i_atime; |
606 | struct timespec i_mtime; | 606 | struct timespec64 i_mtime; |
607 | struct timespec i_ctime; | 607 | struct timespec64 i_ctime; |
608 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ | 608 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ |
609 | unsigned short i_bytes; | 609 | unsigned short i_bytes; |
610 | unsigned int i_blkbits; | 610 | unsigned int i_blkbits; |
@@ -1091,7 +1091,7 @@ extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct | |||
1091 | extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl); | 1091 | extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl); |
1092 | extern int locks_lock_inode_wait(struct inode *inode, struct file_lock *fl); | 1092 | extern int locks_lock_inode_wait(struct inode *inode, struct file_lock *fl); |
1093 | extern int __break_lease(struct inode *inode, unsigned int flags, unsigned int type); | 1093 | extern int __break_lease(struct inode *inode, unsigned int flags, unsigned int type); |
1094 | extern void lease_get_mtime(struct inode *, struct timespec *time); | 1094 | extern void lease_get_mtime(struct inode *, struct timespec64 *time); |
1095 | extern int generic_setlease(struct file *, long, struct file_lock **, void **priv); | 1095 | extern int generic_setlease(struct file *, long, struct file_lock **, void **priv); |
1096 | extern int vfs_setlease(struct file *, long, struct file_lock **, void **); | 1096 | extern int vfs_setlease(struct file *, long, struct file_lock **, void **); |
1097 | extern int lease_modify(struct file_lock *, int, struct list_head *); | 1097 | extern int lease_modify(struct file_lock *, int, struct list_head *); |
@@ -1206,7 +1206,8 @@ static inline int __break_lease(struct inode *inode, unsigned int mode, unsigned | |||
1206 | return 0; | 1206 | return 0; |
1207 | } | 1207 | } |
1208 | 1208 | ||
1209 | static inline void lease_get_mtime(struct inode *inode, struct timespec *time) | 1209 | static inline void lease_get_mtime(struct inode *inode, |
1210 | struct timespec64 *time) | ||
1210 | { | 1211 | { |
1211 | return; | 1212 | return; |
1212 | } | 1213 | } |
@@ -1477,7 +1478,7 @@ static inline void i_gid_write(struct inode *inode, gid_t gid) | |||
1477 | } | 1478 | } |
1478 | 1479 | ||
1479 | extern struct timespec64 timespec64_trunc(struct timespec64 t, unsigned gran); | 1480 | extern struct timespec64 timespec64_trunc(struct timespec64 t, unsigned gran); |
1480 | extern struct timespec current_time(struct inode *inode); | 1481 | extern struct timespec64 current_time(struct inode *inode); |
1481 | 1482 | ||
1482 | /* | 1483 | /* |
1483 | * Snapshotting support. | 1484 | * Snapshotting support. |
@@ -1765,7 +1766,7 @@ struct inode_operations { | |||
1765 | ssize_t (*listxattr) (struct dentry *, char *, size_t); | 1766 | ssize_t (*listxattr) (struct dentry *, char *, size_t); |
1766 | int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, | 1767 | int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, |
1767 | u64 len); | 1768 | u64 len); |
1768 | int (*update_time)(struct inode *, struct timespec *, int); | 1769 | int (*update_time)(struct inode *, struct timespec64 *, int); |
1769 | int (*atomic_open)(struct inode *, struct dentry *, | 1770 | int (*atomic_open)(struct inode *, struct dentry *, |
1770 | struct file *, unsigned open_flag, | 1771 | struct file *, unsigned open_flag, |
1771 | umode_t create_mode, int *opened); | 1772 | umode_t create_mode, int *opened); |
@@ -2199,7 +2200,7 @@ extern int current_umask(void); | |||
2199 | 2200 | ||
2200 | extern void ihold(struct inode * inode); | 2201 | extern void ihold(struct inode * inode); |
2201 | extern void iput(struct inode *); | 2202 | extern void iput(struct inode *); |
2202 | extern int generic_update_time(struct inode *, struct timespec *, int); | 2203 | extern int generic_update_time(struct inode *, struct timespec64 *, int); |
2203 | 2204 | ||
2204 | /* /sys/fs */ | 2205 | /* /sys/fs */ |
2205 | extern struct kobject *fs_kobj; | 2206 | extern struct kobject *fs_kobj; |
diff --git a/include/linux/stat.h b/include/linux/stat.h index 22484e44544d..765573dc17d6 100644 --- a/include/linux/stat.h +++ b/include/linux/stat.h | |||
@@ -41,10 +41,10 @@ struct kstat { | |||
41 | kuid_t uid; | 41 | kuid_t uid; |
42 | kgid_t gid; | 42 | kgid_t gid; |
43 | loff_t size; | 43 | loff_t size; |
44 | struct timespec atime; | 44 | struct timespec64 atime; |
45 | struct timespec mtime; | 45 | struct timespec64 mtime; |
46 | struct timespec ctime; | 46 | struct timespec64 ctime; |
47 | struct timespec btime; /* File creation time */ | 47 | struct timespec64 btime; /* File creation time */ |
48 | u64 blocks; | 48 | u64 blocks; |
49 | }; | 49 | }; |
50 | 50 | ||