From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Dilger Subject: Re: Attempt at "stat light" implementation Date: Tue, 07 Apr 2009 11:18:27 -0700 Message-ID: <20090407181827.GV3204@webber.adilger.int> References: <20090407062356.GA1336463@fiona.linuxhacker.ru> <20090407173248.GC31824@shareable.org> <0891A741-6527-4BDE-9F6C-FD8FAA45E2F1@linuxhacker.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7BIT Cc: Jamie Lokier , linux-fsdevel@vger.kernel.org To: Oleg Drokin Return-path: Received: from sca-es-mail-1.Sun.COM ([192.18.43.132]:50786 "EHLO sca-es-mail-1.sun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755814AbZDGSSy (ORCPT ); Tue, 7 Apr 2009 14:18:54 -0400 Received: from fe-sfbay-09.sun.com ([192.18.43.129]) by sca-es-mail-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id n37IId8i015536 for ; Tue, 7 Apr 2009 11:18:39 -0700 (PDT) Content-disposition: inline Received: from conversion-daemon.fe-sfbay-09.sun.com by fe-sfbay-09.sun.com (Sun Java(tm) System Messaging Server 7.0-5.01 64bit (built Feb 19 2009)) id <0KHQ00F00T8TDY00@fe-sfbay-09.sun.com> for linux-fsdevel@vger.kernel.org; Tue, 07 Apr 2009 11:18:39 -0700 (PDT) In-reply-to: <0891A741-6527-4BDE-9F6C-FD8FAA45E2F1@linuxhacker.ru> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Apr 07, 2009 13:41 -0400, Oleg Drokin wrote: > On Apr 7, 2009, at 1:32 PM, Jamie Lokier wrote: >> If an "extensible" attribute is not asked for, the kernel must not >> fill in that field of the structure as the app may be not have >> allocated space for it. Or it must use a tag-length-value sort of >> structure for the result, similar to network CMSGs. > > The app allocates struct stat, whatever it is, I presume. There is a > huge benefit to actually reuse existing struct stat, I believe. The point is that if the application is asking for specific fields, it will also have allocated a stat struct that will have room for those fields (sizeof(struct stat) would of course have to match the AT_STAT_* flags that are available to the application). New fields (as opposed to using the reserved fields) would always be added at the end. If some flags are not set then it doesn't matter whether the user struct is large enough because the fields will not be touched. Cheers, Andreas -- Andreas Dilger Sr. Staff Engineer, Lustre Group Sun Microsystems of Canada, Inc.