Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934553AbcCKIFS (ORCPT ); Fri, 11 Mar 2016 03:05:18 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:54792 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934358AbcCKIFO (ORCPT ); Fri, 11 Mar 2016 03:05:14 -0500 Date: Fri, 11 Mar 2016 08:05:03 +0000 From: Al Viro To: Minchan Kim Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, jlayton@poochiereds.net, bfields@fieldses.org, Vlastimil Babka , Joonsoo Kim , koct9i@gmail.com, aquini@redhat.com, virtualization@lists.linux-foundation.org, Mel Gorman , Hugh Dickins , Sergey Senozhatsky , rknize@motorola.com, Rik van Riel , Gioh Kim Subject: Re: [PATCH v1 03/19] fs/anon_inodes: new interface to create new inode Message-ID: <20160311080503.GR17997@ZenIV.linux.org.uk> References: <1457681423-26664-1-git-send-email-minchan@kernel.org> <1457681423-26664-4-git-send-email-minchan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1457681423-26664-4-git-send-email-minchan@kernel.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1329 Lines: 32 On Fri, Mar 11, 2016 at 04:30:07PM +0900, Minchan Kim wrote: > From: Gioh Kim > > The anon_inodes has already complete interfaces to create manage > many anonymous inodes but don't have interface to get > new inode. Other sub-modules can create anonymous inode > without creating and mounting it's own pseudo filesystem. IMO that's a bad idea. In case of aio "creating and mounting" takes this: static struct dentry *aio_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data) { static const struct dentry_operations ops = { .d_dname = simple_dname, }; return mount_pseudo(fs_type, "aio:", NULL, &ops, AIO_RING_MAGIC); } and static struct file_system_type aio_fs = { .name = "aio", .mount = aio_mount, .kill_sb = kill_anon_super, }; aio_mnt = kern_mount(&aio_fs); All of 12 lines. Your export is not much shorter. To quote old mail on the same topic: > Note that anon_inodes.c reason to exist was "it's for situations where > all context lives on struct file and we don't need separate inode for > them". Going from that to "it happens to contain a handy function for inode > allocation"...