mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Linux 5.6 compat: timestamp_truncate()
The timestamp_truncate() function was added, it replaces the existing timespec64_trunc() function. This change renames our wrapper function to be consistent with the upstream name and updates the compatibility code for older kernels accordingly. Reviewed-by: Tony Hutter <hutter2@llnl.gov> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #9956 Closes #9961
This commit is contained in:
@@ -3444,8 +3444,8 @@ top:
|
||||
|
||||
if (mask & (ATTR_MTIME | ATTR_SIZE)) {
|
||||
ZFS_TIME_ENCODE(&vap->va_mtime, mtime);
|
||||
ZTOI(zp)->i_mtime = zpl_inode_timespec_trunc(vap->va_mtime,
|
||||
ZTOI(zp)->i_sb->s_time_gran);
|
||||
ZTOI(zp)->i_mtime = zpl_inode_timestamp_truncate(
|
||||
vap->va_mtime, ZTOI(zp));
|
||||
|
||||
SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_MTIME(zfsvfs), NULL,
|
||||
mtime, sizeof (mtime));
|
||||
@@ -3453,8 +3453,8 @@ top:
|
||||
|
||||
if (mask & (ATTR_CTIME | ATTR_SIZE)) {
|
||||
ZFS_TIME_ENCODE(&vap->va_ctime, ctime);
|
||||
ZTOI(zp)->i_ctime = zpl_inode_timespec_trunc(vap->va_ctime,
|
||||
ZTOI(zp)->i_sb->s_time_gran);
|
||||
ZTOI(zp)->i_ctime = zpl_inode_timestamp_truncate(vap->va_ctime,
|
||||
ZTOI(zp));
|
||||
SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_CTIME(zfsvfs), NULL,
|
||||
ctime, sizeof (ctime));
|
||||
}
|
||||
|
||||
@@ -382,10 +382,8 @@ zpl_setattr(struct dentry *dentry, struct iattr *ia)
|
||||
vap->va_mtime = ia->ia_mtime;
|
||||
vap->va_ctime = ia->ia_ctime;
|
||||
|
||||
if (vap->va_mask & ATTR_ATIME) {
|
||||
ip->i_atime = zpl_inode_timespec_trunc(ia->ia_atime,
|
||||
ip->i_sb->s_time_gran);
|
||||
}
|
||||
if (vap->va_mask & ATTR_ATIME)
|
||||
ip->i_atime = zpl_inode_timestamp_truncate(ia->ia_atime, ip);
|
||||
|
||||
cookie = spl_fstrans_mark();
|
||||
error = -zfs_setattr(ITOZ(ip), vap, 0, cr);
|
||||
|
||||
Reference in New Issue
Block a user