diff options
author | KaiGai Kohei <kaigai@ak.jp.nec.com> | 2006-06-23 20:14:13 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2006-06-27 11:18:02 -0400 |
commit | 8a13695cbe4e8311b363f9bd25162904b984ca74 (patch) | |
tree | 2ff6ecca99d5b6185e1b3df0f3ab1447a3fdff9b /fs/jffs2/xattr.h | |
parent | a1ae76e96a18edf4b8a4d4e102762060c26d1c6a (diff) |
[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/xattr.h')
-rw-r--r-- | fs/jffs2/xattr.h | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/fs/jffs2/xattr.h b/fs/jffs2/xattr.h index 06ab7b880212..4a10abc6d917 100644 --- a/fs/jffs2/xattr.h +++ b/fs/jffs2/xattr.h | |||
@@ -16,6 +16,7 @@ | |||
16 | 16 | ||
17 | #define JFFS2_XFLAGS_HOT (0x01) /* This datum is HOT */ | 17 | #define JFFS2_XFLAGS_HOT (0x01) /* This datum is HOT */ |
18 | #define JFFS2_XFLAGS_BIND (0x02) /* This datum is not reclaimed */ | 18 | #define JFFS2_XFLAGS_BIND (0x02) /* This datum is not reclaimed */ |
19 | #define JFFS2_XFLAGS_DEAD (0x40) /* This datum is already dead */ | ||
19 | #define JFFS2_XFLAGS_INVALID (0x80) /* This datum contains crc error */ | 20 | #define JFFS2_XFLAGS_INVALID (0x80) /* This datum contains crc error */ |
20 | 21 | ||
21 | struct jffs2_xattr_datum | 22 | struct jffs2_xattr_datum |
@@ -60,34 +61,12 @@ struct jffs2_xattr_ref | |||
60 | struct jffs2_xattr_ref *next; /* chained from ic->xref_list */ | 61 | struct jffs2_xattr_ref *next; /* chained from ic->xref_list */ |
61 | }; | 62 | }; |
62 | 63 | ||
63 | #define XDATUM_DELETE_MARKER (0xffffffff) | ||
64 | #define XREF_DELETE_MARKER (0x00000001) | 64 | #define XREF_DELETE_MARKER (0x00000001) |
65 | static inline int is_xattr_datum_dead(struct jffs2_xattr_datum *xd) | ||
66 | { | ||
67 | return (xd->version == XDATUM_DELETE_MARKER); | ||
68 | } | ||
69 | |||
70 | static inline void set_xattr_datum_dead(struct jffs2_xattr_datum *xd) | ||
71 | { | ||
72 | xd->version = XDATUM_DELETE_MARKER; | ||
73 | } | ||
74 | |||
75 | static inline int is_xattr_ref_dead(struct jffs2_xattr_ref *ref) | 65 | static inline int is_xattr_ref_dead(struct jffs2_xattr_ref *ref) |
76 | { | 66 | { |
77 | return ((ref->xseqno & XREF_DELETE_MARKER) != 0); | 67 | return ((ref->xseqno & XREF_DELETE_MARKER) != 0); |
78 | } | 68 | } |
79 | 69 | ||
80 | static inline void set_xattr_ref_dead(struct jffs2_xattr_ref *ref) | ||
81 | { | ||
82 | ref->xseqno |= XREF_DELETE_MARKER; | ||
83 | } | ||
84 | |||
85 | static inline void clr_xattr_ref_dead(struct jffs2_xattr_ref *ref) | ||
86 | { | ||
87 | ref->xseqno &= ~XREF_DELETE_MARKER; | ||
88 | } | ||
89 | |||
90 | |||
91 | #ifdef CONFIG_JFFS2_FS_XATTR | 70 | #ifdef CONFIG_JFFS2_FS_XATTR |
92 | 71 | ||
93 | extern void jffs2_init_xattr_subsystem(struct jffs2_sb_info *c); | 72 | extern void jffs2_init_xattr_subsystem(struct jffs2_sb_info *c); |