Re: [RFC] [PATCH] ext3 nanosecond timestamps
Andreas Dilger <[email protected]>
| Newsgroups | gmane.comp.file-systems.ext2.devel |
|---|---|
| Message-ID | <[email protected]> |
On Jun 22, 2006 13:27 +0200, Johann Lombardi wrote: > > __le16 i_extra_isize; > > __le16 i_pad1; > > + __le32 i_ctime_extra; /* extra Change time (nsec << 2 | epoch) */ > > + __le32 i_mtime_extra; /* extra Modification time(nsec << 2 | epoch) */ > > + __le32 i_atime_extra; /* extra Access time (nsec << 2 | epoch) */ > > + __le32 i_extra_reserved1; > [...] > > + if (offsetof(typeof(*raw_inode), extra_xtime) - \ > > + offsetof(typeof(*raw_inode), i_extra_isize) + \ > > + sizeof((raw_inode)->extra_xtime) <= (raw_inode)->i_extra_isize) \ > > If there's enough space for i_ctime_extra but not for i_mtime_extra, > ns timestamp will be supported for ctime but not for mtime. True, but in practise this will never happen (at least not with current code where you get all of the space or none). At some future time this patch will probably be enhanced to "recapture" unused space from the EA, and we may not get enough space for all of the fields, which is why i_extra_atime is last. It is mostly just a safety check not to clobber fields beyond the end of i_extra_isize, and this is all compile-time checking that boils down to "if (8 <= i_extra_isize) get/set i_ctime_extra". If and when e2fsck implements the RO_COMPAT_NS_TIMESTAMP then it will guarantee that all inodes have enough space for all extra timestamps, and for new inodes it will ALWAYS reserve space for any fields given in struct ext3_inode. Cheers, Andreas -- Andreas Dilger Principal Software Engineer Cluster File Systems, Inc. Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642