From aa98d7cf59b5b0764d3502662053489585faf2fe Mon Sep 17 00:00:00 2001 From: KaiGai Kohei Date: Sat, 13 May 2006 15:09:47 +0900 Subject: [JFFS2][XATTR] XATTR support on JFFS2 (version. 5) This attached patches provide xattr support including POSIX-ACL and SELinux support on JFFS2 (version.5). There are some significant differences from previous version posted at last December. The biggest change is addition of EBS(Erase Block Summary) support. Currently, both kernel and usermode utility (sumtool) can recognize xattr nodes which have JFFS2_NODETYPE_XATTR/_XREF nodetype. In addition, some bugs are fixed. - A potential race condition was fixed. - Unexpected fail when updating a xattr by same name/value pair was fixed. - A bug when removing xattr name/value pair was fixed. The fundamental structures (such as using two new nodetypes and exclusion mechanism by rwsem) are unchanged. But most of implementation were reviewed and updated if necessary. Espacially, we had to change several internal implementations related to load_xattr_datum() to avoid a potential race condition. [1/2] xattr_on_jffs2.kernel.version-5.patch [2/2] xattr_on_jffs2.utils.version-5.patch Signed-off-by: KaiGai Kohei Signed-off-by: David Woodhouse --- fs/jffs2/acl.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 fs/jffs2/acl.h (limited to 'fs/jffs2/acl.h') diff --git a/fs/jffs2/acl.h b/fs/jffs2/acl.h new file mode 100644 index 00000000000..c98610b4e81 --- /dev/null +++ b/fs/jffs2/acl.h @@ -0,0 +1,46 @@ +/*-------------------------------------------------------------------------* + * File: fs/jffs2/acl.h + * POSIX ACL support on JFFS2 FileSystem + * + * Implemented by KaiGai Kohei + * Copyright (C) 2006 NEC Corporation + * + * For licensing information, see the file 'LICENCE' in the jffs2 directory. + *-------------------------------------------------------------------------*/ +typedef struct { + jint16_t e_tag; + jint16_t e_perm; + jint32_t e_id; +} jffs2_acl_entry; + +typedef struct { + jint16_t e_tag; + jint16_t e_perm; +} jffs2_acl_entry_short; + +typedef struct { + jint32_t a_version; +} jffs2_acl_header; + +#ifdef __KERNEL__ +#ifdef CONFIG_JFFS2_FS_POSIX_ACL + +#define JFFS2_ACL_NOT_CACHED ((void *)-1) + +extern int jffs2_permission(struct inode *, int, struct nameidata *); +extern int jffs2_acl_chmod(struct inode *); +extern int jffs2_init_acl(struct inode *, struct inode *); +extern void jffs2_clear_acl(struct inode *); + +extern struct xattr_handler jffs2_acl_access_xattr_handler; +extern struct xattr_handler jffs2_acl_default_xattr_handler; + +#else + +#define jffs2_permission NULL +#define jffs2_acl_chmod(inode) (0) +#define jffs2_init_acl(inode,dir) (0) +#define jffs2_clear_acl(inode) + +#endif /* CONFIG_JFFS2_FS_POSIX_ACL */ +#endif /* __KERNEL__ */ -- cgit v1.2.3 From de1f72fab35d2b6215017690c6dc27b8f4aa14bc Mon Sep 17 00:00:00 2001 From: KaiGai Kohei Date: Sat, 13 May 2006 15:13:27 +0900 Subject: [JFFS2][XATTR] remove typedef from posix_acl related definition. jffs2_acl_header, jffs2_acl_entry and jffs2_acl_entry_short were redefined with using 'struct' instead of 'typedef' in kernel implementation. [1/10] jffs2-xattr-v5.1-01-remove_typedef_kernel.patch Signed-off-by: KaiGai Kohei --- fs/jffs2/acl.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'fs/jffs2/acl.h') diff --git a/fs/jffs2/acl.h b/fs/jffs2/acl.h index c98610b4e81..3f41e09200b 100644 --- a/fs/jffs2/acl.h +++ b/fs/jffs2/acl.h @@ -7,20 +7,20 @@ * * For licensing information, see the file 'LICENCE' in the jffs2 directory. *-------------------------------------------------------------------------*/ -typedef struct { +struct jffs2_acl_entry { jint16_t e_tag; jint16_t e_perm; jint32_t e_id; -} jffs2_acl_entry; +}; -typedef struct { +struct jffs2_acl_entry_short { jint16_t e_tag; jint16_t e_perm; -} jffs2_acl_entry_short; +}; -typedef struct { +struct jffs2_acl_header { jint32_t a_version; -} jffs2_acl_header; +}; #ifdef __KERNEL__ #ifdef CONFIG_JFFS2_FS_POSIX_ACL -- cgit v1.2.3 From 652ecc20d1f5b4fd745c185c940e5b3afb2a0711 Mon Sep 17 00:00:00 2001 From: KaiGai Kohei Date: Sat, 13 May 2006 15:18:27 +0900 Subject: [JFFS2][XATTR] Unify each file header part with any jffs2 file. Unify each file header part with any jffs2 file. [7/10] jffs2-xattr-v5.1-07-unify_file_header.patch Signed-off-by: KaiGai Kohei --- fs/jffs2/acl.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'fs/jffs2/acl.h') diff --git a/fs/jffs2/acl.h b/fs/jffs2/acl.h index 3f41e09200b..54761fa8f23 100644 --- a/fs/jffs2/acl.h +++ b/fs/jffs2/acl.h @@ -1,12 +1,13 @@ -/*-------------------------------------------------------------------------* - * File: fs/jffs2/acl.h - * POSIX ACL support on JFFS2 FileSystem +/* + * JFFS2 -- Journalling Flash File System, Version 2. * - * Implemented by KaiGai Kohei - * Copyright (C) 2006 NEC Corporation + * Copyright (C) 2006 NEC Corporation * - * For licensing information, see the file 'LICENCE' in the jffs2 directory. - *-------------------------------------------------------------------------*/ + * Created by KaiGai Kohei + * + * For licensing information, see the file 'LICENCE' in this directory. + * + */ struct jffs2_acl_entry { jint16_t e_tag; jint16_t e_perm; -- cgit v1.2.3 From 5a14959c0700cd389d9e7ba312e15c8e85255e1f Mon Sep 17 00:00:00 2001 From: KaiGai Kohei Date: Sat, 13 May 2006 15:19:36 +0900 Subject: [JFFS2][XATTR] remove '__KERNEL__' from acl.h [9/10] jffs2-xattr-v5.1-09-remove__KERNEL__.patch Signed-off-by: KaiGai Kohei --- fs/jffs2/acl.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'fs/jffs2/acl.h') diff --git a/fs/jffs2/acl.h b/fs/jffs2/acl.h index 54761fa8f23..8893bd1a6ba 100644 --- a/fs/jffs2/acl.h +++ b/fs/jffs2/acl.h @@ -23,7 +23,6 @@ struct jffs2_acl_header { jint32_t a_version; }; -#ifdef __KERNEL__ #ifdef CONFIG_JFFS2_FS_POSIX_ACL #define JFFS2_ACL_NOT_CACHED ((void *)-1) @@ -44,4 +43,3 @@ extern struct xattr_handler jffs2_acl_default_xattr_handler; #define jffs2_clear_acl(inode) #endif /* CONFIG_JFFS2_FS_POSIX_ACL */ -#endif /* __KERNEL__ */ -- cgit v1.2.3