Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756128Ab0F3OGM (ORCPT ); Wed, 30 Jun 2010 10:06:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:9276 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753817Ab0F3OGJ (ORCPT ); Wed, 30 Jun 2010 10:06:09 -0400 Date: Wed, 30 Jun 2010 10:05:53 -0400 From: Jeff Layton To: Arnd Bergmann Cc: Christoph Hellwig , David Howells , Andreas Dilger , viro@zeniv.linux.org.uk, smfrench@gmail.com, mcao@us.ibm.com, aneesh.kumar@linux.vnet.ibm.com, linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, samba-technical@lists.samba.org, sjayaraman@suse.de, linux-ext4@vger.kernel.org Subject: Re: [PATCH 0/3] Extended file stat functions [ver #2] Message-ID: <20100630100553.707785c7@tlielax.poochiereds.net> In-Reply-To: <201006301531.39365.arnd@arndb.de> References: <52423201-3DF9-4045-8E8B-FAA915053D56@dilger.ca> <26505.1277899544@redhat.com> <20100630121127.GA22713@infradead.org> <201006301531.39365.arnd@arndb.de> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1911 Lines: 43 On Wed, 30 Jun 2010 15:31:39 +0200 Arnd Bergmann wrote: > On Wednesday 30 June 2010, Christoph Hellwig wrote: > > The cost of adding a syscall is much smaller > > Ack. No need for different struct layout version since we > can add another stat syscall every ten years. > > > So adding a few fields of padding at the end for new members is fine, > > but doing overkill of versioning including queries for supported > > versions doesn't. > > The ability to request and return a subset of the fields seems useful > regardless and it can be used to avoid the need for this kind of padding. > A sufficient amount of padding wouldn't be too bad either, but I guess > we should not have both the padding _and_ the option for extending the > structure after the padding. > > With the padding, the 'size' argument can go away, though I'd argue that > even without the padding we can safely add extra fixed-length fields > when needed and not need a size argument. > Simply having a flags field seems sufficient to me too. I don't think we need padding, version or a size. Just make it a "rule" that if you add a new field that it has to go at the end of the struct and a new flag has to go with it. The kernel will need to only fill out fields that are requested and that it knows about. In the event that we approach running out of flags, we could even use the last flag as a "HAS_FLAGS2" flag, to add a new flags field at the end. Ugly, but it would avoid the need for a new syscall. We can kick that potential problem down the road though. With 64 flags to play with, it likely won't be a problem for a while. -- Jeff Layton -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/