Skip to content

Commit

Permalink
[JFFS2][XATTR] rid unnecessary writing of delete marker.
Browse files Browse the repository at this point in the history
In the followinf situation, an explicit delete marker is not
necessary, because we can certainlly detect those obsolete
xattr_datum or xattr_ref on next mounting.

- When to delete xattr_datum node.
- When to delete xattr_ref node on removing inode.
- When to delete xattr_ref node on updating xattr.

This patch rids writing delete marker in those situations.

Signed-off-by: KaiGai Kohei <kaigai@ak.jp.nec.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
  • Loading branch information
KaiGai Kohei authored and David Woodhouse committed Jun 27, 2006
1 parent a1ae76e commit 8a13695
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 227 deletions.
6 changes: 2 additions & 4 deletions fs/jffs2/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,8 @@ static int jffs2_scan_xattr_node(struct jffs2_sb_info *c, struct jffs2_erasebloc
xid = je32_to_cpu(rx->xid);
version = je32_to_cpu(rx->version);

totlen = sizeof(struct jffs2_raw_xattr);
if (version != XDATUM_DELETE_MARKER)
totlen += rx->name_len + 1 + je16_to_cpu(rx->value_len);
totlen = PAD(totlen);
totlen = PAD(sizeof(struct jffs2_raw_xattr)
+ rx->name_len + 1 + je16_to_cpu(rx->value_len));
if (totlen != je32_to_cpu(rx->totlen)) {
JFFS2_WARNING("node length mismatch at %#08x, read=%u, calc=%u\n",
ofs, je32_to_cpu(rx->totlen), totlen);
Expand Down
Loading

0 comments on commit 8a13695

Please sign in to comment.