Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934472AbcCKHab (ORCPT ); Fri, 11 Mar 2016 02:30:31 -0500 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:56992 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933960AbcCKH3t (ORCPT ); Fri, 11 Mar 2016 02:29:49 -0500 X-Original-SENDERIP: 156.147.1.121 X-Original-MAILFROM: minchan@kernel.org X-Original-SENDERIP: 10.177.223.161 X-Original-MAILFROM: minchan@kernel.org From: Minchan Kim To: Andrew Morton Cc: 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 , Minchan Kim Subject: [PATCH v1 03/19] fs/anon_inodes: new interface to create new inode Date: Fri, 11 Mar 2016 16:30:07 +0900 Message-Id: <1457681423-26664-4-git-send-email-minchan@kernel.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1457681423-26664-1-git-send-email-minchan@kernel.org> References: <1457681423-26664-1-git-send-email-minchan@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1495 Lines: 46 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. Acked-by: Rafael Aquini Signed-off-by: Gioh Kim Signed-off-by: Minchan Kim --- fs/anon_inodes.c | 6 ++++++ include/linux/anon_inodes.h | 1 + 2 files changed, 7 insertions(+) diff --git a/fs/anon_inodes.c b/fs/anon_inodes.c index 80ef38c73e5a..1d51f96acdd9 100644 --- a/fs/anon_inodes.c +++ b/fs/anon_inodes.c @@ -162,6 +162,12 @@ int anon_inode_getfd(const char *name, const struct file_operations *fops, } EXPORT_SYMBOL_GPL(anon_inode_getfd); +struct inode *anon_inode_new(void) +{ + return alloc_anon_inode(anon_inode_mnt->mnt_sb); +} +EXPORT_SYMBOL_GPL(anon_inode_new); + static int __init anon_inode_init(void) { anon_inode_mnt = kern_mount(&anon_inode_fs_type); diff --git a/include/linux/anon_inodes.h b/include/linux/anon_inodes.h index 8013a45242fe..ddbd67f8a73f 100644 --- a/include/linux/anon_inodes.h +++ b/include/linux/anon_inodes.h @@ -15,6 +15,7 @@ struct file *anon_inode_getfile(const char *name, void *priv, int flags); int anon_inode_getfd(const char *name, const struct file_operations *fops, void *priv, int flags); +struct inode *anon_inode_new(void); #endif /* _LINUX_ANON_INODES_H */ -- 1.9.1