jffs2: use 64-bit intermediate timestamps
The VFS now uses timespec64 timestamps consistently, but jffs2 still converts them to 32-bit numbers on the storage medium. As the helper functions for the conversion (get_seconds() and timespec_to_timespec64()) are now deprecated, let's change them over to the more modern replacements. This keeps the traditional interpretation of those values, where the on-disk 32-bit numbers are taken to be negative numbers, i.e. dates before 1970, on 32-bit machines, but future numbers past 2038 on 64-bit machines. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
This commit is contained in:

committed by
Boris Brezillon

parent
39675caa06
commit
c4592b9c37
@@ -146,9 +146,9 @@ int jffs2_do_setattr (struct inode *inode, struct iattr *iattr)
|
||||
return PTR_ERR(new_metadata);
|
||||
}
|
||||
/* It worked. Update the inode */
|
||||
inode->i_atime = timespec_to_timespec64(ITIME(je32_to_cpu(ri->atime)));
|
||||
inode->i_ctime = timespec_to_timespec64(ITIME(je32_to_cpu(ri->ctime)));
|
||||
inode->i_mtime = timespec_to_timespec64(ITIME(je32_to_cpu(ri->mtime)));
|
||||
inode->i_atime = ITIME(je32_to_cpu(ri->atime));
|
||||
inode->i_ctime = ITIME(je32_to_cpu(ri->ctime));
|
||||
inode->i_mtime = ITIME(je32_to_cpu(ri->mtime));
|
||||
inode->i_mode = jemode_to_cpu(ri->mode);
|
||||
i_uid_write(inode, je16_to_cpu(ri->uid));
|
||||
i_gid_write(inode, je16_to_cpu(ri->gid));
|
||||
@@ -280,9 +280,9 @@ struct inode *jffs2_iget(struct super_block *sb, unsigned long ino)
|
||||
i_uid_write(inode, je16_to_cpu(latest_node.uid));
|
||||
i_gid_write(inode, je16_to_cpu(latest_node.gid));
|
||||
inode->i_size = je32_to_cpu(latest_node.isize);
|
||||
inode->i_atime = timespec_to_timespec64(ITIME(je32_to_cpu(latest_node.atime)));
|
||||
inode->i_mtime = timespec_to_timespec64(ITIME(je32_to_cpu(latest_node.mtime)));
|
||||
inode->i_ctime = timespec_to_timespec64(ITIME(je32_to_cpu(latest_node.ctime)));
|
||||
inode->i_atime = ITIME(je32_to_cpu(latest_node.atime));
|
||||
inode->i_mtime = ITIME(je32_to_cpu(latest_node.mtime));
|
||||
inode->i_ctime = ITIME(je32_to_cpu(latest_node.ctime));
|
||||
|
||||
set_nlink(inode, f->inocache->pino_nlink);
|
||||
|
||||
|
Reference in New Issue
Block a user