From b64335f2b740d6f5dbf5d3b04af30d407bf599f5 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Sun, 21 May 2006 04:36:45 +0100 Subject: [JFFS2] Add length argument to jffs2_add_physical_node_ref() If __totlen is going away, we need to pass the length in separately. Also stop callers from needlessly setting ref->next_phys to NULL, since that's done for them... and since that'll also be going away soon. Signed-off-by: David Woodhouse --- fs/jffs2/xattr.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'fs/jffs2/xattr.c') diff --git a/fs/jffs2/xattr.c b/fs/jffs2/xattr.c index 057bd4dcf66..e16f8460ff0 100644 --- a/fs/jffs2/xattr.c +++ b/fs/jffs2/xattr.c @@ -322,8 +322,6 @@ static int save_xattr_datum(struct jffs2_sb_info *c, struct jffs2_xattr_datum *x if (!raw) return -ENOMEM; raw->flash_offset = phys_ofs; - raw->__totlen = PAD(totlen); - raw->next_phys = NULL; raw->next_in_ino = (void *)xd; /* Setup raw-xattr */ @@ -348,17 +346,17 @@ static int save_xattr_datum(struct jffs2_sb_info *c, struct jffs2_xattr_datum *x if (length) { raw->flash_offset |= REF_OBSOLETE; raw->next_in_ino = NULL; - jffs2_add_physical_node_ref(c, raw); + jffs2_add_physical_node_ref(c, raw, PAD(totlen)); jffs2_mark_node_obsolete(c, raw); } else { jffs2_free_raw_node_ref(raw); } return rc; } - BUG_ON(raw->__totlen < sizeof(struct jffs2_raw_xattr)); + /* success */ raw->flash_offset |= REF_PRISTINE; - jffs2_add_physical_node_ref(c, raw); + jffs2_add_physical_node_ref(c, raw, PAD(totlen)); if (xd->node) delete_xattr_datum_node(c, xd); xd->node = raw; @@ -568,8 +566,6 @@ static int save_xattr_ref(struct jffs2_sb_info *c, struct jffs2_xattr_ref *ref, if (!raw) return -ENOMEM; raw->flash_offset = phys_ofs; - raw->__totlen = PAD(sizeof(rr)); - raw->next_phys = NULL; raw->next_in_ino = (void *)ref; rr.magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); @@ -589,7 +585,7 @@ static int save_xattr_ref(struct jffs2_sb_info *c, struct jffs2_xattr_ref *ref, if (length) { raw->flash_offset |= REF_OBSOLETE; raw->next_in_ino = NULL; - jffs2_add_physical_node_ref(c, raw); + jffs2_add_physical_node_ref(c, raw, PAD(sizeof(rr))); jffs2_mark_node_obsolete(c, raw); } else { jffs2_free_raw_node_ref(raw); @@ -598,7 +594,7 @@ static int save_xattr_ref(struct jffs2_sb_info *c, struct jffs2_xattr_ref *ref, } raw->flash_offset |= REF_PRISTINE; - jffs2_add_physical_node_ref(c, raw); + jffs2_add_physical_node_ref(c, raw, PAD(sizeof(rr))); if (ref->node) delete_xattr_ref_node(c, ref); ref->node = raw; -- cgit v1.2.3