From: Emanuele Giuseppe Esposito Subject: Re: [PATCH 6/8] simplefs: add file creation functions Date: Mon, 20 Apr 2020 15:57:48 +0200 Message-ID: References: <20200414124304.4470-1-eesposit@redhat.com> <20200414124304.4470-7-eesposit@redhat.com> <20200414125626.GC720679@kroah.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:References:Cc:To:Subject:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=pK26z2Uz8J+xMXGm08XY3fCeYfVumTWEKpq3I9uMJ70=; b=CJNYEC1Q+DhqkW7uwKg7x6/CKS sfQiuCcGEb4rfBeaL6PWOWIopZkluklzkDEDMq1c4/mNf7eH6bzDxnmHyFEnbQSbZh6yAMzsaDXlh Lir9OSvWwV6R+pvwwctD4JBz+mR58/40b6GVGaO9nS8Z7wuG2lU7LgPm/f3GbqHjLa74=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:References:Cc:To:Subject:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=pK26z2Uz8J+xMXGm08XY3fCeYfVumTWEKpq3I9uMJ70=; b=IpNgF2oUJCzIOccyOchOjGfGI8 YIxNI93OOKwRQ4p4A51ZRj6P02RJCNon3Enm2j9kBSRLnGCBnks+Jo5Tsj1sKvoycTVZOiinUJ+O7 JNdiHvs0kbyM2ZoV7b1AL85exicb2DCEmEfnXRMQEuAQDFq06RP8Je1kVYCFnVrogRjg=; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587391076; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pK26z2Uz8J+xMXGm08XY3fCeYfVumTWEKpq3I9uMJ70=; b=JBeBupR2hI6+yPH2Jr9g+YknQbpgbnCv1v3pgHYKCX5jxVmhwOeJeXfoNscz03zlTY5JBe p2Kfp7etIPFA2k2wP3aoJIy1xhhLs7Qc/+KcpvVdx+gJIVV3Od3gbg+HSCrLR8AVcsQ5Zs BFebMb+Romn4HGK1c81Jx2O3JxmWMog= In-Reply-To: <20200414125626.GC720679@kroah.com> Content-Language: en-US List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: oprofile-list-bounces@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Greg Kroah-Hartman Cc: Song Liu , linux-usb@vger.kernel.org, bpf@vger.kernel.org, "Rafael J. Wysocki" , David Airlie , Benjamin Herrenschmidt , 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 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. Thank you, Emanuele