From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B364FC54FCB for ; Mon, 20 Apr 2020 14:28:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7891D206DD for ; Mon, 20 Apr 2020 14:28:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="LnzLHOGL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7891D206DD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E19828E0005; Mon, 20 Apr 2020 10:28:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DEFB88E0003; Mon, 20 Apr 2020 10:28:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CDE6A8E0005; Mon, 20 Apr 2020 10:28:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0074.hostedemail.com [216.40.44.74]) by kanga.kvack.org (Postfix) with ESMTP id B6D338E0003 for ; Mon, 20 Apr 2020 10:28:46 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 7B8EB180ACF62 for ; Mon, 20 Apr 2020 14:28:46 +0000 (UTC) X-FDA: 76728464652.26.shade93_86bff464b4b54 X-HE-Tag: shade93_86bff464b4b54 X-Filterd-Recvd-Size: 6121 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf10.hostedemail.com (Postfix) with ESMTP for ; Mon, 20 Apr 2020 14:28:45 +0000 (UTC) Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E7A96205C9; Mon, 20 Apr 2020 14:28:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587392924; bh=Xfhmbt3oILrMnmMSAOk0kNM8XdFhuXm9MUCUSzShG8g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LnzLHOGL3SfYzz4pLofCJ1ROQjqVMmfWQwIeMijgCZdRKOiLZgnrpkFWugSMer61U SUy1vwyCeMyLufrPfYFn9wMKcSES/m+B4D/DjqcEiwhebOFIg8iwdCJThhBrgF45My mDtP1iFIfm+kWnwF33LB3q5mplaFnA9YYIC790Wo= Date: Mon, 20 Apr 2020 16:28:42 +0200 From: Greg Kroah-Hartman To: Emanuele Giuseppe Esposito Cc: linux-nfs@vger.kernel.org, Paolo Bonzini , Jeremy Kerr , Arnd Bergmann , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Dennis Dalessandro , Mike Marciniszyn , Doug Ledford , Jason Gunthorpe , Frederic Barrat , Andrew Donnellan , Robert Richter , "Manoj N. Kumar" , "Matthew R. Ochs" , Uma Krishnan , "James E.J. Bottomley" , "Martin K. Petersen" , Felipe Balbi , Alexander Viro , Ian Kent , Joel Becker , Christoph Hellwig , "Rafael J. Wysocki" , Matthew Garrett , Ard Biesheuvel , Miklos Szeredi , Mike Kravetz , Mark Fasheh , Joseph Qi , Alexey Dobriyan , Luis Chamberlain , Kees Cook , Iurii Zaikin , Anton Vorontsov , Colin Cross , Tony Luck , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , John Fastabend , KP Singh , Hugh Dickins , Andrew Morton , "J. Bruce Fields" , Chuck Lever , Trond Myklebust , Anna Schumaker , "David S. Miller" , Jakub Kicinski , James Morris , "Serge E. Hallyn" , John Johansen , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-rdma@vger.kernel.org, oprofile-list@lists.sf.net, linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org, linux-fsdevel@vger.kernel.org, autofs@vger.kernel.org, linux-efi@vger.kernel.org, linux-mm@kvack.org, ocfs2-devel@oss.oracle.com, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-security-module@vger.kernel.org Subject: Re: [PATCH 6/8] simplefs: add file creation functions Message-ID: <20200420142842.GA4125486@kroah.com> References: <20200414124304.4470-1-eesposit@redhat.com> <20200414124304.4470-7-eesposit@redhat.com> <20200414125626.GC720679@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Apr 20, 2020 at 03:57:48PM +0200, Emanuele Giuseppe Esposito wrote: > > > On 4/14/20 2:56 PM, Greg Kroah-Hartman wrote: > > On Tue, Apr 14, 2020 at 02:43:00PM +0200, Emanuele Giuseppe Esposito wrote: > > > A bunch of code is duplicated between debugfs and tracefs, unify it to the > > > simplefs library. > > > > > > The code is very similar, except that dentry and inode creation are unified > > > into a single function (unlike start_creating in debugfs and tracefs, which > > > only takes care of dentries). This adds an output parameter to the creation > > > functions, but pushes all error recovery into fs/simplefs.c. > > > > > > Signed-off-by: Emanuele Giuseppe Esposito > > > --- > > > fs/simplefs.c | 150 +++++++++++++++++++++++++++++++++++++++ > > > include/linux/simplefs.h | 19 +++++ > > > 2 files changed, 169 insertions(+) > > > > What's wrong with libfs, isn't that supposed to be for these types of > > "common" filesystem interactions? > > > > Why create a whole "new" fs for this? > > I assume you meant a new file. These new functions are used only by a few > filesystems, and I didn't want to include them in vmlinux unconditionally, > so I introduced simplefs.c and CONFIG_SIMPLEFS instead of extending libfs.c. > In this way only fs that need this code like debugfs and tracefs will load > it. Nothing "loads it", why not just make these libfs functions instead? As the difference between the two is not obvious at all, please don't make things confusing. thanks, greg k-h