From patchwork Sat Nov 12 19:36:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9424427 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2CE4960233 for ; Sat, 12 Nov 2016 19:36:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D55A28E1B for ; Sat, 12 Nov 2016 19:36:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 11E4928E1E; Sat, 12 Nov 2016 19:36:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B091828E1B for ; Sat, 12 Nov 2016 19:36:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966815AbcKLTgk (ORCPT ); Sat, 12 Nov 2016 14:36:40 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:34009 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966793AbcKLTgi (ORCPT ); Sat, 12 Nov 2016 14:36:38 -0500 Received: by mail-wm0-f65.google.com with SMTP id g23so4800329wme.1; Sat, 12 Nov 2016 11:36:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PRpyppppRwdsqU2t4AYAAm/fBATiz1pni531nopks+A=; b=yMXKTVg9gsWxk+gvjTBldIjNcq6fw2j0KJfZ7BpoWc29SAtXXC2Qnd0dV+Oce1aK1r iLWLvDYY1+qVP5Owd5HzO75ArA5SUOt4r62gkmSalLfxGtfSy+Cy5wk3fuGlg4n69bez TKQkS5XFHGGtmblNGa1JiMBaU2ydnb9dcIpmR1wOYtwMWkWEyy2m9/bwoPOhweyABg8G 8vKquR1ZqTsLSilzugZSNvgCcYGE1hiPxltxkKUokPLpPYfKF1/PuAtMD4/00Vmt/Bk0 ypKRFgg6r7iVLB92DYvZB9F6rFRuAsigdi0xSklceMKlqXJ3O9CCfUssssoxMul+4lAj HLfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PRpyppppRwdsqU2t4AYAAm/fBATiz1pni531nopks+A=; b=M6AGmsAOCzQ5PkZ5RY1GbFtuGl7O35I/oaHOFCJrK1Q/02zarNQWCuKqCSp8Yqw9YZ HfYTFLlcyrR4TihG7pGnkuPWkGHCkhVppglQSY9FQPJLnJ0jiZm8sIia2KCYwvXgBpnV elqnbXB6EmbaVeNXXl1qmGZa76pBMoazEWLidvTI7k2WciNRrSDbGqf1LRKtIWD1U4+o jqsucT5/Cu4groTqsIUzvA2rMk9hSckM2YYfvJyIddaH1k7Vo+tMl63sm4Q2w3GrD1qk JX4WSvMQCPgIvlI3WFUA2qQXalNzpYB0J+lFH5D655kyYwhWglhwxUZOV5ocJa2QGHtM ve6Q== X-Gm-Message-State: ABUngvex8Za/3PDcLjdyAh253Ea43UiSAn4h57orAhIdi+uize3D/JRiaP/2aJGvIpgOxw== X-Received: by 10.28.168.137 with SMTP id r131mr3585998wme.16.1478979396942; Sat, 12 Nov 2016 11:36:36 -0800 (PST) Received: from amir-VirtualBox.Home (bzq-79-177-89-54.red.bezeqint.net. [79.177.89.54]) by smtp.gmail.com with ESMTPSA id b7sm1527142wjm.39.2016.11.12.11.36.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 12 Nov 2016 11:36:36 -0800 (PST) From: Amir Goldstein To: Miklos Szeredi Cc: Konstantin Khlebnikov , Al Viro , linux-unionfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [RFC][PATCH 1/4] vfs: update documentation for inode operation locking rules Date: Sat, 12 Nov 2016 21:36:01 +0200 Message-Id: <1478979364-10355-2-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1478979364-10355-1-git-send-email-amir73il@gmail.com> References: <1478979364-10355-1-git-send-email-amir73il@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP - Remove obsolete truncate operation prototype - Reorder prototypes mostly by their order in inode_operations struct - Match locking rules order to prototypes order - Add missing rule for set_acl operation - Fix indentation Signed-off-by: Amir Goldstein --- Documentation/filesystems/Locking | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index 14cdc10..0e35b16 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking @@ -42,8 +42,11 @@ d_real no no yes no --------------------------- inode_operations --------------------------- prototypes: - int (*create) (struct inode *,struct dentry *,umode_t, bool); struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int); + int (*permission) (struct inode *, int); + int (*readlink) (struct dentry *, char __user *,int); + const char *(*get_link) (struct dentry *, struct inode *, void **); + int (*create) (struct inode *,struct dentry *,umode_t, bool); int (*link) (struct dentry *,struct inode *,struct dentry *); int (*unlink) (struct inode *,struct dentry *); int (*symlink) (struct inode *,struct dentry *,const char *); @@ -52,11 +55,6 @@ prototypes: int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t); int (*rename) (struct inode *, struct dentry *, struct inode *, struct dentry *, unsigned int); - int (*readlink) (struct dentry *, char __user *,int); - const char *(*get_link) (struct dentry *, struct inode *, void **); - void (*truncate) (struct inode *); - int (*permission) (struct inode *, int, unsigned int); - int (*get_acl)(struct inode *, int); int (*setattr) (struct dentry *, struct iattr *); int (*getattr) (struct vfsmount *, struct dentry *, struct kstat *); ssize_t (*listxattr) (struct dentry *, char *, size_t); @@ -66,30 +64,33 @@ prototypes: struct file *, unsigned open_flag, umode_t create_mode, int *opened); int (*tmpfile) (struct inode *, struct dentry *, umode_t); + int (*set_acl) (struct inode *, struct posix_acl *, int); + struct posix_acl *(*get_acl)(struct inode *, int); locking rules: all may block i_mutex(inode) lookup: yes +permission: no (may not block if called in rcu-walk mode) +readlink: no +get_link: no create: yes link: yes (both) -mknod: yes +unlink: yes (both) symlink: yes mkdir: yes -unlink: yes (both) rmdir: yes (both) (see below) -rename: yes (all) (see below) -readlink: no -get_link: no +mknod: yes +rename: yes (all) (see below) setattr: yes -permission: no (may not block if called in rcu-walk mode) -get_acl: no getattr: no listxattr: no fiemap: no update_time: no atomic_open: yes tmpfile: no +set_acl: yes +get_acl: no Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_mutex on