diff options
author | Andreas Gruenbacher <agruenba@redhat.com> | 2015-10-04 13:18:48 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-11-13 20:34:29 -0500 |
commit | 13d3408f100186d2755d9ac1ad8b5de9e1975a92 (patch) | |
tree | e739b3f4f11317be0db0caff45eaa64f6bdde6d3 /fs | |
parent | dae5f57a72a6c913926cf3569edb0556a409a3df (diff) |
ubifs: Remove unused security xattr handler
Ubifs installs a security xattr handler in sb->s_xattr but doesn't use the
generic_{get,set,list,remove}xattr inode operations needed for processing
this list of attribute handlers; the handler is never called. Instead,
ubifs uses its own xattr handlers which also process security xattrs.
Remove the dead code.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Richard Weinberger <richard@nod.at>
Cc: Artem Bityutskiy <dedekind1@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: linux-mtd@lists.infradead.org
Cc: Subodh Nijsure <snijsure@grid-net.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ubifs/super.c | 1 | ||||
-rw-r--r-- | fs/ubifs/ubifs.h | 1 | ||||
-rw-r--r-- | fs/ubifs/xattr.c | 40 |
3 files changed, 0 insertions, 42 deletions
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 9547a27868ad..c71edca41f47 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c | |||
@@ -2037,7 +2037,6 @@ static int ubifs_fill_super(struct super_block *sb, void *data, int silent) | |||
2037 | if (c->max_inode_sz > MAX_LFS_FILESIZE) | 2037 | if (c->max_inode_sz > MAX_LFS_FILESIZE) |
2038 | sb->s_maxbytes = c->max_inode_sz = MAX_LFS_FILESIZE; | 2038 | sb->s_maxbytes = c->max_inode_sz = MAX_LFS_FILESIZE; |
2039 | sb->s_op = &ubifs_super_operations; | 2039 | sb->s_op = &ubifs_super_operations; |
2040 | sb->s_xattr = ubifs_xattr_handlers; | ||
2041 | 2040 | ||
2042 | mutex_lock(&c->umount_mutex); | 2041 | mutex_lock(&c->umount_mutex); |
2043 | err = mount_ubifs(c); | 2042 | err = mount_ubifs(c); |
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index de759022f3d6..33b6ee7b5fe0 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h | |||
@@ -1470,7 +1470,6 @@ extern spinlock_t ubifs_infos_lock; | |||
1470 | extern atomic_long_t ubifs_clean_zn_cnt; | 1470 | extern atomic_long_t ubifs_clean_zn_cnt; |
1471 | extern struct kmem_cache *ubifs_inode_slab; | 1471 | extern struct kmem_cache *ubifs_inode_slab; |
1472 | extern const struct super_operations ubifs_super_operations; | 1472 | extern const struct super_operations ubifs_super_operations; |
1473 | extern const struct xattr_handler *ubifs_xattr_handlers[]; | ||
1474 | extern const struct address_space_operations ubifs_file_address_operations; | 1473 | extern const struct address_space_operations ubifs_file_address_operations; |
1475 | extern const struct file_operations ubifs_file_operations; | 1474 | extern const struct file_operations ubifs_file_operations; |
1476 | extern const struct inode_operations ubifs_file_inode_operations; | 1475 | extern const struct inode_operations ubifs_file_inode_operations; |
diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c index fd65b3f1923c..513815c45a2b 100644 --- a/fs/ubifs/xattr.c +++ b/fs/ubifs/xattr.c | |||
@@ -582,46 +582,6 @@ out_free: | |||
582 | return err; | 582 | return err; |
583 | } | 583 | } |
584 | 584 | ||
585 | static size_t security_listxattr(struct dentry *d, char *list, size_t list_size, | ||
586 | const char *name, size_t name_len, int flags) | ||
587 | { | ||
588 | const int prefix_len = XATTR_SECURITY_PREFIX_LEN; | ||
589 | const size_t total_len = prefix_len + name_len + 1; | ||
590 | |||
591 | if (list && total_len <= list_size) { | ||
592 | memcpy(list, XATTR_SECURITY_PREFIX, prefix_len); | ||
593 | memcpy(list + prefix_len, name, name_len); | ||
594 | list[prefix_len + name_len] = '\0'; | ||
595 | } | ||
596 | |||
597 | return total_len; | ||
598 | } | ||
599 | |||
600 | static int security_getxattr(struct dentry *d, const char *name, void *buffer, | ||
601 | size_t size, int flags) | ||
602 | { | ||
603 | return ubifs_getxattr(d, name, buffer, size); | ||
604 | } | ||
605 | |||
606 | static int security_setxattr(struct dentry *d, const char *name, | ||
607 | const void *value, size_t size, int flags, | ||
608 | int handler_flags) | ||
609 | { | ||
610 | return ubifs_setxattr(d, name, value, size, flags); | ||
611 | } | ||
612 | |||
613 | static const struct xattr_handler ubifs_xattr_security_handler = { | ||
614 | .prefix = XATTR_SECURITY_PREFIX, | ||
615 | .list = security_listxattr, | ||
616 | .get = security_getxattr, | ||
617 | .set = security_setxattr, | ||
618 | }; | ||
619 | |||
620 | const struct xattr_handler *ubifs_xattr_handlers[] = { | ||
621 | &ubifs_xattr_security_handler, | ||
622 | NULL, | ||
623 | }; | ||
624 | |||
625 | static int init_xattrs(struct inode *inode, const struct xattr *xattr_array, | 585 | static int init_xattrs(struct inode *inode, const struct xattr *xattr_array, |
626 | void *fs_info) | 586 | void *fs_info) |
627 | { | 587 | { |