Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 27853
b: refs/heads/master
c: 987d47b
h: refs/heads/master
i:
  27851: 79b653c
v: v3
  • Loading branch information
David Woodhouse committed May 22, 2006
1 parent 8ed457c commit 4203cb9
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0eac940b8a087576c66ecf8e0f294f2ceb3b607b
refs/heads/master: 987d47b71a85bd83dc40c870abee3b64f2002163
44 changes: 27 additions & 17 deletions trunk/fs/jffs2/nodelist.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@
struct jffs2_raw_node_ref
{
struct jffs2_raw_node_ref *next_in_ino; /* Points to the next raw_node_ref
for this inode. If this is the last, it points to the inode_cache
for this inode instead. The inode_cache will have NULL in the first
word so you know when you've got there :) */
for this object. If this _is_ the last, it points to the inode_cache,
xattr_ref or xattr_datum instead. The common part of those structures
has NULL in the first word. See jffs2_raw_ref_to_ic() below */
struct jffs2_raw_node_ref *next_phys;
uint32_t flash_offset;
#define TEST_TOTLEN
Expand All @@ -88,6 +88,18 @@ struct jffs2_raw_node_ref
#endif
};

static inline struct jffs2_inode_cache *jffs2_raw_ref_to_ic(struct jffs2_raw_node_ref *raw)
{
while(raw->next_in_ino) {
raw = raw->next_in_ino;
}

/* NB. This can be a jffs2_xattr_datum or jffs2_xattr_ref and
not actually a jffs2_inode_cache. Check ->class */
return ((struct jffs2_inode_cache *)raw);
}


/* flash_offset & 3 always has to be zero, because nodes are
always aligned at 4 bytes. So we have a couple of extra bits
to play with, which indicate the node's status; see below: */
Expand All @@ -113,20 +125,27 @@ struct jffs2_raw_node_ref
a pointer to the first physical node which is part of this inode, too.
*/
struct jffs2_inode_cache {
/* First part of structure is shared with other objects which
can terminate the raw node refs' next_in_ino list -- which
currently struct jffs2_xattr_datum and struct jffs2_xattr_ref. */

struct jffs2_full_dirent *scan_dents; /* Used during scan to hold
temporary lists of dirents, and later must be set to
NULL to mark the end of the raw_node_ref->next_in_ino
chain. */
u8 class; /* It's used for identification */
u8 flags;
uint16_t state;
struct jffs2_inode_cache *next;
struct jffs2_raw_node_ref *nodes;
uint8_t class; /* It's used for identification */

/* end of shared structure */

uint8_t flags;
uint16_t state;
uint32_t ino;
int nlink;
struct jffs2_inode_cache *next;
#ifdef CONFIG_JFFS2_FS_XATTR
struct jffs2_xattr_ref *xref;
#endif
int nlink;
};

/* Inode states for 'state' above. We need the 'GC' state to prevent
Expand Down Expand Up @@ -250,15 +269,6 @@ static inline int jffs2_encode_dev(union jffs2_device_node *jdev, dev_t rdev)
}
}

static inline struct jffs2_inode_cache *jffs2_raw_ref_to_ic(struct jffs2_raw_node_ref *raw)
{
while(raw->next_in_ino) {
raw = raw->next_in_ino;
}

return ((struct jffs2_inode_cache *)raw);
}

static inline struct jffs2_node_frag *frag_first(struct rb_root *root)
{
struct rb_node *node = root->rb_node;
Expand Down
14 changes: 7 additions & 7 deletions trunk/fs/jffs2/xattr.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
struct jffs2_xattr_datum
{
void *always_null;
u8 class;
u8 flags;
u16 xprefix; /* see JFFS2_XATTR_PREFIX_* */

struct jffs2_raw_node_ref *node;
uint8_t class;
uint8_t flags;
uint16_t xprefix; /* see JFFS2_XATTR_PREFIX_* */

struct list_head xindex; /* chained from c->xattrindex[n] */
uint32_t refcnt; /* # of xattr_ref refers this */
uint32_t xid;
Expand All @@ -42,11 +42,11 @@ struct jffs2_inode_cache;
struct jffs2_xattr_ref
{
void *always_null;
u8 class;
u8 flags; /* Currently unused */
struct jffs2_raw_node_ref *node;
uint8_t class;
uint8_t flags; /* Currently unused */
u16 unused;

struct jffs2_raw_node_ref *node;
union {
struct jffs2_inode_cache *ic; /* reference to jffs2_inode_cache */
uint32_t ino; /* only used in scanning/building */
Expand Down

0 comments on commit 4203cb9

Please sign in to comment.