aboutsummaryrefslogtreecommitdiffstats
path: root/fs/libfs.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-10-10 20:11:50 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-10-10 20:11:50 -0400
commit97d2116708ca0fd6ad8b00811ee4349b7e19e96f (patch)
tree81f73fc1a6daee60737b591cf1be73cc4f79de37 /fs/libfs.c
parent30066ce675d3af350bc5a53858991c0b518dda00 (diff)
parentfd50ecaddf8372a1d96e0daeaac0f93cf04e4d42 (diff)
Merge branch 'work.xattr' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs xattr updates from Al Viro: "xattr stuff from Andreas This completes the switch to xattr_handler ->get()/->set() from ->getxattr/->setxattr/->removexattr" * 'work.xattr' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: vfs: Remove {get,set,remove}xattr inode operations xattr: Stop calling {get,set,remove}xattr inode operations vfs: Check for the IOP_XATTR flag in listxattr xattr: Add __vfs_{get,set,remove}xattr helpers libfs: Use IOP_XATTR flag for empty directory handling vfs: Use IOP_XATTR flag for bad-inode handling vfs: Add IOP_XATTR inode operations flag vfs: Move xattr_resolve_name to the front of fs/xattr.c ecryptfs: Switch to generic xattr handlers sockfs: Get rid of getxattr iop sockfs: getxattr: Fail with -EOPNOTSUPP for invalid attribute names kernfs: Switch to generic xattr handlers hfs: Switch to generic xattr handlers jffs2: Remove jffs2_{get,set,remove}xattr macros xattr: Remove unnecessary NULL attribute name check
Diffstat (limited to 'fs/libfs.c')
-rw-r--r--fs/libfs.c29
1 files changed, 5 insertions, 24 deletions
diff --git a/fs/libfs.c b/fs/libfs.c
index 2b3c3ae70153..a6d89f151771 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -236,8 +236,8 @@ static const struct super_operations simple_super_operations = {
236 * Common helper for pseudo-filesystems (sockfs, pipefs, bdev - stuff that 236 * Common helper for pseudo-filesystems (sockfs, pipefs, bdev - stuff that
237 * will never be mountable) 237 * will never be mountable)
238 */ 238 */
239struct dentry *mount_pseudo(struct file_system_type *fs_type, char *name, 239struct dentry *mount_pseudo_xattr(struct file_system_type *fs_type, char *name,
240 const struct super_operations *ops, 240 const struct super_operations *ops, const struct xattr_handler **xattr,
241 const struct dentry_operations *dops, unsigned long magic) 241 const struct dentry_operations *dops, unsigned long magic)
242{ 242{
243 struct super_block *s; 243 struct super_block *s;
@@ -254,6 +254,7 @@ struct dentry *mount_pseudo(struct file_system_type *fs_type, char *name,
254 s->s_blocksize_bits = PAGE_SHIFT; 254 s->s_blocksize_bits = PAGE_SHIFT;
255 s->s_magic = magic; 255 s->s_magic = magic;
256 s->s_op = ops ? ops : &simple_super_operations; 256 s->s_op = ops ? ops : &simple_super_operations;
257 s->s_xattr = xattr;
257 s->s_time_gran = 1; 258 s->s_time_gran = 1;
258 root = new_inode(s); 259 root = new_inode(s);
259 if (!root) 260 if (!root)
@@ -281,7 +282,7 @@ Enomem:
281 deactivate_locked_super(s); 282 deactivate_locked_super(s);
282 return ERR_PTR(-ENOMEM); 283 return ERR_PTR(-ENOMEM);
283} 284}
284EXPORT_SYMBOL(mount_pseudo); 285EXPORT_SYMBOL(mount_pseudo_xattr);
285 286
286int simple_open(struct inode *inode, struct file *file) 287int simple_open(struct inode *inode, struct file *file)
287{ 288{
@@ -1149,24 +1150,6 @@ static int empty_dir_setattr(struct dentry *dentry, struct iattr *attr)
1149 return -EPERM; 1150 return -EPERM;
1150} 1151}
1151 1152
1152static int empty_dir_setxattr(struct dentry *dentry, struct inode *inode,
1153 const char *name, const void *value,
1154 size_t size, int flags)
1155{
1156 return -EOPNOTSUPP;
1157}
1158
1159static ssize_t empty_dir_getxattr(struct dentry *dentry, struct inode *inode,
1160 const char *name, void *value, size_t size)
1161{
1162 return -EOPNOTSUPP;
1163}
1164
1165static int empty_dir_removexattr(struct dentry *dentry, const char *name)
1166{
1167 return -EOPNOTSUPP;
1168}
1169
1170static ssize_t empty_dir_listxattr(struct dentry *dentry, char *list, size_t size) 1153static ssize_t empty_dir_listxattr(struct dentry *dentry, char *list, size_t size)
1171{ 1154{
1172 return -EOPNOTSUPP; 1155 return -EOPNOTSUPP;
@@ -1177,9 +1160,6 @@ static const struct inode_operations empty_dir_inode_operations = {
1177 .permission = generic_permission, 1160 .permission = generic_permission,
1178 .setattr = empty_dir_setattr, 1161 .setattr = empty_dir_setattr,
1179 .getattr = empty_dir_getattr, 1162 .getattr = empty_dir_getattr,
1180 .setxattr = empty_dir_setxattr,
1181 .getxattr = empty_dir_getxattr,
1182 .removexattr = empty_dir_removexattr,
1183 .listxattr = empty_dir_listxattr, 1163 .listxattr = empty_dir_listxattr,
1184}; 1164};
1185 1165
@@ -1215,6 +1195,7 @@ void make_empty_dir_inode(struct inode *inode)
1215 inode->i_blocks = 0; 1195 inode->i_blocks = 0;
1216 1196
1217 inode->i_op = &empty_dir_inode_operations; 1197 inode->i_op = &empty_dir_inode_operations;
1198 inode->i_opflags &= ~IOP_XATTR;
1218 inode->i_fop = &empty_dir_operations; 1199 inode->i_fop = &empty_dir_operations;
1219} 1200}
1220 1201