2012-12-05 22:35:08

by Theodore Ts'o

[permalink] [raw]
Subject: RFC: remove CONFIG_EXT4_FS_XATTR


The number of build warnings that were generated with the inline data
patch makes me think that perhaps we should just remove
CONFIG_EXT4_FS_XATTR. Turning off CONFIG_EXT4_FS_XATTR causes a net
decrease in the ext4 file system by 27k (about 7.3% if ext4 is built as
a module; the entire compiled kernel's text+data size for my
all-in-one-no-modules-for-kvm-testing is 19 megabytes).

Another advantage of making this change is with the inline data option,
if you turn off CONFIG_EXT4_FS_XATTR, it will still allow a file system
with inline_data to be mounted, but then attempts to read small files or
small directories will end up returning EOPNOTSUPP, which will be
surprising to end users in a very serious way. (Assuming it works at
all; I haven't tested to make sure it fails cleanly, and I'm not sure
Tao has tested that case either; so easing our test matrix is another
reason why removing this config option would be helpful.)

Does anyone have any objections or other reasons why this would be a bad
idea?

- Ted






2012-12-05 23:04:07

by Eric Sandeen

[permalink] [raw]
Subject: Re: RFC: remove CONFIG_EXT4_FS_XATTR

On 12/5/12 4:35 PM, Theodore Ts'o wrote:
>
> The number of build warnings that were generated with the inline data
> patch makes me think that perhaps we should just remove
> CONFIG_EXT4_FS_XATTR. Turning off CONFIG_EXT4_FS_XATTR causes a net
> decrease in the ext4 file system by 27k (about 7.3% if ext4 is built as
> a module; the entire compiled kernel's text+data size for my
> all-in-one-no-modules-for-kvm-testing is 19 megabytes).
>
> Another advantage of making this change is with the inline data option,
> if you turn off CONFIG_EXT4_FS_XATTR, it will still allow a file system
> with inline_data to be mounted, but then attempts to read small files or
> small directories will end up returning EOPNOTSUPP, which will be
> surprising to end users in a very serious way. (Assuming it works at
> all; I haven't tested to make sure it fails cleanly, and I'm not sure
> Tao has tested that case either; so easing our test matrix is another
> reason why removing this config option would be helpful.)
>
> Does anyone have any objections or other reasons why this would be a bad
> idea?

It doesn't bother me; everything in my universe builds with it on.

-Eric

> - Ted
>
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>


2012-12-06 01:33:20

by Tao Ma

[permalink] [raw]
Subject: Re: RFC: remove CONFIG_EXT4_FS_XATTR

On 12/06/2012 06:35 AM, Theodore Ts'o wrote:
>
> The number of build warnings that were generated with the inline data
> patch makes me think that perhaps we should just remove
> CONFIG_EXT4_FS_XATTR. Turning off CONFIG_EXT4_FS_XATTR causes a net
> decrease in the ext4 file system by 27k (about 7.3% if ext4 is built as
> a module; the entire compiled kernel's text+data size for my
> all-in-one-no-modules-for-kvm-testing is 19 megabytes).
>
> Another advantage of making this change is with the inline data option,
> if you turn off CONFIG_EXT4_FS_XATTR, it will still allow a file system
> with inline_data to be mounted, but then attempts to read small files or
> small directories will end up returning EOPNOTSUPP, which will be
> surprising to end users in a very serious way. (Assuming it works at
> all; I haven't tested to make sure it fails cleanly, and I'm not sure
> Tao has tested that case either; so easing our test matrix is another
> reason why removing this config option would be helpful.)
To be frank, I didn't try the inline data test without xattr support. So
that would be great if we remove it. :)

btw, does any distribution disable xattr support during kernel build? As
Eric said on behalf of redhat, and in my ubuntu box xattr is enabled.
Would Jan confirm that SUSE also use it by default?

Thanks
Tao

2012-12-06 03:48:48

by Theodore Ts'o

[permalink] [raw]
Subject: Re: RFC: remove CONFIG_EXT4_FS_XATTR

