Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756053AbcKVNzQ (ORCPT ); Tue, 22 Nov 2016 08:55:16 -0500 Received: from mail-qk0-f174.google.com ([209.85.220.174]:36224 "EHLO mail-qk0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755131AbcKVNzP (ORCPT ); Tue, 22 Nov 2016 08:55:15 -0500 Message-ID: <1479822911.2492.4.camel@redhat.com> Subject: Re: [PATCH 1/4] statx: Add a system call to make enhanced file info available From: Jeff Layton To: David Howells , Dave Chinner Cc: Andreas Dilger , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 22 Nov 2016 08:55:11 -0500 In-Reply-To: <9047.1479811169@warthog.procyon.org.uk> References: <20161119224331.GE31101@dastard> <20161118220744.GC31101@dastard> <147938969703.13574.10295364502230379833.stgit@warthog.procyon.org.uk> <147938970382.13574.11581172952175034619.stgit@warthog.procyon.org.uk> <20161117234047.GE28177@dastard> <11317.1479509642@warthog.procyon.org.uk> <9047.1479811169@warthog.procyon.org.uk> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1240 Lines: 32 On Tue, 2016-11-22 at 10:39 +0000, David Howells wrote: > Dave Chinner wrote: > > > > > No. Just provide a 64 bit high resoultion field, and define it to > > contain nanoseconds. When we need higher resolution to be exported > > to userspace, we use a /feature flag/ to indicate that is contains > > something like attoseconds or the like. > > That sounds suspiciously like a bad idea - if you're talking about a flag with > a currently undefined meaning that the kernel can inflict on userspace without > warning to change the meaning of the nanoseconds field to something we haven't > defined yet. > > Userspace would have to ask for it. > Agreed. I think the best thing would be to simply plan to add new femtoseconds fields in the struct if/when it becomes needed. We can easily hide the ugliness of the fields not being adjacent to the rest of the timestamp behind the femtosecond resolution glibc API that will also be needed. If we're worried about space utilization, then let's pad the struct out by 4 extra 32-bit fields in advance of that. Again, a major design point of statx is that it is to be extendable. I don't see any reason that we need to do this now. -- Jeff Layton