From patchwork Tue Apr 14 12:42:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emanuele Giuseppe Esposito X-Patchwork-Id: 11487465 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 364101871 for ; Tue, 14 Apr 2020 12:45:49 +0000 (UTC) Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) (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 13ADA206A2 for ; Tue, 14 Apr 2020 12:45:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 13ADA206A2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=ocfs2-devel-bounces@oss.oracle.com Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03EChIfl151094; Tue, 14 Apr 2020 12:45:23 GMT Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 30b6hpmbce-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 Apr 2020 12:45:23 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03ECfpGX054787; Tue, 14 Apr 2020 12:45:22 GMT Received: from oss.oracle.com (oss-old-reserved.oracle.com [137.254.22.2]) by userp3030.oracle.com with ESMTP id 30bqchjgbj-1 (version=TLSv1 cipher=AES256-SHA bits=256 verify=NO); Tue, 14 Apr 2020 12:45:22 +0000 Received: from localhost ([127.0.0.1] helo=lb-oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1jOKwL-0003cM-R5; Tue, 14 Apr 2020 05:45:21 -0700 Received: from userp3030.oracle.com ([156.151.31.80]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1jOKvV-0003Uw-JA for ocfs2-devel@oss.oracle.com; Tue, 14 Apr 2020 05:44:29 -0700 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03ECfp7V054733 for ; Tue, 14 Apr 2020 12:44:29 GMT Received: from userp2040.oracle.com (userp2040.oracle.com [156.151.31.90]) by userp3030.oracle.com with ESMTP id 30bqchjdmd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 14 Apr 2020 12:44:29 +0000 Received: from pps.filterd (userp2040.oracle.com [127.0.0.1]) by userp2040.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03ECiQZr027571 for ; Tue, 14 Apr 2020 12:44:28 GMT Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by userp2040.oracle.com with ESMTP id 30d6x0xcmc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=OK) for ; Tue, 14 Apr 2020 12:44:28 +0000 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-494-mr6ULChyOoiZDwINCa4cdA-1; Tue, 14 Apr 2020 08:43:31 -0400 X-MC-Unique: mr6ULChyOoiZDwINCa4cdA-1 Received: by mail-wm1-f72.google.com with SMTP id o26so3720864wmh.1 for ; Tue, 14 Apr 2020 05:43:30 -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:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=fP9JfUaepQl9AEXacvfinBkYRVU9dDq3rlCP1SQpCoc=; b=OcPWCo3G7ZVRId99ckV9E7oPLCtI+mH+jtYJaoeHGdJ6mBUuisfpG2dx1crqnUjTvO /ZxpIusSZl+6wySkwPdJWbFqYsrs7vreGEuEJZk2TEw6JLqL3oVIJaGJs69nJSFneZha NdE/YKGXkny0ru3G/t4F3OW7tPFgA9MiMu0mGLdertXSUf1HKpZf7aKsurnbqHLSzBWt ogUqrWltAGpakkHow9YZXEvC96rWhOu+XAv6444Voi7eadJ/FDR7+L/+Z66E75Tgc2EM yVf6x0cD0EIhqfp3+mdS7wFjVN7GOryu7JIwcgs4OY3lV7/X822wKFC8s0Dgg5QZWJJ7 6jaQ== X-Gm-Message-State: AGi0Pua/2TRtUN2yuwuXl0rks96igBw6rUtzC+bNgAWAeAGGuDgYBjXv kC43LjJ2kPi5u0xJTEsA8otOhEOMiPn83aB7Ec4ipXgjl1emImTwWqvYPHbx5kUWgpF/UO+EH8j 6u/qvIk3XI13v7PbsZWGFGg== X-Received: by 2002:adf:97cc:: with SMTP id t12mr22402293wrb.261.1586868209903; Tue, 14 Apr 2020 05:43:29 -0700 (PDT) X-Google-Smtp-Source: APiQypJ2dTzegIg0xIyb6oIhZwO+Fw/tjfTAynP0eIvP7y2y/+ilzA1Tw1zlCJEMAy5qMTHNiP27og== X-Received: by 2002:adf:97cc:: with SMTP id t12mr22402243wrb.261.1586868209612; Tue, 14 Apr 2020 05:43:29 -0700 (PDT) Received: from localhost.localdomain ([194.230.155.210]) by smtp.gmail.com with ESMTPSA id m14sm16948816wrs.76.2020.04.14.05.43.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Apr 2020 05:43:28 -0700 (PDT) From: Emanuele Giuseppe Esposito To: linux-nfs@vger.kernel.org Date: Tue, 14 Apr 2020 14:42:54 +0200 Message-Id: <20200414124304.4470-1-eesposit@redhat.com> X-Mailer: git-send-email 2.25.2 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Proofpoint-SPF-Result: pass X-Proofpoint-SPF-Record: v=spf1 ip4:103.23.64.2 ip4:103.23.65.2 ip4:103.23.66.26 ip4:103.23.67.26 ip4:107.21.15.141 ip4:108.177.8.0/21 ip4:13.111.0.0/16 ip4:136.147.128.0/20 ip4:136.147.176.0/20 ip4:148.105.8.0/21 ip4:149.72.0.0/16 ip4:149.96.1.26 ip4:149.96.13.2 ip4:149.96.132.2 ip4:149.96.133.2 ip4:149.96.14.2 ip4:149.96.194.2 ip4:149.96.195.2 ip4:149.96.2.26 include:spf1.redhat.com -all X-Proofpoint-SPF-VenPass: Allowed X-PDR: PASS X-Source-IP: 205.139.110.120 X-ServerName: us-smtp-delivery-1.mimecast.com X-Proofpoint-SPF-Result: pass X-Proofpoint-SPF-Record: v=spf1 ip4:103.23.64.2 ip4:103.23.65.2 ip4:103.23.66.26 ip4:103.23.67.26 ip4:107.21.15.141 ip4:108.177.8.0/21 ip4:13.111.0.0/16 ip4:136.147.128.0/20 ip4:136.147.176.0/20 ip4:148.105.8.0/21 ip4:149.72.0.0/16 ip4:149.96.1.26 ip4:149.96.13.2 ip4:149.96.132.2 ip4:149.96.133.2 ip4:149.96.14.2 ip4:149.96.194.2 ip4:149.96.195.2 ip4:149.96.2.26 include:spf1.redhat.com -all X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9590 signatures=668686 X-Proofpoint-Spam-Details: rule=tap_spam_policies_safe policy=tap_spam_policies score=0 classifier= adjust=0 reason=safe scancount=1 engine=8.12.0-2003020000 definitions=main-2004140037 X-Spam: OrgSafeList X-SpamRule: orgsafelist X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 mlxlogscore=999 bulkscore=0 malwarescore=0 phishscore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004140105 X-Mailman-Approved-At: Tue, 14 Apr 2020 05:45:19 -0700 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" , Hugh Dickins , Paul Mackerras , John Johansen , linux-s390@vger.kernel.org, Andrew Donnellan , Emanuele Giuseppe Esposito , Matthew Garrett , linux-efi@vger.kernel.org, Arnd Bergmann , Daniel Borkmann , Christian Borntraeger , linux-rdma@vger.kernel.org, Michael Ellerman , 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" , netdev@vger.kernel.org, Robert Richter , Thomas Zimmermann , Vasily Gorbik , Tony Luck , Kees Cook , "James E.J. Bottomley" , autofs@vger.kernel.org, Maarten Lankhorst , Uma Krishnan , Maxime Ripard , linux-fsdevel@vger.kernel.org, "Manoj N. Kumar" , Alexander Viro , Jakub Kicinski , KP Singh , Trond Myklebust , "Matthew R. Ochs" , "David S. Miller" , Felipe Balbi , Mike Marciniszyn , Iurii Zaikin , linux-scsi@vger.kernel.org, linux-mm@kvack.org, Greg Kroah-Hartman , 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 , Mike Kravetz , linuxppc-dev@lists.ozlabs.org, Martin KaFai Lau , ocfs2-devel@oss.oracle.com Subject: [Ocfs2-devel] [PATCH 0/8] Simplefs: group and simplify linux fs code X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9590 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 phishscore=0 mlxscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004140105 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9590 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 mlxlogscore=999 clxscore=1015 mlxscore=0 phishscore=0 suspectscore=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 priorityscore=1501 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004140105 This series of patches introduce wrappers for functions, arguments simplification in functions calls and most importantly groups duplicated code in a single header, simplefs, to avoid redundancy in the linux fs, especially debugfs and tracefs. Signed-off-by: Emanuele Giuseppe Esposito Emanuele Giuseppe Esposito (8): apparmor: just use vfs_kern_mount to make .null fs: extract simple_pin/release_fs to separate files fs: wrap simple_pin_fs/simple_release_fs arguments in a struct fs: introduce simple_new_inode simplefs: add alloc_anon_inode wrapper simplefs: add file creation functions debugfs: switch to simplefs inode creation API tracefs: switch to simplefs inode creation API arch/powerpc/platforms/cell/spufs/inode.c | 4 +- arch/s390/hypfs/inode.c | 4 +- drivers/gpu/drm/Kconfig | 1 + drivers/gpu/drm/drm_drv.c | 13 +- drivers/infiniband/hw/qib/qib_fs.c | 6 +- drivers/misc/cxl/Kconfig | 1 + drivers/misc/cxl/api.c | 14 +- drivers/misc/ibmasm/ibmasmfs.c | 8 +- drivers/misc/ocxl/Kconfig | 1 + drivers/oprofile/oprofilefs.c | 8 +- drivers/scsi/cxlflash/ocxl_hw.c | 15 +- drivers/usb/gadget/function/f_fs.c | 8 +- fs/Kconfig | 3 + fs/Kconfig.binfmt | 1 + fs/Makefile | 1 + fs/autofs/inode.c | 4 +- fs/binfmt_misc.c | 27 +-- fs/configfs/Kconfig | 1 + fs/configfs/mount.c | 12 +- fs/debugfs/inode.c | 171 +++---------------- fs/efivarfs/inode.c | 4 +- fs/fuse/control.c | 4 +- fs/hugetlbfs/inode.c | 8 +- fs/libfs.c | 48 ++---- fs/ocfs2/dlmfs/dlmfs.c | 8 +- fs/proc/base.c | 4 +- fs/proc/proc_sysctl.c | 5 +- fs/pstore/inode.c | 14 +- fs/ramfs/inode.c | 4 +- fs/simplefs.c | 194 ++++++++++++++++++++++ fs/tracefs/inode.c | 108 ++---------- include/linux/fs.h | 3 +- include/linux/simplefs.h | 36 ++++ ipc/mqueue.c | 4 +- kernel/bpf/inode.c | 7 +- lib/Kconfig.debug | 16 +- mm/shmem.c | 4 +- net/sunrpc/rpc_pipe.c | 4 +- security/Kconfig | 1 + security/apparmor/apparmorfs.c | 48 +++--- security/inode.c | 17 +- 41 files changed, 385 insertions(+), 459 deletions(-) create mode 100644 fs/simplefs.c create mode 100644 include/linux/simplefs.h