On Thu, Dec 06, 2012 at 09:33:10AM +0800, Tao Ma wrote:
> To be frank, I didn't try the inline data test without xattr support. So
> that would be great if we remove it. :)
>
> btw, does any distribution disable xattr support during kernel build? As
> Eric said on behalf of redhat, and in my ubuntu box xattr is enabled.
> Would Jan confirm that SUSE also use it by default?

I'm pretty sure SuSE enables it, since SELinux requires it, and SuSE
supports it.

I'm more concerned with various embedded use cases, which is why I
measured how much additional text/data space xattr support enables
(which was only 27k, so I doubt that would be an issue in most
embedded use cases --- hmm.... I've just checked a Nexus 4 kernel
config and it enables CONFIG_FS_EXT4_XATTR; I'm not sure Android is
actually using xattrs at all at the moment, but it's certainly
enabled).

- Ted

2012-12-06 10:27:00

by Jan Kara

[permalink] [raw]
Subject: Re: RFC: remove CONFIG_EXT4_FS_XATTR

On Thu 06-12-12 09:33:10, Tao Ma wrote:
> On 12/06/2012 06:35 AM, Theodore Ts'o wrote:
> >
> > The number of build warnings that were generated with the inline data
> > patch makes me think that perhaps we should just remove
> > CONFIG_EXT4_FS_XATTR. Turning off CONFIG_EXT4_FS_XATTR causes a net
> > decrease in the ext4 file system by 27k (about 7.3% if ext4 is built as
> > a module; the entire compiled kernel's text+data size for my
> > all-in-one-no-modules-for-kvm-testing is 19 megabytes).
> >
> > Another advantage of making this change is with the inline data option,
> > if you turn off CONFIG_EXT4_FS_XATTR, it will still allow a file system
> > with inline_data to be mounted, but then attempts to read small files or
> > small directories will end up returning EOPNOTSUPP, which will be
> > surprising to end users in a very serious way. (Assuming it works at
> > all; I haven't tested to make sure it fails cleanly, and I'm not sure
> > Tao has tested that case either; so easing our test matrix is another
> > reason why removing this config option would be helpful.)
> To be frank, I didn't try the inline data test without xattr support. So
> that would be great if we remove it. :)
>
> btw, does any distribution disable xattr support during kernel build? As
> Eric said on behalf of redhat, and in my ubuntu box xattr is enabled.
> Would Jan confirm that SUSE also use it by default?
Yes, we enable xattrs in all our kernel configs... BTW +1 from me for
removing the config option.

Honza
--
Jan Kara <[email protected]>
SUSE Labs, CR

2012-12-06 19:28:06

by David Brown

[permalink] [raw]
Subject: Re: RFC: remove CONFIG_EXT4_FS_XATTR

On Wed, Dec 05, 2012 at 10:48:42PM -0500, Theodore Ts'o wrote:
> On Thu, Dec 06, 2012 at 09:33:10AM +0800, Tao Ma wrote:
> > To be frank, I didn't try the inline data test without xattr support. So
> > that would be great if we remove it. :)
> >
> > btw, does any distribution disable xattr support during kernel build? As
> > Eric said on behalf of redhat, and in my ubuntu box xattr is enabled.
> > Would Jan confirm that SUSE also use it by default?
>
> I'm pretty sure SuSE enables it, since SELinux requires it, and SuSE
> supports it.
>
> I'm more concerned with various embedded use cases, which is why I
> measured how much additional text/data space xattr support enables
> (which was only 27k, so I doubt that would be an issue in most
> embedded use cases --- hmm.... I've just checked a Nexus 4 kernel
> config and it enables CONFIG_FS_EXT4_XATTR; I'm not sure Android is
> actually using xattrs at all at the moment, but it's certainly
> enabled).

As far as I know, it's enabled in all Android kernels that use ext4.
(at least once I grepped for CONFIG_EXT4_FS_XATTR)

Arch linux has started using capabilities in some packages, which will
also require this.

David

--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

2012-12-10 06:19:46

by Tao Ma

[permalink] [raw]
Subject: [PATCH] ext4: Remove CONFIG_EXT4_FS_XATTR.

From: Tao Ma <[email protected]>

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.

