Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754943Ab0F3KBe (ORCPT ); Wed, 30 Jun 2010 06:01:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60580 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751569Ab0F3KBd (ORCPT ); Wed, 30 Jun 2010 06:01:33 -0400 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <201006301131.37241.arnd@arndb.de> References: <201006301131.37241.arnd@arndb.de> <201006301030.52235.arnd@arndb.de> <20100630011712.18960.3723.stgit@warthog.procyon.org.uk> <25470.1277888151@redhat.com> To: Arnd Bergmann Cc: dhowells@redhat.com, viro@zeniv.linux.org.uk, smfrench@gmail.com, jlayton@redhat.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 3/3] Add a pair of system calls to make extended file stats available [ver #2] Date: Wed, 30 Jun 2010 11:01:08 +0100 Message-ID: <29346.1277892068@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1691 Lines: 38 Arnd Bergmann wrote: > It also makes things like strace more complicated. That's the most compelling argument. > No, I think that would be worse than the current version. But if you remove > the structure version in favor of the flags, you only need six arguments > anyway. I want to keep the structure version, just in case we need to expand fields in the stat struct in future. Otherwise we may need to create yet another stat syscall. > You can also go further and fold the structure length into flags, because > the length is just a function of the data you are passing. The potential problem with passing the flags as a syscall argument is that we're then limited to a single 32-bit integer. It might be enough, but if I do as at least one person has suggested and assign each field in the struct its own bit, that uses up half right there, plus I'd like to add at least one operational flag (to force synchronisation with the server). > Having a system call with flags, size and version is like wearing a belt, > braces and suspenders. An unsigned long flags argument should be enough to > hold up your pants[1]. I would like the size argument for two reasons: firstly, to prevent buffer overruns and, secondly, because I can see some scope for variable-size fields (such as for volume IDs or security labels), though the latter might be better handled through getxattr() (which would mean extra overhead). David -- 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/