aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/nodelist.h
diff options
context:
space:
mode:
authorKaiGai Kohei <kaigai@ak.jp.nec.com>2006-05-13 02:09:47 -0400
committerKaiGai Kohei <kaigai@ak.jp.nec.com>2006-05-13 02:09:47 -0400
commitaa98d7cf59b5b0764d3502662053489585faf2fe (patch)
treee98e83f3e69ebe3a1112394a19d440419e899749 /fs/jffs2/nodelist.h
parent4992a9e88886b0c5ebc3d27eb74d0344c873eeea (diff)
[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 <kaigai@ak.jp.nec.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'fs/jffs2/nodelist.h')
-rw-r--r--fs/jffs2/nodelist.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/fs/jffs2/nodelist.h b/fs/jffs2/nodelist.h
index f6645afe88e4..6f6279cf4909 100644
--- a/fs/jffs2/nodelist.h
+++ b/fs/jffs2/nodelist.h
@@ -20,6 +20,8 @@
20#include <linux/jffs2.h> 20#include <linux/jffs2.h>
21#include "jffs2_fs_sb.h" 21#include "jffs2_fs_sb.h"
22#include "jffs2_fs_i.h" 22#include "jffs2_fs_i.h"
23#include "xattr.h"
24#include "acl.h"
23#include "summary.h" 25#include "summary.h"
24 26
25#ifdef __ECOS 27#ifdef __ECOS
@@ -107,11 +109,16 @@ struct jffs2_inode_cache {
107 temporary lists of dirents, and later must be set to 109 temporary lists of dirents, and later must be set to
108 NULL to mark the end of the raw_node_ref->next_in_ino 110 NULL to mark the end of the raw_node_ref->next_in_ino
109 chain. */ 111 chain. */
112 u8 class; /* It's used for identification */
113 u8 flags;
114 uint16_t state;
110 struct jffs2_inode_cache *next; 115 struct jffs2_inode_cache *next;
111 struct jffs2_raw_node_ref *nodes; 116 struct jffs2_raw_node_ref *nodes;
112 uint32_t ino; 117 uint32_t ino;
113 int nlink; 118 int nlink;
114 int state; 119#ifdef CONFIG_JFFS2_FS_XATTR
120 struct list_head ilist;
121#endif
115}; 122};
116 123
117/* Inode states for 'state' above. We need the 'GC' state to prevent 124/* Inode states for 'state' above. We need the 'GC' state to prevent
@@ -125,6 +132,12 @@ struct jffs2_inode_cache {
125#define INO_STATE_READING 5 /* In read_inode() */ 132#define INO_STATE_READING 5 /* In read_inode() */
126#define INO_STATE_CLEARING 6 /* In clear_inode() */ 133#define INO_STATE_CLEARING 6 /* In clear_inode() */
127 134
135#define INO_FLAGS_XATTR_CHECKED 0x01 /* has no duplicate xattr_ref */
136
137#define RAWNODE_CLASS_INODE_CACHE 0
138#define RAWNODE_CLASS_XATTR_DATUM 1
139#define RAWNODE_CLASS_XATTR_REF 2
140
128#define INOCACHE_HASHSIZE 128 141#define INOCACHE_HASHSIZE 128
129 142
130/* 143/*
@@ -374,6 +387,12 @@ struct jffs2_node_frag *jffs2_alloc_node_frag(void);
374void jffs2_free_node_frag(struct jffs2_node_frag *); 387void jffs2_free_node_frag(struct jffs2_node_frag *);
375struct jffs2_inode_cache *jffs2_alloc_inode_cache(void); 388struct jffs2_inode_cache *jffs2_alloc_inode_cache(void);
376void jffs2_free_inode_cache(struct jffs2_inode_cache *); 389void jffs2_free_inode_cache(struct jffs2_inode_cache *);
390#ifdef CONFIG_JFFS2_FS_XATTR
391struct jffs2_xattr_datum *jffs2_alloc_xattr_datum(void);
392void jffs2_free_xattr_datum(struct jffs2_xattr_datum *);
393struct jffs2_xattr_ref *jffs2_alloc_xattr_ref(void);
394void jffs2_free_xattr_ref(struct jffs2_xattr_ref *);
395#endif
377 396
378/* gc.c */ 397/* gc.c */
379int jffs2_garbage_collect_pass(struct jffs2_sb_info *c); 398int jffs2_garbage_collect_pass(struct jffs2_sb_info *c);