summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/blocklayout.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2019-06-05 20:17:42 +0200
committerJ. Bruce Fields <bfields@redhat.com>2019-07-03 23:52:09 +0200
commitbdba53687e450dcbae614ba06d0bc8be5e4e34c5 (patch)
tree4d57c69532bb699da8f06e97d53739bd0084cde1 /fs/nfsd/blocklayout.c
parentnfsd: Spelling s/EACCESS/EACCES/ (diff)
downloadlinux-bdba53687e450dcbae614ba06d0bc8be5e4e34c5.tar.xz
linux-bdba53687e450dcbae614ba06d0bc8be5e4e34c5.zip
nfsd: use 64-bit seconds fields in nfsd v4 code
After commit 95582b008388 "vfs: change inode times to use struct timespec64" there are spots in the NFSv4 decoding where we decode the protocol into a struct timeval and then convert that into a timeval64. That's unnecesary in the NFSv4 case since the on-the-wire protocol also uses 64-bit values. So just fix up our code to use timeval64 everywhere. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/blocklayout.c')
-rw-r--r--fs/nfsd/blocklayout.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/nfsd/blocklayout.c b/fs/nfsd/blocklayout.c
index 4fb1f72a25fb..66d4c55eb48e 100644
--- a/fs/nfsd/blocklayout.c
+++ b/fs/nfsd/blocklayout.c
@@ -121,15 +121,13 @@ nfsd4_block_commit_blocks(struct inode *inode, struct nfsd4_layoutcommit *lcp,
{
loff_t new_size = lcp->lc_last_wr + 1;
struct iattr iattr = { .ia_valid = 0 };
- struct timespec ts;
int error;
- ts = timespec64_to_timespec(inode->i_mtime);
if (lcp->lc_mtime.tv_nsec == UTIME_NOW ||
- timespec_compare(&lcp->lc_mtime, &ts) < 0)
- lcp->lc_mtime = timespec64_to_timespec(current_time(inode));
+ timespec64_compare(&lcp->lc_mtime, &inode->i_mtime) < 0)
+ lcp->lc_mtime = current_time(inode);
iattr.ia_valid |= ATTR_ATIME | ATTR_CTIME | ATTR_MTIME;
- iattr.ia_atime = iattr.ia_ctime = iattr.ia_mtime = timespec_to_timespec64(lcp->lc_mtime);
+ iattr.ia_atime = iattr.ia_ctime = iattr.ia_mtime = lcp->lc_mtime;
if (new_size > i_size_read(inode)) {
iattr.ia_valid |= ATTR_SIZE;