Cc: David Brown <[email protected]>
Cc: Jan Kara <[email protected]>
Cc: Eric Sandeen <[email protected]>
Cc: "Theodore Ts'o" <[email protected]>
Signed-off-by: Tao Ma <[email protected]>
---
fs/ext4/Kconfig | 15 ----
fs/ext4/Makefile | 4 +-
fs/ext4/ext4.h | 2 -
fs/ext4/file.c | 2 -
fs/ext4/namei.c | 4 -
fs/ext4/super.c | 7 --
fs/ext4/symlink.c | 4 -
fs/ext4/xattr.h | 236 -----------------------------------------------------
8 files changed, 1 insertions(+), 273 deletions(-)

diff --git a/fs/ext4/Kconfig b/fs/ext4/Kconfig
index c22f170..0a475c8 100644
--- a/fs/ext4/Kconfig
+++ b/fs/ext4/Kconfig
@@ -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
diff --git a/fs/ext4/Makefile b/fs/ext4/Makefile
index e88b7a6..2eea427 100644
--- a/fs/ext4/Makefile
+++ b/fs/ext4/Makefile
@@ -7,8 +7,6 @@ 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
-
-ext4-$(CONFIG_EXT4_FS_XATTR) += xattr.o xattr_user.o xattr_trusted.o inline.o
+ mmp.o indirect.o 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
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 2dd5824..b380147 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -835,7 +835,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
@@ -844,7 +843,6 @@ struct ext4_inode_info {
* EAs.
*/
struct rw_semaphore xattr_sem;
-#endif

struct list_head i_orphan; /* unlinked but open inodes */

diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index bf3966b..dcda329 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -326,12 +326,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,
};
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index adf309b..b099b4c 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -3209,23 +3209,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,
};
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 80928f7..1de7ebc 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -996,9 +996,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);
}
@@ -1447,13 +1445,10 @@ 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},
@@ -3369,9 +3364,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
diff --git a/fs/ext4/symlink.c b/fs/ext4/symlink.c
index ed9354a..ff37119 100644
--- a/fs/ext4/symlink.c
+++ b/fs/ext4/symlink.c
@@ -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
};
diff --git a/fs/ext4/xattr.h b/fs/ext4/xattr.h
index f959e6c..c33fa41 100644
--- a/fs/ext4/xattr.h
+++ b/fs/ext4/xattr.h
@@ -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,240 +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(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;
-}

2012-12-10 10:08:23

by Jan Kara

[permalink] [raw]
Subject: Re: [PATCH] ext4: Remove CONFIG_EXT4_FS_XATTR.

On Mon 10-12-12 14:19:08, Tao Ma wrote:
> From: Tao Ma <[email protected]>
>
> 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.
>
> Cc: David Brown <[email protected]>
> Cc: Jan Kara <[email protected]>
> Cc: Eric Sandeen <[email protected]>
> Cc: "Theodore Ts'o" <[email protected]>
> Signed-off-by: Tao Ma <[email protected]>
The patch looks good. You can add:
Acked-by: Jan Kara <[email protected]>

