aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/filesystems/Locking
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2016-09-29 11:48:44 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2016-10-07 20:10:44 -0400
commit6c6ef9f26e598fb977f60935e109cd5b266c941a (patch)
treeee583d1c81a7f2e3380cc71108f033ff961649eb /Documentation/filesystems/Locking
parentbf3ee71363c0b44acb62f375aea470262ac4210a (diff)
xattr: Stop calling {get,set,remove}xattr inode operations
All filesystems that support xattrs by now do so via xattr handlers. They all define sb->s_xattr, and their getxattr, setxattr, and removexattr inode operations use the generic inode operations. On filesystems that don't support xattrs, the xattr inode operations are all NULL, and sb->s_xattr is also NULL. This means that we can remove the getxattr, setxattr, and removexattr inode operations and directly call the generic handlers, or better, inline expand those handlers into fs/xattr.c. Filesystems that do not support xattrs on some inodes should clear the IOP_XATTR i_opflags flag in those inodes. (Right now, some filesystems have checks to disable xattrs on some inodes in the ->list, ->get, and ->set xattr handler operations instead.) The IOP_XATTR flag is automatically cleared in inodes of filesystems that don't have xattr support. In orangefs, symlinks do have a setxattr iop but no getxattr iop. Add a check for symlinks to orangefs_inode_getxattr to preserve the current, weird behavior; that check may not be necessary though. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'Documentation/filesystems/Locking')
-rw-r--r--Documentation/filesystems/Locking24
1 files changed, 18 insertions, 6 deletions
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking
index d30fb2cb5066..f56b39ee2e54 100644
--- a/Documentation/filesystems/Locking
+++ b/Documentation/filesystems/Locking
@@ -61,10 +61,7 @@ prototypes:
61 int (*get_acl)(struct inode *, int); 61 int (*get_acl)(struct inode *, int);
62 int (*setattr) (struct dentry *, struct iattr *); 62 int (*setattr) (struct dentry *, struct iattr *);
63 int (*getattr) (struct vfsmount *, struct dentry *, struct kstat *); 63 int (*getattr) (struct vfsmount *, struct dentry *, struct kstat *);
64 int (*setxattr) (struct dentry *, const char *,const void *,size_t,int);
65 ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);
66 ssize_t (*listxattr) (struct dentry *, char *, size_t); 64 ssize_t (*listxattr) (struct dentry *, char *, size_t);
67 int (*removexattr) (struct dentry *, const char *);
68 int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, u64 len); 65 int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, u64 len);
69 void (*update_time)(struct inode *, struct timespec *, int); 66 void (*update_time)(struct inode *, struct timespec *, int);
70 int (*atomic_open)(struct inode *, struct dentry *, 67 int (*atomic_open)(struct inode *, struct dentry *,
@@ -91,15 +88,13 @@ setattr: yes
91permission: no (may not block if called in rcu-walk mode) 88permission: no (may not block if called in rcu-walk mode)
92get_acl: no 89get_acl: no
93getattr: no 90getattr: no
94setxattr: yes
95getxattr: no
96listxattr: no 91listxattr: no
97removexattr: yes
98fiemap: no 92fiemap: no
99update_time: no 93update_time: no
100atomic_open: yes 94atomic_open: yes
101tmpfile: no 95tmpfile: no
102 96
97
103 Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_mutex on 98 Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_mutex on
104victim. 99victim.
105 cross-directory ->rename() and rename2() has (per-superblock) 100 cross-directory ->rename() and rename2() has (per-superblock)
@@ -108,6 +103,23 @@ victim.
108See Documentation/filesystems/directory-locking for more detailed discussion 103See Documentation/filesystems/directory-locking for more detailed discussion
109of the locking scheme for directory operations. 104of the locking scheme for directory operations.
110 105
106----------------------- xattr_handler operations -----------------------
107prototypes:
108 bool (*list)(struct dentry *dentry);
109 int (*get)(const struct xattr_handler *handler, struct dentry *dentry,
110 struct inode *inode, const char *name, void *buffer,
111 size_t size);
112 int (*set)(const struct xattr_handler *handler, struct dentry *dentry,
113 struct inode *inode, const char *name, const void *buffer,
114 size_t size, int flags);
115
116locking rules:
117 all may block
118 i_mutex(inode)
119list: no
120get: no
121set: yes
122
111--------------------------- super_operations --------------------------- 123--------------------------- super_operations ---------------------------
112prototypes: 124prototypes:
113 struct inode *(*alloc_inode)(struct super_block *sb); 125 struct inode *(*alloc_inode)(struct super_block *sb);