aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/xattr.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2006-05-20 23:36:45 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2006-05-20 23:36:45 -0400
commitb64335f2b740d6f5dbf5d3b04af30d407bf599f5 (patch)
tree442e85ebc977f8d01bf9c1fe6dfbe898788422c5 /fs/jffs2/xattr.c
parent49f11d40751b974f3b829f208eefa6f97a10cac8 (diff)
[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>
Diffstat (limited to 'fs/jffs2/xattr.c')
-rw-r--r--fs/jffs2/xattr.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/fs/jffs2/xattr.c b/fs/jffs2/xattr.c
index 057bd4dcf665..e16f8460ff04 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
322 if (!raw) 322 if (!raw)
323 return -ENOMEM; 323 return -ENOMEM;
324 raw->flash_offset = phys_ofs; 324 raw->flash_offset = phys_ofs;
325 raw->__totlen = PAD(totlen);
326 raw->next_phys = NULL;
327 raw->next_in_ino = (void *)xd; 325 raw->next_in_ino = (void *)xd;
328 326
329 /* Setup raw-xattr */ 327 /* Setup raw-xattr */
@@ -348,17 +346,17 @@ static int save_xattr_datum(struct jffs2_sb_info *c, struct jffs2_xattr_datum *x
348 if (length) { 346 if (length) {
349 raw->flash_offset |= REF_OBSOLETE; 347 raw->flash_offset |= REF_OBSOLETE;
350 raw->next_in_ino = NULL; 348 raw->next_in_ino = NULL;
351 jffs2_add_physical_node_ref(c, raw); 349 jffs2_add_physical_node_ref(c, raw, PAD(totlen));
352 jffs2_mark_node_obsolete(c, raw); 350 jffs2_mark_node_obsolete(c, raw);
353 } else { 351 } else {
354 jffs2_free_raw_node_ref(raw); 352 jffs2_free_raw_node_ref(raw);
355 } 353 }
356 return rc; 354 return rc;
357 } 355 }
358 BUG_ON(raw->__totlen < sizeof(struct jffs2_raw_xattr)); 356
359 /* success */ 357 /* success */
360 raw->flash_offset |= REF_PRISTINE; 358 raw->flash_offset |= REF_PRISTINE;
361 jffs2_add_physical_node_ref(c, raw); 359 jffs2_add_physical_node_ref(c, raw, PAD(totlen));
362 if (xd->node) 360 if (xd->node)
363 delete_xattr_datum_node(c, xd); 361 delete_xattr_datum_node(c, xd);
364 xd->node = raw; 362 xd->node = raw;
@@ -568,8 +566,6 @@ static int save_xattr_ref(struct jffs2_sb_info *c, struct jffs2_xattr_ref *ref,
568 if (!raw) 566 if (!raw)
569 return -ENOMEM; 567 return -ENOMEM;
570 raw->flash_offset = phys_ofs; 568 raw->flash_offset = phys_ofs;
571 raw->__totlen = PAD(sizeof(rr));
572 raw->next_phys = NULL;
573 raw->next_in_ino = (void *)ref; 569 raw->next_in_ino = (void *)ref;
574 570
575 rr.magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); 571 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,
589 if (length) { 585 if (length) {
590 raw->flash_offset |= REF_OBSOLETE; 586 raw->flash_offset |= REF_OBSOLETE;
591 raw->next_in_ino = NULL; 587 raw->next_in_ino = NULL;
592 jffs2_add_physical_node_ref(c, raw); 588 jffs2_add_physical_node_ref(c, raw, PAD(sizeof(rr)));
593 jffs2_mark_node_obsolete(c, raw); 589 jffs2_mark_node_obsolete(c, raw);
594 } else { 590 } else {
595 jffs2_free_raw_node_ref(raw); 591 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,
598 } 594 }
599 raw->flash_offset |= REF_PRISTINE; 595 raw->flash_offset |= REF_PRISTINE;
600 596
601 jffs2_add_physical_node_ref(c, raw); 597 jffs2_add_physical_node_ref(c, raw, PAD(sizeof(rr)));
602 if (ref->node) 598 if (ref->node)
603 delete_xattr_ref_node(c, ref); 599 delete_xattr_ref_node(c, ref);
604 ref->node = raw; 600 ref->node = raw;