diff options
author | KaiGai Kohei <kaigai@ak.jp.nec.com> | 2006-06-24 02:14:13 +0200 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2006-06-27 17:18:02 +0200 |
commit | 8a13695cbe4e8311b363f9bd25162904b984ca74 (patch) | |
tree | 2ff6ecca99d5b6185e1b3df0f3ab1447a3fdff9b /fs/jffs2/scan.c | |
parent | [JFFS2][XATTR] Fix ACL bug when updating null xattr by null ACL. (diff) | |
download | linux-8a13695cbe4e8311b363f9bd25162904b984ca74.tar.xz linux-8a13695cbe4e8311b363f9bd25162904b984ca74.zip |
[JFFS2][XATTR] rid unnecessary writing of delete marker.
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>
Diffstat (limited to 'fs/jffs2/scan.c')
-rw-r--r-- | fs/jffs2/scan.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c index 79638f56c5ea..2bfdc33752d3 100644 --- a/fs/jffs2/scan.c +++ b/fs/jffs2/scan.c @@ -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); |