From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754585AbaAGW2I (ORCPT ); Tue, 7 Jan 2014 17:28:08 -0500 Received: from imap.thunk.org ([74.207.234.97]:46713 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753493AbaAGW2E (ORCPT ); Tue, 7 Jan 2014 17:28:04 -0500 Date: Tue, 7 Jan 2014 17:27:39 -0500 From: "Theodore Ts'o" To: "Darrick J. Wong" Cc: Christoph Hellwig , Jan Kara , Aurelien Jarno , Alexander Viro , Rob Browning , Dave Chinner , Miklos Szeredi , linux-fsdevel , linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org Subject: Re: [RFC PATCH] fs: xattr-based FS_IOC_[GS]ETFLAGS interface Message-ID: <20140107222739.GA22610@thunk.org> Mail-Followup-To: Theodore Ts'o , "Darrick J. Wong" , Christoph Hellwig , Jan Kara , Aurelien Jarno , Alexander Viro , Rob Browning , Dave Chinner , Miklos Szeredi , linux-fsdevel , linux-kernel@vger.kernel.org, linux-ext4@vger.kernel.org References: <20140107025855.GA9229@birch.djwong.org> <20140107124831.GD16640@quack.suse.cz> <20140107154935.GA17609@infradead.org> <20140107170430.GA2822@thunk.org> <20140107194356.GC9229@birch.djwong.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140107194356.GC9229@birch.djwong.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 07, 2014 at 11:43:56AM -0800, Darrick J. Wong wrote: > I had thought of indexed inode flags as an alternative to the xattr/string > parsing thing. Feature flags make their first appearance as part of a per-FS > flag-space and are migrated to the common flag-space when there is demand. > It would also avoid the need for each fs to create its own flag ioctl. > > On the other hand, someone suggested I try remaking IOC_[GS]ETFLAG as an xattr, > so off I went. :) > > #define FS_IOC_FLAGS_COMMON 0 > #define FS_IOC_FLAGS_COMMON2 1 > #define FS_IOC_FLAGS_EXT4 0xEF53 > > struct inode_flag_ioctl { > u32 flag; > u32 value; /* or u64? */ > }; > #define FS_IOC_GETFLAGS2 _IOR('f', 12, struct inode_flag_ioctl); > #define FS_IOC_SETFLAGS2 _IOW('f', 13, struct inode_flag_ioctl); Is having this structure and demultiplexing based on inode_flag_ioctl.flag really worth it? I'd just simply introduce two new ioctl's for generic flags: FS_IOC_COMMON_[GS]ETFLAGS, and then two new ioctl's for each file system: FS_IOC_EXT4_[GS]ETFLAGS, FS_IOC_BTRFS_[GS]ETFLAGS, etc. Is this uglier or pretier than using strings? Eh.... six of one, half dozen of the other. I think it's mostly a matter of personal taste. - Ted