[RFC,1/4] vfs: update documentation for inode operation locking rules
diff mbox

Message ID 1478979364-10355-2-git-send-email-amir73il@gmail.com
State New
Headers show

Commit Message

Amir Goldstein Nov. 12, 2016, 7:36 p.m. UTC
- 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 <amir73il@gmail.com>
---
 Documentation/filesystems/Locking | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

Patch
diff mbox

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