xfs
[Top] [All Lists]

Re: [RFC 11/32] xfs: convert to struct inode_time

To: "Theodore Ts'o" <tytso@xxxxxxx>, Chuck Lever <chuck.lever@xxxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, Nicolas Pitre <nicolas.pitre@xxxxxxxxxx>, Dave Chinner <david@xxxxxxxxxxxxx>, LKML Kernel <linux-kernel@xxxxxxxxxxxxxxx>, linux-arch@xxxxxxxxxxxxxxx, joseph@xxxxxxxxxxxxxxxx, john.stultz@xxxxxxxxxx, Christoph Hellwig <hch@xxxxxxxxxxxxx>, tglx@xxxxxxxxxxxxx, geert@xxxxxxxxxxxxxx, lftan@xxxxxxxxxx, linux-fsdevel <linux-fsdevel@xxxxxxxxxxxxxxx>, xfs@xxxxxxxxxxx, Linux NFS Mailing List <linux-nfs@xxxxxxxxxxxxxxx>
Subject: Re: [RFC 11/32] xfs: convert to struct inode_time
From: "H. Peter Anvin" <hpa@xxxxxxxxx>
Date: Mon, 02 Jun 2014 10:12:37 -0700
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20140602153124.GH30598@xxxxxxxxx>
References: <1401480116-1973111-1-git-send-email-arnd@xxxxxxxx> <8618458.1EVJCoVbkH@wuerfel> <alpine.LFD.2.11.1406012121430.17310@xxxxxxxxxxx> <4178301.j9kWdGCRLC@wuerfel> <6868F108-F0B2-423F-AE31-90DF86A5B7DD@xxxxxxxxxx> <20140602153124.GH30598@xxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0
On 06/02/2014 08:31 AM, Theodore Ts'o wrote:
> 
> I wonder if it would make sense to try to promulgate via the Austin
> group, and possibly the C standards committee the concept of a bit
> pattern (that might commonly be INT_MAX or UINT_MAX) that means "time
> unknown", or "time indefinite" or "we couldn't encode the time".
> 

(time_t)-1 already has this meaning for some calls (e.g. time(2)).
However, this also means Wed Dec 31 23:59:59 UTC 1969, and unfortunately
something similar applies to all possible bit patterns, certainly within
the range of an int.

> We would then teach gmtime(3) and asctime(3) to print some appropriate
> message, and we could teach programs like find (with the -mtime)
> option, make, tmpwatch, et. al., that they can't make any presumption
> about the comparibility of any timestamp which has a value of
> TIME_UNDEFINIED.
> 
> It would be problematic for time(2) or gettimeofday(2) to return
> TIME_UNDEFINED, since there are programs that care about time ticking
> forward, but I could imagine a new interface which would be permitted
> to return a flag indicating that we don't know the current time
> (because the CMOS battery had run down, etc.) so instead we're going
> to be counting the number of seconds since the system was booted.

This assumes that we actually know that that is the case, which may be
an aggressive assumption.

        -hpa


<Prev in Thread] Current Thread [Next in Thread>