From mboxrd@z Thu Jan 1 00:00:00 1970 From: Emanuele Giuseppe Esposito Date: Mon, 20 Apr 2020 15:57:48 +0200 Subject: [Ocfs2-devel] [PATCH 6/8] simplefs: add file creation functions In-Reply-To: <20200414125626.GC720679@kroah.com> References: <20200414124304.4470-1-eesposit@redhat.com> <20200414124304.4470-7-eesposit@redhat.com> <20200414125626.GC720679@kroah.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Greg Kroah-Hartman 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 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 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=-5.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 E1FF5C54FCB for ; Mon, 20 Apr 2020 13:58:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 97FC920724 for ; Mon, 20 Apr 2020 13:58:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="R/JcZkwu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 97FC920724 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 41A6E8E0006; Mon, 20 Apr 2020 09:58:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3C9218E0003; Mon, 20 Apr 2020 09:58:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 290BA8E0006; Mon, 20 Apr 2020 09:58:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0239.hostedemail.com [216.40.44.239]) by kanga.kvack.org (Postfix) with ESMTP id 1216A8E0003 for ; Mon, 20 Apr 2020 09:58:00 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 9EED5181AEF30 for ; Mon, 20 Apr 2020 13:57:59 +0000 (UTC) X-FDA: 76728387078.22.fifth39_b8513f116241 X-HE-Tag: fifth39_b8513f116241 X-Filterd-Recvd-Size: 7819 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Mon, 20 Apr 2020 13:57:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587391078; 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=R/JcZkwu1B4ZzBZFN6dQVIKNfDHLF067dQ/VbM9oDV5t6uYbWvbtuqkJ9oMnkSb3C77v7t 1yPjEZDOHc00VQzqoNntmFnBvFO/HXlT5EDlCGiwLHrNXwGd/gcYA2HBJE1N6YCDVpaN8g mD6cuvyGnm1SBknkkG5Hn/NVkyctUqo= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-418-hCJsvRFbNPWik1qsw7i1nQ-1; Mon, 20 Apr 2020 09:57:55 -0400 X-MC-Unique: hCJsvRFbNPWik1qsw7i1nQ-1 Received: by mail-wr1-f71.google.com with SMTP id x15so3711427wrn.0 for ; Mon, 20 Apr 2020 06:57:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=pK26z2Uz8J+xMXGm08XY3fCeYfVumTWEKpq3I9uMJ70=; b=fwbjju+e4Pf0Y3m/XeUN4YXO0bNkFLWjMtUXfOqluvSHAdA/80FLjb41uXQ9ove8/6 SA5riPJNhCChbM8T7uN0UGSGEzlKvjhDgW3BT53JvHvvcJfPRkld9rLD3NE6dyHXqgLu QSnDXWJc+Ffd6BB5eFnV6CNZBwm2XbzCtClnEmUQvT24EqCwovxbRzb+5+uxAYQRYdRP A/5nFeQpJcdkv05gP93QwWs6eu4X+AJBmeCOV5/a5ke7TqFbguKB4QJ7e8jYJizd19cR thnP16OceEGH+XkSgh2gBNGihehoBRfmFMUmxf3ssT0iwrD8/j8TjlqU4LJaYb7qyESo Ubjw== X-Gm-Message-State: AGi0PuYTWmEQ0g1fig99E2YYFvebFcSXVjgaAzsMdLDv+oNKQwLaDQmi R/n7UVm2uXfr74gEFE4JvVS5zF8Gw1mNkXPak9lHIKPPbUdSYOOpCYhFR+P8dLCH7PK0bVfJsul AqzyOaDxJa0s= X-Received: by 2002:a7b:cf2b:: with SMTP id m11mr16860519wmg.147.1587391073787; Mon, 20 Apr 2020 06:57:53 -0700 (PDT) X-Google-Smtp-Source: APiQypKZBYixV5ajKWzxEAUUh742/WPOg+S3dMK8bDyvyM4eMw8EIY0hxy1C7QN16yJpeFB4fL8+FQ== X-Received: by 2002:a7b:cf2b:: with SMTP id m11mr16860432wmg.147.1587391073551; Mon, 20 Apr 2020 06:57:53 -0700 (PDT) Received: from localhost.localdomain ([194.230.155.102]) by smtp.gmail.com with ESMTPSA id l5sm1432890wmi.22.2020.04.20.06.57.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Apr 2020 06:57:52 -0700 (PDT) From: Emanuele Giuseppe Esposito Subject: Re: [PATCH 6/8] simplefs: add file creation functions To: Greg Kroah-Hartman 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 References: <20200414124304.4470-1-eesposit@redhat.com> <20200414124304.4470-7-eesposit@redhat.com> <20200414125626.GC720679@kroah.com> Message-ID: Date: Mon, 20 Apr 2020 15:57:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200414125626.GC720679@kroah.com> Content-Language: en-US X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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 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 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=-5.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 BD520C38A30 for ; Mon, 20 Apr 2020 17:47:46 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 34F5A20857 for ; Mon, 20 Apr 2020 17:47:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="hQCSXdDp"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="hQCSXdDp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 34F5A20857 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 495Z0b1ZF2zDqjJ for ; Tue, 21 Apr 2020 03:47:43 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=redhat.com (client-ip=207.211.31.81; helo=us-smtp-delivery-1.mimecast.com; envelope-from=eesposit@redhat.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=hQCSXdDp; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=hQCSXdDp; dkim-atps=neutral Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 495SvX4JxfzDqdv for ; Mon, 20 Apr 2020 23:58:00 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587391077; 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=hQCSXdDpVOG0mefk3CCL4YQ1Cx6SU+9tCQGoFrdEt6Wy8JGpB+t3GJrbO5AwGywm1vI++w hR3Z+s3VuUW7AW3fQtN5jPIyG6M5KbugnGSwCYtOndUF2V7nOb9ui/e4EiQTMcV2fFnBz1 i2M4F6L/9YjaAdLdrqqmaPf0PkT7lRY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587391077; 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=hQCSXdDpVOG0mefk3CCL4YQ1Cx6SU+9tCQGoFrdEt6Wy8JGpB+t3GJrbO5AwGywm1vI++w hR3Z+s3VuUW7AW3fQtN5jPIyG6M5KbugnGSwCYtOndUF2V7nOb9ui/e4EiQTMcV2fFnBz1 i2M4F6L/9YjaAdLdrqqmaPf0PkT7lRY= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-405-mEQr_dY9MziBGz2QcAwBYA-1; Mon, 20 Apr 2020 09:57:54 -0400 X-MC-Unique: mEQr_dY9MziBGz2QcAwBYA-1 Received: by mail-wr1-f70.google.com with SMTP id i10so5725042wrq.8 for ; Mon, 20 Apr 2020 06:57:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=pK26z2Uz8J+xMXGm08XY3fCeYfVumTWEKpq3I9uMJ70=; b=OaZNL3loFunJcEiczS5db7dacAK9ME665aStC1iFtUHtmSlhXf5MxRU5LtaRARXixr RHO0zJNCaMa94PkvxPd8Yr1+mQ9ns8bemUpmDjumgA0IeEXA2LFtaZoT4d+Tanrg8NmL w5N0hfJDcQaLlwpmUC8+5ntkhyd+1OrHVuVM9+qSqFRZ6a9KdV4rMZ38ZTdM5YyePhCj 8Ipfx+AHqf6G86/RRPPtDIlFgZBpTGOw5PBVH93XFiI5tVNUUqjZwBbkW3gviAO2YNL9 rgZUYp2YB66TKBmMNl0Y6pShE23FtZ6meZuViX3hXWO0lQjdbh9ojggvHVW3uLBz0oKo UWrw== X-Gm-Message-State: AGi0PuZ8SYYaSf5cY+j8zjgZUInIT5dC9TZ1rKYfOCkiyd9KNF7Jo9EU 1zHhDsmK7pptBrzVk8Qt+PIpB5mI+8/fSrzf+4jDF3oCVwYdO1LHjdg3JSycJgW6arHPHiklHrY ZRljoZEeC3jCeS7MFSNhzXANBKw== X-Received: by 2002:a7b:cf2b:: with SMTP id m11mr16860448wmg.147.1587391073765; Mon, 20 Apr 2020 06:57:53 -0700 (PDT) X-Google-Smtp-Source: APiQypKZBYixV5ajKWzxEAUUh742/WPOg+S3dMK8bDyvyM4eMw8EIY0hxy1C7QN16yJpeFB4fL8+FQ== X-Received: by 2002:a7b:cf2b:: with SMTP id m11mr16860432wmg.147.1587391073551; Mon, 20 Apr 2020 06:57:53 -0700 (PDT) Received: from localhost.localdomain ([194.230.155.102]) by smtp.gmail.com with ESMTPSA id l5sm1432890wmi.22.2020.04.20.06.57.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Apr 2020 06:57:52 -0700 (PDT) From: Emanuele Giuseppe Esposito Subject: Re: [PATCH 6/8] simplefs: add file creation functions To: Greg Kroah-Hartman References: <20200414124304.4470-1-eesposit@redhat.com> <20200414124304.4470-7-eesposit@redhat.com> <20200414125626.GC720679@kroah.com> Message-ID: Date: Mon, 20 Apr 2020 15:57:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200414125626.GC720679@kroah.com> Content-Language: en-US X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Tue, 21 Apr 2020 03:37:26 +1000 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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, 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, Maarten Lankhorst , Mike Marciniszyn , Maxime Ripard , 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 , Daniel Vetter , Colin Cross , Frederic Barrat , Paolo Bonzini , Andrew Morton , Mike Kravetz , linuxppc-dev@lists.ozlabs.org, Martin KaFai Lau , Joel Becker , Alexander Viro Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 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=-5.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 C1D94C3815B for ; Mon, 20 Apr 2020 13:58:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 954A82070B for ; Mon, 20 Apr 2020 13:58:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="R/JcZkwu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 954A82070B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1750E6E1F8; Mon, 20 Apr 2020 13:58:00 +0000 (UTC) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by gabe.freedesktop.org (Postfix) with ESMTPS id A491B6E1F8 for ; Mon, 20 Apr 2020 13:57:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587391078; 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=R/JcZkwu1B4ZzBZFN6dQVIKNfDHLF067dQ/VbM9oDV5t6uYbWvbtuqkJ9oMnkSb3C77v7t 1yPjEZDOHc00VQzqoNntmFnBvFO/HXlT5EDlCGiwLHrNXwGd/gcYA2HBJE1N6YCDVpaN8g mD6cuvyGnm1SBknkkG5Hn/NVkyctUqo= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-49-CzBSCf4TNcqRjHdgJrl2VQ-1; Mon, 20 Apr 2020 09:57:54 -0400 X-MC-Unique: CzBSCf4TNcqRjHdgJrl2VQ-1 Received: by mail-wr1-f70.google.com with SMTP id 11so5757741wrc.3 for ; Mon, 20 Apr 2020 06:57:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=pK26z2Uz8J+xMXGm08XY3fCeYfVumTWEKpq3I9uMJ70=; b=WPkGi6GLaqkxtGMMWMKn+0SPnuo4pVSnGOtqXUIpIWzFxJKMBpg69fR3/Sl+euVY+B QLxsfWdhwwcoL0LjmNhCYTgX4qdOp9qGNqEpxPgI22/mZUymjxTwHTEfaUfliyxjziZF /GVqoPzEBVtkTqDAAfZ4/EVYF502BnSh6k71NNxnGAtr76zYsqGJd09llWA7JiXSkSa4 XwRGjseNEznv5smsg9QH7g5M7nBGSF2AQa9PILiMeJJDBLW8ocVhaiXHNb6ef5qsgljf OkUOU9eMTjSHm5Xy9UjctI6FmdpxS8M6roUUXvuzRXJpUvXl9gXLhMuZcKybIPWtqmIk HdDQ== X-Gm-Message-State: AGi0PuY0rwj22JPPdGpOJcM+CSGJ5p7goJ0uL6j7ve2z8R0pfZqVC/+j vKbSap8O+3HglJTNX1ZCH98/Vmc31bmeV8oz7FR5pEC4kVM/oZUkZXX4I4dZck+7cIQICHcOjFT 6RLWWsTzbLymaOallwNfnLGY4+siU X-Received: by 2002:a7b:cf2b:: with SMTP id m11mr16860491wmg.147.1587391073773; Mon, 20 Apr 2020 06:57:53 -0700 (PDT) X-Google-Smtp-Source: APiQypKZBYixV5ajKWzxEAUUh742/WPOg+S3dMK8bDyvyM4eMw8EIY0hxy1C7QN16yJpeFB4fL8+FQ== X-Received: by 2002:a7b:cf2b:: with SMTP id m11mr16860432wmg.147.1587391073551; Mon, 20 Apr 2020 06:57:53 -0700 (PDT) Received: from localhost.localdomain ([194.230.155.102]) by smtp.gmail.com with ESMTPSA id l5sm1432890wmi.22.2020.04.20.06.57.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Apr 2020 06:57:52 -0700 (PDT) From: Emanuele Giuseppe Esposito Subject: Re: [PATCH 6/8] simplefs: add file creation functions To: Greg Kroah-Hartman References: <20200414124304.4470-1-eesposit@redhat.com> <20200414124304.4470-7-eesposit@redhat.com> <20200414125626.GC720679@kroah.com> Message-ID: Date: Mon, 20 Apr 2020 15:57:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200414125626.GC720679@kroah.com> Content-Language: en-US X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel From mboxrd@z Thu Jan 1 00:00:00 1970 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