Honza
> ---
> fs/ext4/Kconfig | 15 ----
> fs/ext4/Makefile | 4 +-
> fs/ext4/ext4.h | 2 -
> fs/ext4/file.c | 2 -
> fs/ext4/namei.c | 4 -
> fs/ext4/super.c | 7 --
> fs/ext4/symlink.c | 4 -
> fs/ext4/xattr.h | 236 -----------------------------------------------------
> 8 files changed, 1 insertions(+), 273 deletions(-)
>
> diff --git a/fs/ext4/Kconfig b/fs/ext4/Kconfig
> index c22f170..0a475c8 100644
> --- a/fs/ext4/Kconfig
> +++ b/fs/ext4/Kconfig
> @@ -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
> diff --git a/fs/ext4/Makefile b/fs/ext4/Makefile
> index e88b7a6..2eea427 100644
> --- a/fs/ext4/Makefile
> +++ b/fs/ext4/Makefile
> @@ -7,8 +7,6 @@ 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
> -
> -ext4-$(CONFIG_EXT4_FS_XATTR) += xattr.o xattr_user.o xattr_trusted.o inline.o
> + mmp.o indirect.o 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
> diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
> index 2dd5824..b380147 100644
> --- a/fs/ext4/ext4.h
> +++ b/fs/ext4/ext4.h
> @@ -835,7 +835,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
> @@ -844,7 +843,6 @@ struct ext4_inode_info {
> * EAs.
> */
> struct rw_semaphore xattr_sem;
> -#endif
>
> struct list_head i_orphan; /* unlinked but open inodes */
>
> diff --git a/fs/ext4/file.c b/fs/ext4/file.c
> index bf3966b..dcda329 100644
> --- a/fs/ext4/file.c
> +++ b/fs/ext4/file.c
> @@ -326,12 +326,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,
> };
> diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
> index adf309b..b099b4c 100644
> --- a/fs/ext4/namei.c
> +++ b/fs/ext4/namei.c
> @@ -3209,23 +3209,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,
> };
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index 80928f7..1de7ebc 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -996,9 +996,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);
> }
> @@ -1447,13 +1445,10 @@ 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},
> @@ -3369,9 +3364,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
> diff --git a/fs/ext4/symlink.c b/fs/ext4/symlink.c
> index ed9354a..ff37119 100644
> --- a/fs/ext4/symlink.c
> +++ b/fs/ext4/symlink.c
> @@ -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
> };
> diff --git a/fs/ext4/xattr.h b/fs/ext4/xattr.h
> index f959e6c..c33fa41 100644
> --- a/fs/ext4/xattr.h
> +++ b/fs/ext4/xattr.h
> @@ -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,240 +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(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,
> --
> 1.7.1
>
--
Jan Kara <[email protected]>
SUSE Labs, CR

2012-12-10 15:11:24

by Tao Ma

[permalink] [raw]
Subject: [PATCH V2] ext4: Remove CONFIG_EXT4_FS_XATTR.

From: Tao Ma <[email protected]>

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.

Cc: David Brown <[email protected]>
Acked-by: Jan Kara <[email protected]>
Cc: Eric Sandeen <[email protected]>
Cc: "Theodore Ts'o" <[email protected]>
Signed-off-by: Tao Ma <[email protected]>
---
Rebase to ext4.git/dev and remove another part I forgot to remove in V1.

fs/ext4/Kconfig | 15 ----
fs/ext4/Makefile | 5 +-
fs/ext4/ext4.h | 2 -
fs/ext4/file.c | 2 -
fs/ext4/namei.c | 4 -
fs/ext4/super.c | 9 --
fs/ext4/symlink.c | 4 -
fs/ext4/xattr.h | 235 -----------------------------------------------------
8 files changed, 2 insertions(+), 274 deletions(-)

diff --git a/fs/ext4/Kconfig b/fs/ext4/Kconfig
index c22f170..0a475c8 100644
--- a/fs/ext4/Kconfig
+++ b/fs/ext4/Kconfig
@@ -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
diff --git a/fs/ext4/Makefile b/fs/ext4/Makefile
index 3d96d56..b4b2a66 100644
--- a/fs/ext4/Makefile
+++ b/fs/ext4/Makefile
@@ -7,8 +7,7 @@ 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
-
-ext4-$(CONFIG_EXT4_FS_XATTR) += xattr.o xattr_user.o xattr_trusted.o inline.o
+ mmp.o indirect.o extents_status.o \
+ 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
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index b90e272..e20dc38 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -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 */

diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index 2f5759e..b64a60b 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -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,
};
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index b37c218..cac4482 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -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,
};
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index e1e216f..7d53adf 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -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
diff --git a/fs/ext4/symlink.c b/fs/ext4/symlink.c
index ed9354a..ff37119 100644
--- a/fs/ext4/symlink.c
+++ b/fs/ext4/symlink.c
@@ -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
};
diff --git a/fs/ext4/xattr.h b/fs/ext4/xattr.h
index 67ce7df..c33fa41 100644
--- a/fs/ext4/xattr.h
+++ b/fs/ext4/xattr.h
@@ -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(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;
-}

2012-12-10 19:21:47

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [PATCH] ext4: Remove CONFIG_EXT4_FS_XATTR.

Applied, with some minor fixups so it works with the extents_status
tree patches, and also to fix a buglet which in fs/ext4/super.c:

> @@ -1447,13 +1445,10 @@ 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

The table entries between the #else and #endif in the above patch
chunlk needs to be removed as well.

I've fixed this in my tree.

Regards,

- Ted