aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/jffs2.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 /include/linux/jffs2.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 'include/linux/jffs2.h')
-rw-r--r--include/linux/jffs2.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/include/linux/jffs2.h b/include/linux/jffs2.h
index cf792bb3c726..2cac60e55322 100644
--- a/include/linux/jffs2.h
+++ b/include/linux/jffs2.h
@@ -65,6 +65,18 @@
65 65
66#define JFFS2_NODETYPE_SUMMARY (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 6) 66#define JFFS2_NODETYPE_SUMMARY (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 6)
67 67
68#define JFFS2_NODETYPE_XATTR (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 8)
69#define JFFS2_NODETYPE_XREF (JFFS2_FEATURE_INCOMPAT | JFFS2_NODE_ACCURATE | 9)
70
71/* XATTR Related */
72#define JFFS2_XPREFIX_USER 1 /* for "user." */
73#define JFFS2_XPREFIX_SECURITY 2 /* for "security." */
74#define JFFS2_XPREFIX_ACL_ACCESS 3 /* for "system.posix_acl_access" */
75#define JFFS2_XPREFIX_ACL_DEFAULT 4 /* for "system.posix_acl_default" */
76#define JFFS2_XPREFIX_TRUSTED 5 /* for "trusted.*" */
77
78#define JFFS2_ACL_VERSION 0x0001
79
68// Maybe later... 80// Maybe later...
69//#define JFFS2_NODETYPE_CHECKPOINT (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3) 81//#define JFFS2_NODETYPE_CHECKPOINT (JFFS2_FEATURE_RWCOMPAT_DELETE | JFFS2_NODE_ACCURATE | 3)
70//#define JFFS2_NODETYPE_OPTIONS (JFFS2_FEATURE_RWCOMPAT_COPY | JFFS2_NODE_ACCURATE | 4) 82//#define JFFS2_NODETYPE_OPTIONS (JFFS2_FEATURE_RWCOMPAT_COPY | JFFS2_NODE_ACCURATE | 4)
@@ -151,6 +163,32 @@ struct jffs2_raw_inode
151 uint8_t data[0]; 163 uint8_t data[0];
152} __attribute__((packed)); 164} __attribute__((packed));
153 165
166struct jffs2_raw_xattr {
167 jint16_t magic;
168 jint16_t nodetype; /* = JFFS2_NODETYPE_XATTR */
169 jint32_t totlen;
170 jint32_t hdr_crc;
171 jint32_t xid; /* XATTR identifier number */
172 jint32_t version;
173 uint8_t xprefix;
174 uint8_t name_len;
175 jint16_t value_len;
176 jint32_t data_crc;
177 jint32_t node_crc;
178 uint8_t data[0];
179} __attribute__((packed));
180
181struct jffs2_raw_xref
182{
183 jint16_t magic;
184 jint16_t nodetype; /* = JFFS2_NODETYPE_XREF */
185 jint32_t totlen;
186 jint32_t hdr_crc;
187 jint32_t ino; /* inode number */
188 jint32_t xid; /* XATTR identifier number */
189 jint32_t node_crc;
190} __attribute__((packed));
191
154struct jffs2_raw_summary 192struct jffs2_raw_summary
155{ 193{
156 jint16_t magic; 194 jint16_t magic;
@@ -169,6 +207,8 @@ union jffs2_node_union
169{ 207{
170 struct jffs2_raw_inode i; 208 struct jffs2_raw_inode i;
171 struct jffs2_raw_dirent d; 209 struct jffs2_raw_dirent d;
210 struct jffs2_raw_xattr x;
211 struct jffs2_raw_xref r;
172 struct jffs2_raw_summary s; 212 struct jffs2_raw_summary s;
173 struct jffs2_unknown_node u; 213 struct jffs2_unknown_node u;
174}; 214};