[PATCH] vfs: update documentation for inode operation locking rules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Al,

This was part of an  overlayfs topic branch that's not going to be
merged for this merge window... or ever.

You might as well take this small Locking doc touch up.

Amir.

---------- Forwarded message ----------
From: Amir Goldstein <amir73il@xxxxxxxxx>
Date: Sat, Nov 12, 2016 at 9:36 PM
Subject: [RFC][PATCH 1/4] vfs: update documentation for inode
operation locking rules
To: Miklos Szeredi <miklos@xxxxxxxxxx>
Cc: Konstantin Khlebnikov <koct9i@xxxxxxxxx>, Al Viro
<viro@xxxxxxxxxxxxxxxxxx>, linux-unionfs@xxxxxxxxxxxxxxx,
linux-fsdevel@xxxxxxxxxxxxxxx


- 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@xxxxxxxxx>
---
 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
--
2.7.4
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux