On Fri, Dec 05, 2014 at 03:28:58PM -0800, Robert White wrote:
> Ah...
> 
> I've been thinking "ctime" is/was (still) "create time". It seems
> that somewhere in the last couple decades it became "change time";
> Or that I picked up that incorrect "create time" idea back in the
> UNIX Sys V R 3 days and just never had cause to think about it
> again...

v7 is the point where the third timestamp has first appeared (v6 has
only two - access and update).  And their stat(2) says this:
       st_atime is the file was last read.  For reasons of efficiency,  it  is
       not set when a directory is searched, although this would be more logi‐
       cal.  st_mtime is the time the file was last written or created.  It is
       not  set  by changes of owner, group, link count, or mode.  st_ctime is
       set both both by writing and changing the i-node.

FWIW, their /usr/sys/sys/sys4.c has
chmod()
{
        register struct inode *ip;
        register struct a {
                char    *fname;
                int     fmode;
        } *uap;

        uap = (struct a *)u.u_ap;
        if ((ip = owner()) == NULL)
                return;
        ip->i_mode &= ~07777;
        if (u.u_uid)
                uap->fmode &= ~ISVTX;
        ip->i_mode |= uap->fmode&07777;
        ip->i_flag |= ICHG;
        if (ip->i_flag&ITEXT && (ip->i_mode&ISVTX)==0)
                xrele(ip);
        iput(ip);
}
and /usr/sys/sys/iget.c has, in the end of iupdat() (called on the final
iput(), as well as on stat(2) and several other paths), this:
                if(ip->i_flag&IACC)
                        dp->di_atime = *ta;
                if(ip->i_flag&IUPD)
                        dp->di_mtime = *tm;
                if(ip->i_flag&ICHG)
                        dp->di_ctime = time;
                ip->i_flag &= ~(IUPD|IACC|ICHG);
(ta and tm are both equal to &time in that call chain).  IOW, chmod(2)
definitely sets ctime.

IOW, ctime has never been "create time"; it's "change time" and it had been
that way since its introduction.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to