]> www.infradead.org Git - mtd-utils.git/commitdiff
Add xseqno into jffs2_raw_xref on mkfs.jffs2
authorKaiGai Kohei <kaigai@kaigai.gr.jp>
Mon, 7 Aug 2006 14:13:32 +0000 (09:13 -0500)
committerJosh Boyer <jwboyer@gmail.com>
Mon, 7 Aug 2006 14:13:32 +0000 (09:13 -0500)
Signed-off-by: KaiGai Kohei <kaigai@ak.jp.nec.com>
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
include/linux/jffs2.h
mkfs.jffs2.c

index 2cac60e55322a8f408bfb106dc6b59c6a1b0918c..8fc99e5628b821a6b14410051f760251cfb01def 100644 (file)
@@ -186,6 +186,7 @@ struct jffs2_raw_xref
        jint32_t hdr_crc;
        jint32_t ino;           /* inode number */
        jint32_t xid;           /* XATTR identifier number */
+       jint32_t xseqno;        /* xref sequencial number */
        jint32_t node_crc;
 } __attribute__((packed));
 
index fa4a5f39a64939fb8b9e197e779fde90af4d23de..c460a7b56af6441c2b5413dedf446a485d7de2c7 100644 (file)
@@ -1038,6 +1038,7 @@ typedef struct xattr_entry {
 #define XATTR_BUFFER_SIZE              (64 * 1024)     /* 64KB */
 static uint32_t enable_xattr = 0;
 static uint32_t highest_xid = 0;
+static uint32_t highest_xseqno = 0;
 
 static struct {
        int xprefix;
@@ -1244,6 +1245,7 @@ static void write_xattr_entry(struct filesystem_entry *e)
                ref.hdr_crc = cpu_to_je32(crc32(0, &ref, sizeof(struct jffs2_unknown_node) - 4));
                ref.ino = cpu_to_je32(e->sb.st_ino);
                ref.xid = cpu_to_je32(xe->xid);
+               ref.xseqno = cpu_to_je32(highest_xseqno += 2);
                ref.node_crc = cpu_to_je32(crc32(0, &ref, sizeof(ref) - 4));
 
                pad_block_if_less_than(sizeof(ref));