From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg Kroah-Hartman Date: Mon, 20 Apr 2020 16:28:42 +0200 Subject: [Ocfs2-devel] [PATCH 6/8] simplefs: add file creation functions In-Reply-To: References: <20200414124304.4470-1-eesposit@redhat.com> <20200414124304.4470-7-eesposit@redhat.com> <20200414125626.GC720679@kroah.com> Message-ID: <20200420142842.GA4125486@kroah.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Emanuele Giuseppe Esposito Cc: Song Liu , linux-usb@vger.kernel.org, bpf@vger.kernel.org, "Rafael J. Wysocki" , David Airlie , Heiko Carstens , Alexei Starovoitov , dri-devel@lists.freedesktop.org, "J. Bruce Fields" , Joseph Qi , Hugh Dickins , Paul Mackerras , John Johansen , netdev@vger.kernel.org, ocfs2-devel@oss.oracle.com, Christoph Hellwig , Andrew Donnellan , Matthew Garrett , linux-efi@vger.kernel.org, Arnd Bergmann , Daniel Borkmann , Christian Borntraeger , linux-rdma@vger.kernel.org, Michael Ellerman , Mark Fasheh , Anton Vorontsov , John Fastabend , James Morris , Ard Biesheuvel , Jason Gunthorpe , Doug Ledford , oprofile-list@lists.sf.net, Yonghong Song , Ian Kent , Andrii Nakryiko , Alexey Dobriyan , "Serge E. Hallyn" , Robert Richter , Thomas Zimmermann , Vasily Gorbik , Tony Luck , Kees Cook , "James E.J. Bottomley" , autofs@vger.kernel.org, Mike Marciniszyn , linux-fsdevel@vger.kernel.org, "Manoj N. Kumar" , Uma Krishnan , Jakub Kicinski , KP Singh , Trond Myklebust , "Matthew R. Ochs" , "David S. Miller" , Felipe Balbi , linux-nfs@vger.kernel.org, Iurii Zaikin , linux-scsi@vger.kernel.org, "Martin K. Petersen" , linux-mm@kvack.org, linux-s390@vger.kernel.org, Dennis Dalessandro , Miklos Szeredi , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Anna Schumaker , Luis Chamberlain , Chuck Lever , Jeremy Kerr , Colin Cross , Frederic Barrat , Paolo Bonzini , Andrew Morton , Mike Kravetz , linuxppc-dev@lists.ozlabs.org, Martin KaFai Lau , Joel Becker , Alexander Viro 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