ext4: Remove CONFIG_EXT4_FS_XATTR
authorTao Ma <boyu.mt@taobao.com>
Mon, 10 Dec 2012 21:30:43 +0000 (16:30 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 10 Dec 2012 21:30:43 +0000 (16:30 -0500)
Ted has sent out a RFC about removing this feature. Eric and Jan
confirmed that both RedHat and SUSE enable this feature in all their
product.  David also said that "As far as I know, it's enabled in all
Android kernels that use ext4."  So it seems OK for us.

And what's more, as inline data depends its implementation on xattr,
and to be frank, I don't run any test again inline data enabled while
xattr disabled.  So I think we should add inline data and remove this
config option in the same release.

[ The savings if you disable CONFIG_EXT4_FS_XATTR is only 27k, which
  isn't much in the grand scheme of things.  Since no one seems to be
  testing this configuration except for some automated compile farms, on
  balance we are better removing this config option, and so that it is
  effectively always enabled. -- tytso ]

Cc: David Brown <davidb@codeaurora.org>
Cc: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Tao Ma <boyu.mt@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Documentation/filesystems/ext4.txt
fs/Kconfig
fs/ext4/Kconfig
fs/ext4/Makefile
fs/ext4/ext4.h
fs/ext4/file.c
fs/ext4/namei.c
fs/ext4/super.c
fs/ext4/symlink.c
fs/ext4/xattr.h

index 104322bf378c314061ae906433e0e81a9abde7e0..34ea4f1fa6ea7eefd359fb09e1605a6d6948910b 100644 (file)
@@ -200,12 +200,9 @@ inode_readahead_blks=n     This tuning parameter controls the maximum
                        table readahead algorithm will pre-read into
                        the buffer cache.  The default value is 32 blocks.
 
-nouser_xattr           Disables Extended User Attributes. If you have extended
-                       attribute support enabled in the kernel configuration
-                       (CONFIG_EXT4_FS_XATTR), extended attribute support
-                       is enabled by default on mount. See the attr(5) manual
-                       page and http://acl.bestbits.at/ for more information
-                       about extended attributes.
+nouser_xattr           Disables Extended User Attributes.  See the
+                       attr(5) manual page and http://acl.bestbits.at/
+                       for more information about extended attributes.
 
 noacl                  This option disables POSIX Access Control List
                        support. If ACL support is enabled in the kernel
index f95ae3a027f38dd3173d5c766eeeb0ecda58d2be..eaff24a19502aaf815cb8407152871da5d065665 100644 (file)
@@ -28,8 +28,8 @@ config FS_MBCACHE
        tristate
        default y if EXT2_FS=y && EXT2_FS_XATTR
        default y if EXT3_FS=y && EXT3_FS_XATTR
-       default y if EXT4_FS=y && EXT4_FS_XATTR
-       default m if EXT2_FS_XATTR || EXT3_FS_XATTR || EXT4_FS_XATTR
+       default y if EXT4_FS=y
+       default m if EXT2_FS_XATTR || EXT3_FS_XATTR || EXT4_FS
 
 source "fs/reiserfs/Kconfig"
 source "fs/jfs/Kconfig"
index c22f17021b6eee7ca942a3525eb9f4fd23de6011..0a475c881852666d6f21b9a0fc82207d35b6be46 100644 (file)
@@ -39,22 +39,8 @@ config EXT4_USE_FOR_EXT23
          compiled kernel size by using one file system driver for
          ext2, ext3, and ext4 file systems.
 
-config EXT4_FS_XATTR
-       bool "Ext4 extended attributes"
-       depends on EXT4_FS
-       default y
-       help
-         Extended attributes are name:value pairs associated with inodes by
-         the kernel or by users (see the attr(5) manual page, or visit
-         <http://acl.bestbits.at/> for details).
-
-         If unsure, say N.
-
-         You need this for POSIX ACL support on ext4.
-
 config EXT4_FS_POSIX_ACL
        bool "Ext4 POSIX Access Control Lists"
-       depends on EXT4_FS_XATTR
        select FS_POSIX_ACL
        help
          POSIX Access Control Lists (ACLs) support permissions for users and
@@ -67,7 +53,6 @@ config EXT4_FS_POSIX_ACL
 
 config EXT4_FS_SECURITY
        bool "Ext4 Security Labels"
-       depends on EXT4_FS_XATTR
        help
          Security labels support alternative access control models
          implemented by security modules like SELinux.  This option
index 3d96d569853835aa0b7662fef25a772f85212104..0310fec2ee3dbd39ddf3b25ae47b89147fe40031 100644 (file)
@@ -7,8 +7,8 @@ obj-$(CONFIG_EXT4_FS) += ext4.o
 ext4-y := balloc.o bitmap.o dir.o file.o fsync.o ialloc.o inode.o page-io.o \
                ioctl.o namei.o super.o symlink.o hash.o resize.o extents.o \
                ext4_jbd2.o migrate.o mballoc.o block_validity.o move_extent.o \
-               mmp.o indirect.o extents_status.o
+               mmp.o indirect.o extents_status.o xattr.o xattr_user.o \
+               xattr_trusted.o inline.o
 
-ext4-$(CONFIG_EXT4_FS_XATTR)           += xattr.o xattr_user.o xattr_trusted.o inline.o
 ext4-$(CONFIG_EXT4_FS_POSIX_ACL)       += acl.o
 ext4-$(CONFIG_EXT4_FS_SECURITY)                += xattr_security.o
index b90e2720b826da7cc92288bf0d0d88637ec9f602..e20dc38858d4ed601493c57671f25bbcfa38e9ae 100644 (file)
@@ -848,7 +848,6 @@ struct ext4_inode_info {
 #endif
        unsigned long   i_flags;
 
-#ifdef CONFIG_EXT4_FS_XATTR
        /*
         * Extended attributes can be read independently of the main file
         * data. Taking i_mutex even when reading would cause contention
@@ -857,7 +856,6 @@ struct ext4_inode_info {
         * EAs.
         */
        struct rw_semaphore xattr_sem;
-#endif
 
        struct list_head i_orphan;      /* unlinked but open inodes */
 
index 2f5759eb9f8941d486b0bbc5b09e0cae137e723b..b64a60bf105a0c884c104b251ba59a6e0ef93d1b 100644 (file)
@@ -656,12 +656,10 @@ const struct file_operations ext4_file_operations = {
 const struct inode_operations ext4_file_inode_operations = {
        .setattr        = ext4_setattr,
        .getattr        = ext4_getattr,
-#ifdef CONFIG_EXT4_FS_XATTR
        .setxattr       = generic_setxattr,
        .getxattr       = generic_getxattr,
        .listxattr      = ext4_listxattr,
        .removexattr    = generic_removexattr,
-#endif
        .get_acl        = ext4_get_acl,
        .fiemap         = ext4_fiemap,
 };
index b37c218398334a618668c73afe5ef69ef5d3adca..cac44828233159bfeb1d93c502943fe82b813b2a 100644 (file)
@@ -3228,23 +3228,19 @@ const struct inode_operations ext4_dir_inode_operations = {
        .mknod          = ext4_mknod,
        .rename         = ext4_rename,
        .setattr        = ext4_setattr,
-#ifdef CONFIG_EXT4_FS_XATTR
        .setxattr       = generic_setxattr,
        .getxattr       = generic_getxattr,
        .listxattr      = ext4_listxattr,
        .removexattr    = generic_removexattr,
-#endif
        .get_acl        = ext4_get_acl,
        .fiemap         = ext4_fiemap,
 };
 
 const struct inode_operations ext4_special_inode_operations = {
        .setattr        = ext4_setattr,
-#ifdef CONFIG_EXT4_FS_XATTR
        .setxattr       = generic_setxattr,
        .getxattr       = generic_getxattr,
        .listxattr      = ext4_listxattr,
        .removexattr    = generic_removexattr,
-#endif
        .get_acl        = ext4_get_acl,
 };
index e1e216f8e9bd645276548c74ecd5ae4888c8d7f0..7d53adff8bd300282094800f6f4dbf05deffa049 100644 (file)
@@ -997,9 +997,7 @@ static void init_once(void *foo)
        struct ext4_inode_info *ei = (struct ext4_inode_info *) foo;
 
        INIT_LIST_HEAD(&ei->i_orphan);
-#ifdef CONFIG_EXT4_FS_XATTR
        init_rwsem(&ei->xattr_sem);
-#endif
        init_rwsem(&ei->i_data_sem);
        inode_init_once(&ei->vfs_inode);
 }
@@ -1449,13 +1447,8 @@ static const struct mount_opts {
        {Opt_data_journal, EXT4_MOUNT_JOURNAL_DATA, MOPT_DATAJ},
        {Opt_data_ordered, EXT4_MOUNT_ORDERED_DATA, MOPT_DATAJ},
        {Opt_data_writeback, EXT4_MOUNT_WRITEBACK_DATA, MOPT_DATAJ},
-#ifdef CONFIG_EXT4_FS_XATTR
        {Opt_user_xattr, EXT4_MOUNT_XATTR_USER, MOPT_SET},
        {Opt_nouser_xattr, EXT4_MOUNT_XATTR_USER, MOPT_CLEAR},
-#else
-       {Opt_user_xattr, 0, MOPT_NOSUPPORT},
-       {Opt_nouser_xattr, 0, MOPT_NOSUPPORT},
-#endif
 #ifdef CONFIG_EXT4_FS_POSIX_ACL
        {Opt_acl, EXT4_MOUNT_POSIX_ACL, MOPT_SET},
        {Opt_noacl, EXT4_MOUNT_POSIX_ACL, MOPT_CLEAR},
@@ -3368,9 +3361,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
        if (def_mount_opts & EXT4_DEFM_UID16)
                set_opt(sb, NO_UID32);
        /* xattr user namespace & acls are now defaulted on */
-#ifdef CONFIG_EXT4_FS_XATTR
        set_opt(sb, XATTR_USER);
-#endif
 #ifdef CONFIG_EXT4_FS_POSIX_ACL
        set_opt(sb, POSIX_ACL);
 #endif
index ed9354aff2790e0252ed1f3f7257262b1c2112f1..ff371193201841aa5ffee964e09d5862a8e25796 100644 (file)
@@ -35,22 +35,18 @@ const struct inode_operations ext4_symlink_inode_operations = {
        .follow_link    = page_follow_link_light,
        .put_link       = page_put_link,
        .setattr        = ext4_setattr,
-#ifdef CONFIG_EXT4_FS_XATTR
        .setxattr       = generic_setxattr,
        .getxattr       = generic_getxattr,
        .listxattr      = ext4_listxattr,
        .removexattr    = generic_removexattr,
-#endif
 };
 
 const struct inode_operations ext4_fast_symlink_inode_operations = {
        .readlink       = generic_readlink,
        .follow_link    = ext4_follow_link,
        .setattr        = ext4_setattr,
-#ifdef CONFIG_EXT4_FS_XATTR
        .setxattr       = generic_setxattr,
        .getxattr       = generic_getxattr,
        .listxattr      = ext4_listxattr,
        .removexattr    = generic_removexattr,
-#endif
 };
index 4222388c772f2619a4c99b1d351a3a80ebf080cd..7b5513ed3b386da1d49337139e658bd967849aaa 100644 (file)
@@ -92,8 +92,6 @@ struct ext4_xattr_ibody_find {
        struct ext4_iloc iloc;
 };
 
-# ifdef CONFIG_EXT4_FS_XATTR
-
 extern const struct xattr_handler ext4_xattr_user_handler;
 extern const struct xattr_handler ext4_xattr_trusted_handler;
 extern const struct xattr_handler ext4_xattr_acl_access_handler;
@@ -193,239 +191,6 @@ extern int ext4_try_to_evict_inline_data(handle_t *handle,
 extern void ext4_inline_data_truncate(struct inode *inode, int *has_inline);
 
 extern int ext4_convert_inline_data(struct inode *inode);
-# else  /* CONFIG_EXT4_FS_XATTR */
-
-static inline int
-ext4_xattr_get(struct inode *inode, int name_index, const char *name,
-              void *buffer, size_t size, int flags)
-{
-       return -EOPNOTSUPP;
-}
-
-static inline int
-ext4_xattr_set(struct inode *inode, int name_index, const char *name,
-              const void *value, size_t size, int flags)
-{
-       return -EOPNOTSUPP;
-}
-
-static inline int
-ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
-              const char *name, const void *value, size_t size, int flags)
-{
-       return -EOPNOTSUPP;
-}
-
-static inline void
-ext4_xattr_delete_inode(handle_t *handle, struct inode *inode)
-{
-}
-
-static inline void
-ext4_xattr_put_super(struct super_block *sb)
-{
-}
-
-static __init inline int
-ext4_init_xattr(void)
-{
-       return 0;
-}
-
-static inline void
-ext4_exit_xattr(void)
-{
-}
-
-static inline int
-ext4_expand_extra_isize_ea(struct inode *inode, int new_extra_isize,
-                           struct ext4_inode *raw_inode, handle_t *handle)
-{
-       return -EOPNOTSUPP;
-}
-
-#define ext4_xattr_handlers    NULL
-
-static inline int
-ext4_xattr_ibody_find(struct inode *inode, struct ext4_xattr_info *i,
-                     struct ext4_xattr_ibody_find *is)
-{
-       return -EOPNOTSUPP;
-}
-
-static inline int
-ext4_xattr_ibody_set(handle_t *handle, struct inode *inode,
-                    struct ext4_xattr_info *i,
-                    struct ext4_xattr_ibody_find *is)
-{
-       return -EOPNOTSUPP;
-}
-
-static inline int
-ext4_xattr_ibody_get(struct inode *inode, int name_index,
-                    const char *name,
-                    void *buffer, size_t buffer_size)
-{
-       return -EOPNOTSUPP;
-}
-
-static inline int ext4_find_inline_data_nolock(struct inode *inode)
-{
-       return 0;
-}
-
-static inline int ext4_has_inline_data(struct inode *inode)
-{
-       return 0;
-}
-
-static inline int ext4_get_inline_size(struct inode *inode)
-{
-       return 0;
-}
-
-static inline int ext4_get_max_inline_size(struct inode *inode)
-{
-       return 0;
-}
-
-static inline void ext4_write_inline_data(struct inode *inode,
-                                         struct ext4_iloc *iloc,
-                                         void *buffer, loff_t pos,
-                                         unsigned int len)
-{
-       return;
-}
-
-static inline int ext4_init_inline_data(handle_t *handle,
-                                       struct inode *inode,
-                                       unsigned int len)
-{
-       return 0;
-}
-
-static inline int ext4_destroy_inline_data(handle_t *handle,
-                                          struct inode *inode)
-{
-       return 0;
-}
-
-static inline int ext4_readpage_inline(struct inode *inode, struct page *page)
-{
-       return 0;
-}
-
-static inline int ext4_try_to_write_inline_data(struct address_space *mapping,
-                                               struct inode *inode,
-                                               loff_t pos, unsigned len,
-                                               unsigned flags,
-                                               struct page **pagep)
-{
-       return 0;
-}
-
-static inline int ext4_write_inline_data_end(struct inode *inode,
-                                            loff_t pos, unsigned len,
-                                            unsigned copied,
-                                            struct page *page)
-{
-       return 0;
-}
-
-static inline struct buffer_head *
-ext4_journalled_write_inline_data(struct inode *inode,
-                                 unsigned len,
-                                 struct page *page)
-{
-       return NULL;
-}
-
-static inline int
-ext4_da_write_inline_data_begin(struct address_space *mapping,
-                               struct inode *inode,
-                               loff_t pos, unsigned len,
-                               unsigned flags,
-                               struct page **pagep,
-                               void **fsdata)
-{
-       return 0;
-}
-
-static inline int ext4_da_write_inline_data_end(struct inode *inode, loff_t pos,
-                                               unsigned len, unsigned copied,
-                                               struct page *page)
-{
-       return 0;
-}
-
-static inline int ext4_try_add_inline_entry(handle_t *handle,
-                                           struct dentry *dentry,
-                                           struct inode *inode)
-{
-       return 0;
-}
-
-static inline int ext4_try_create_inline_dir(handle_t *handle,
-                                            struct inode *parent,
-                                            struct inode *inode)
-{
-       return 0;
-}
-static inline int ext4_read_inline_dir(struct file *filp,
-                                      void *dirent, filldir_t filldir,
-                                      int *has_inline_data)
-{
-       return 0;
-}
-
-static inline struct buffer_head *
-ext4_find_inline_entry(struct inode *dir,
-                      const struct qstr *d_name,
-                      struct ext4_dir_entry_2 **res_dir,
-                      int *has_inline_data)
-{
-       return NULL;
-}
-static inline int ext4_delete_inline_entry(handle_t *handle,
-                                          struct inode *dir,
-                                          struct ext4_dir_entry_2 *de_del,
-                                          struct buffer_head *bh,
-                                          int *has_inline_data)
-{
-       return 0;
-}
-
-static inline int empty_inline_dir(struct inode *dir, int *has_inline_data)
-{
-       return 0;
-}
-
-static inline struct buffer_head *
-ext4_get_first_inline_block(struct inode *inode,
-                           struct ext4_dir_entry_2 **parent_de,
-                           int *retval)
-{
-       return NULL;
-}
-
-static inline int ext4_inline_data_fiemap(struct inode *inode,
-                                         struct fiemap_extent_info *fieinfo,
-                                         int *has_inline)
-{
-       return 0;
-}
-
-static inline void ext4_inline_data_truncate(struct inode *inode,
-                                            int *has_inline)
-{
-       return;
-}
-
-static inline int ext4_convert_inline_data(struct inode *inode)
-{
-       return 0;
-}
-# endif  /* CONFIG_EXT4_FS_XATTR */
 
 #ifdef CONFIG_EXT4_FS_SECURITY
 extern int ext4_init_security(handle_t *handle, struct inode *inode,