Skip to contentSkip to conversation

Add the latest xattr support on mtd-utils

PATCH In review KaiGai Kohei 2 participants 4 messages Aug 6, 2006 – Aug 7, 2006 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add the latest xattr support on mtd-utils

Hi,

This patch enables to pack xattr informations for _recent_ xattr implementation.

When I posted a patch which enables to operate xattr on NAND flash by using delete marker at Jun, the format of xref node was a bit changed.
As 'xseqno' was added into struct jffs2_raw_xref, I ought to post a patch to modify it. But I left for posting.

Please apply it, Thanks.

Signature · 1 line
KaiGai Kohei <[email protected]>
include/linux/jffs2.h +1 -0
index 2cac60e..8fc99e5 100644
@@ -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));
 
mkfs.jffs2.c +2 -0
index fa4a5f3..c460a7b 100644
@@ -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 fil
 		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));
#1 lore raw
Quoted 5 lines · KaiGai Kohei

Hi,

This patch enables to pack xattr informations for _recent_ xattr implementation.

Quoted 7 lines

When I posted a patch which enables to operate xattr on NAND flash by using delete marker at Jun, the format of xref node was a bit changed.
As 'xseqno' was added into struct jffs2_raw_xref, I ought to post a patch to modify it. But I left for posting.

Please apply it, Thanks.

KaiGai-san,

The patch looks good, however could you please resend it with a
Signed-of-by: line?

thx,
josh

#2 lore raw
Quoted 4 lines

KaiGai-san,

The patch looks good, however could you please resend it with a
Signed-of-by: line?

OK, I'll resend it with Signed-off-by: line again.

Thanks,

[PAATH] Add 'xseqno' into jffs2_raw_xref on mkfs.jffs2

Signature · 3 lines
KaiGai Kohei <[email protected]>
              ^^^^^^^^^^^^^^^^^^^ <- Don't mind. I'm working
                                     in my house today. :D
include/linux/jffs2.h +1 -0
index 2cac60e..8fc99e5 100644
@@ -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));
 
mkfs.jffs2.c +2 -0
index fa4a5f3..c460a7b 100644
@@ -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 fil
 		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));
#3 lore raw
Quoted 6 lines · KaiGai Kohei
Quoted 4 lines

KaiGai-san,

The patch looks good, however could you please resend it with a
Signed-of-by: line?

OK, I'll resend it with Signed-off-by: line again.

Thank you. This has been committed.

josh