• Andi Kleen's avatar
    [PATCH] nanosecond stat timefields · 5d62665d
    Andi Kleen authored
    stat64 has been changed to return jiffies granuality as nsec in previously
    unused fields. This allows make to make better decisions on when
    to recompile a file. Follows losely the Solaris API.
    
    CURRENT_TIME has been redefined to return struct timespec.  The users
    who don't use it in a inode/attr context have been changed to use a new
    get_seconds() function.  CURRENT_TIME is implemented by an out-of-line
    function.
    
    There is a small performance penalty in this patch.  The previous
    filemap code had an optimization to flush atime only once a second.
    This is currently gone, which will increase flushes a bit.  I believe
    the correct solution if it should be a problem is to have per super
    block fields that give an arbitary atime flush granuality - so that you
    can set it to be only flushed once a hour if you prefer that.  I will
    work on that later in separate patches if the need should arise.
    
    struct inode and the attr struct has been changed to store struct
    timespec instead of time_t for [cma]time.  Not all file systems support
    this granuality, but some like XFS,NFSv3,CIFS,JFS do.  The others will
    currently truncate the nsec part on flushing to disk.  There was some
    discussion on this rounding on l-k previously.  I went for simple
    truncation because there is not much evidence IMHO that the more
    complicated roundings have any advantages.  In practice application will
    be rather unlikely to notice the rounding anyways - they can only see a
    difference when an inode is flush from memory and reloaded in less than
    a second, which is rather unlikely.
    5d62665d
journal.c 112 KB