summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-01-24 23:24:47 +0000
committerpfg <pfg@FreeBSD.org>2016-01-24 23:24:47 +0000
commitfe5a17c2a729ba27ad4fe2b36f73e1bcefc1a7da (patch)
treef0fffa012784a1b7c0e1bf5649e14b819ce10bee
parent01ec5b07468c4eeb80addcdd5d813cb84fa698ea (diff)
downloadFreeBSD-src-fe5a17c2a729ba27ad4fe2b36f73e1bcefc1a7da.zip
FreeBSD-src-fe5a17c2a729ba27ad4fe2b36f73e1bcefc1a7da.tar.gz
ext2fs: passthrough any extra timestamps to the dinode struct.
In general we don't trust any of the extended timestamps unless the EXT2F_ROCOMPAT_EXTRA_ISIZE feature is set. However, in the case where we freshly allocated a new inode the information is valid and it is better to pass it along instead of leaving the value undefined. This should have no practical effect but should reduce the amount of garbage if EXT2F_ROCOMPAT_EXTRA_ISIZE is set, like in cases where the filesystem is converted from ext3 to ext4. MFC after: 4 days
-rw-r--r--sys/fs/ext2fs/ext2_inode_cnv.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/fs/ext2fs/ext2_inode_cnv.c b/sys/fs/ext2fs/ext2_inode_cnv.c
index d62e9ba..78679cf 100644
--- a/sys/fs/ext2fs/ext2_inode_cnv.c
+++ b/sys/fs/ext2fs/ext2_inode_cnv.c
@@ -149,13 +149,11 @@ ext2_i2ei(struct inode *ip, struct ext2fs_dinode *ei)
ei->e2di_atime = ip->i_atime;
ei->e2di_mtime = ip->i_mtime;
ei->e2di_ctime = ip->i_ctime;
- if (E2DI_HAS_XTIME(ip)) {
- ei->e2di_ctime_extra = NSEC_TO_XTIME(ip->i_ctimensec);
- ei->e2di_mtime_extra = NSEC_TO_XTIME(ip->i_mtimensec);
- ei->e2di_atime_extra = NSEC_TO_XTIME(ip->i_atimensec);
- ei->e2di_crtime = ip->i_birthtime;
- ei->e2di_crtime_extra = NSEC_TO_XTIME(ip->i_birthnsec);
- }
+ ei->e2di_ctime_extra = NSEC_TO_XTIME(ip->i_ctimensec);
+ ei->e2di_mtime_extra = NSEC_TO_XTIME(ip->i_mtimensec);
+ ei->e2di_atime_extra = NSEC_TO_XTIME(ip->i_atimensec);
+ ei->e2di_crtime = ip->i_birthtime;
+ ei->e2di_crtime_extra = NSEC_TO_XTIME(ip->i_birthnsec);
ei->e2di_flags = 0;
ei->e2di_flags |= (ip->i_flags & SF_APPEND) ? EXT2_APPEND: 0;
ei->e2di_flags |= (ip->i_flags & SF_IMMUTABLE) ? EXT2_IMMUTABLE: 0;
OpenPOWER on IntegriCloud