diff options
Diffstat (limited to 'fs/jffs2/xattr.h')
-rw-r--r-- | fs/jffs2/xattr.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/fs/jffs2/xattr.h b/fs/jffs2/xattr.h index 2c199856c582..06a5c69dcf8b 100644 --- a/fs/jffs2/xattr.h +++ b/fs/jffs2/xattr.h | |||
@@ -16,6 +16,8 @@ | |||
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 */ | ||
20 | #define JFFS2_XFLAGS_INVALID (0x80) /* This datum contains crc error */ | ||
19 | 21 | ||
20 | struct jffs2_xattr_datum | 22 | struct jffs2_xattr_datum |
21 | { | 23 | { |
@@ -23,10 +25,10 @@ struct jffs2_xattr_datum | |||
23 | struct jffs2_raw_node_ref *node; | 25 | struct jffs2_raw_node_ref *node; |
24 | uint8_t class; | 26 | uint8_t class; |
25 | uint8_t flags; | 27 | uint8_t flags; |
26 | uint16_t xprefix; /* see JFFS2_XATTR_PREFIX_* */ | 28 | uint16_t xprefix; /* see JFFS2_XATTR_PREFIX_* */ |
27 | 29 | ||
28 | struct list_head xindex; /* chained from c->xattrindex[n] */ | 30 | struct list_head xindex; /* chained from c->xattrindex[n] */ |
29 | uint32_t refcnt; /* # of xattr_ref refers this */ | 31 | atomic_t refcnt; /* # of xattr_ref refers this */ |
30 | uint32_t xid; | 32 | uint32_t xid; |
31 | uint32_t version; | 33 | uint32_t version; |
32 | 34 | ||
@@ -47,6 +49,7 @@ struct jffs2_xattr_ref | |||
47 | uint8_t flags; /* Currently unused */ | 49 | uint8_t flags; /* Currently unused */ |
48 | u16 unused; | 50 | u16 unused; |
49 | 51 | ||
52 | uint32_t xseqno; | ||
50 | union { | 53 | union { |
51 | struct jffs2_inode_cache *ic; /* reference to jffs2_inode_cache */ | 54 | struct jffs2_inode_cache *ic; /* reference to jffs2_inode_cache */ |
52 | uint32_t ino; /* only used in scanning/building */ | 55 | uint32_t ino; /* only used in scanning/building */ |
@@ -58,6 +61,12 @@ struct jffs2_xattr_ref | |||
58 | struct jffs2_xattr_ref *next; /* chained from ic->xref_list */ | 61 | struct jffs2_xattr_ref *next; /* chained from ic->xref_list */ |
59 | }; | 62 | }; |
60 | 63 | ||
64 | #define XREF_DELETE_MARKER (0x00000001) | ||
65 | static inline int is_xattr_ref_dead(struct jffs2_xattr_ref *ref) | ||
66 | { | ||
67 | return ((ref->xseqno & XREF_DELETE_MARKER) != 0); | ||
68 | } | ||
69 | |||
61 | #ifdef CONFIG_JFFS2_FS_XATTR | 70 | #ifdef CONFIG_JFFS2_FS_XATTR |
62 | 71 | ||
63 | extern void jffs2_init_xattr_subsystem(struct jffs2_sb_info *c); | 72 | extern void jffs2_init_xattr_subsystem(struct jffs2_sb_info *c); |
@@ -70,9 +79,13 @@ extern struct jffs2_xattr_datum *jffs2_setup_xattr_datum(struct jffs2_sb_info *c | |||
70 | extern void jffs2_xattr_delete_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic); | 79 | extern void jffs2_xattr_delete_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic); |
71 | extern void jffs2_xattr_free_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic); | 80 | extern void jffs2_xattr_free_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic); |
72 | 81 | ||
73 | extern int jffs2_garbage_collect_xattr_datum(struct jffs2_sb_info *c, struct jffs2_xattr_datum *xd); | 82 | extern int jffs2_garbage_collect_xattr_datum(struct jffs2_sb_info *c, struct jffs2_xattr_datum *xd, |
74 | extern int jffs2_garbage_collect_xattr_ref(struct jffs2_sb_info *c, struct jffs2_xattr_ref *ref); | 83 | struct jffs2_raw_node_ref *raw); |
84 | extern int jffs2_garbage_collect_xattr_ref(struct jffs2_sb_info *c, struct jffs2_xattr_ref *ref, | ||
85 | struct jffs2_raw_node_ref *raw); | ||
75 | extern int jffs2_verify_xattr(struct jffs2_sb_info *c); | 86 | extern int jffs2_verify_xattr(struct jffs2_sb_info *c); |
87 | extern void jffs2_release_xattr_datum(struct jffs2_sb_info *c, struct jffs2_xattr_datum *xd); | ||
88 | extern void jffs2_release_xattr_ref(struct jffs2_sb_info *c, struct jffs2_xattr_ref *ref); | ||
76 | 89 | ||
77 | extern int do_jffs2_getxattr(struct inode *inode, int xprefix, const char *xname, | 90 | extern int do_jffs2_getxattr(struct inode *inode, int xprefix, const char *xname, |
78 | char *buffer, size_t size); | 91 | char *buffer, size_t size); |