[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 <dwmw2@infradead.org>
diff --git a/fs/jffs2/xattr.c b/fs/jffs2/xattr.c
index 057bd4d..e16f846 100644
--- a/fs/jffs2/xattr.c
+++ b/fs/jffs2/xattr.c
@@ -322,8 +322,6 @@
 	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 @@
 		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 @@
 	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 @@
 		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 @@
 	}
 	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;