fs: nfs: get rid of memcpys for inode times
Subsequent patches in the series convert inode timestamps to use struct timespec64 instead of struct timespec as part of solving the y2038 problem. This will lead to type mismatch for memcpys. Use regular assignments instead. Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com> Cc: trond.myklebust@primarydata.com
This commit is contained in:
parent
13442b036a
commit
0a2dfbecb3
|
@ -1315,13 +1315,13 @@ static void nfs_wcc_update_inode(struct inode *inode, struct nfs_fattr *fattr)
|
|||
if ((fattr->valid & NFS_ATTR_FATTR_PRECTIME)
|
||||
&& (fattr->valid & NFS_ATTR_FATTR_CTIME)
|
||||
&& timespec_equal(&inode->i_ctime, &fattr->pre_ctime)) {
|
||||
memcpy(&inode->i_ctime, &fattr->ctime, sizeof(inode->i_ctime));
|
||||
inode->i_ctime = fattr->ctime;
|
||||
}
|
||||
|
||||
if ((fattr->valid & NFS_ATTR_FATTR_PREMTIME)
|
||||
&& (fattr->valid & NFS_ATTR_FATTR_MTIME)
|
||||
&& timespec_equal(&inode->i_mtime, &fattr->pre_mtime)) {
|
||||
memcpy(&inode->i_mtime, &fattr->mtime, sizeof(inode->i_mtime));
|
||||
inode->i_mtime = fattr->mtime;
|
||||
if (S_ISDIR(inode->i_mode))
|
||||
nfs_set_cache_invalid(inode, NFS_INO_INVALID_DATA);
|
||||
}
|
||||
|
@ -1667,12 +1667,12 @@ int nfs_post_op_update_inode_force_wcc_locked(struct inode *inode, struct nfs_fa
|
|||
}
|
||||
if ((fattr->valid & NFS_ATTR_FATTR_CTIME) != 0 &&
|
||||
(fattr->valid & NFS_ATTR_FATTR_PRECTIME) == 0) {
|
||||
memcpy(&fattr->pre_ctime, &inode->i_ctime, sizeof(fattr->pre_ctime));
|
||||
fattr->pre_ctime = inode->i_ctime;
|
||||
fattr->valid |= NFS_ATTR_FATTR_PRECTIME;
|
||||
}
|
||||
if ((fattr->valid & NFS_ATTR_FATTR_MTIME) != 0 &&
|
||||
(fattr->valid & NFS_ATTR_FATTR_PREMTIME) == 0) {
|
||||
memcpy(&fattr->pre_mtime, &inode->i_mtime, sizeof(fattr->pre_mtime));
|
||||
fattr->pre_mtime = inode->i_mtime;
|
||||
fattr->valid |= NFS_ATTR_FATTR_PREMTIME;
|
||||
}
|
||||
if ((fattr->valid & NFS_ATTR_FATTR_SIZE) != 0 &&
|
||||
|
@ -1829,7 +1829,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
|
|||
}
|
||||
|
||||
if (fattr->valid & NFS_ATTR_FATTR_MTIME) {
|
||||
memcpy(&inode->i_mtime, &fattr->mtime, sizeof(inode->i_mtime));
|
||||
inode->i_mtime = fattr->mtime;
|
||||
} else if (server->caps & NFS_CAP_MTIME) {
|
||||
nfsi->cache_validity |= save_cache_validity &
|
||||
(NFS_INO_INVALID_MTIME
|
||||
|
@ -1838,7 +1838,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
|
|||
}
|
||||
|
||||
if (fattr->valid & NFS_ATTR_FATTR_CTIME) {
|
||||
memcpy(&inode->i_ctime, &fattr->ctime, sizeof(inode->i_ctime));
|
||||
inode->i_ctime = fattr->ctime;
|
||||
} else if (server->caps & NFS_CAP_CTIME) {
|
||||
nfsi->cache_validity |= save_cache_validity &
|
||||
(NFS_INO_INVALID_CTIME
|
||||
|
@ -1875,7 +1875,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
|
|||
|
||||
|
||||
if (fattr->valid & NFS_ATTR_FATTR_ATIME)
|
||||
memcpy(&inode->i_atime, &fattr->atime, sizeof(inode->i_atime));
|
||||
inode->i_atime = fattr->atime;
|
||||
else if (server->caps & NFS_CAP_ATIME) {
|
||||
nfsi->cache_validity |= save_cache_validity &
|
||||
(NFS_INO_INVALID_ATIME
|
||||
|
|
Loading…
Reference in New Issue