Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 27777
b: refs/heads/master
c: 3e68fbb
h: refs/heads/master
i:
  27775: c068fc7
v: v3
  • Loading branch information
David Woodhouse committed May 14, 2006
1 parent b028de2 commit 1cd6f07
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 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: 52239da1b06ff445bf71d35e04d8ce74e4c6fe7b
refs/heads/master: 3e68fbb59b3d4e6b47b65e9928b5929e02179759
14 changes: 13 additions & 1 deletion trunk/fs/jffs2/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,26 @@ static int __init init_jffs2_fs(void)
{
int ret;

/* Paranoia checks for on-medium structures. If we ask GCC
to pack them with __attribute__((packed)) then it _also_
assumes that they're not aligned -- so it emits crappy
code on some architectures. Ideally we want an attribute
which means just 'no padding', without the alignment
thing. But GCC doesn't have that -- we have to just
hope the structs are the right sizes, instead. */
BUG_ON(sizeof(struct jffs2_unknown_node) != 12);
BUG_ON(sizeof(struct jffs2_raw_dirent) != 40);
BUG_ON(sizeof(struct jffs2_raw_inode) != 68);
BUG_ON(sizeof(struct jffs2_raw_summary) != 32);

printk(KERN_INFO "JFFS2 version 2.2."
#ifdef CONFIG_JFFS2_FS_WRITEBUFFER
" (NAND)"
#endif
#ifdef CONFIG_JFFS2_SUMMARY
" (SUMMARY) "
#endif
" (C) 2001-2003 Red Hat, Inc.\n");
" (C) 2001-2006 Red Hat, Inc.\n");

jffs2_inode_cachep = kmem_cache_create("jffs2_i",
sizeof(struct jffs2_inode_info),
Expand Down
14 changes: 7 additions & 7 deletions trunk/include/linux/jffs2.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@

typedef struct {
uint32_t v32;
} __attribute__((packed)) jint32_t;
} jint32_t;

typedef struct {
uint32_t m;
} __attribute__((packed)) jmode_t;
} jmode_t;

typedef struct {
uint16_t v16;
} __attribute__((packed)) jint16_t;
} jint16_t;

struct jffs2_unknown_node
{
Expand All @@ -99,7 +99,7 @@ struct jffs2_unknown_node
jint16_t nodetype;
jint32_t totlen; /* So we can skip over nodes we don't grok */
jint32_t hdr_crc;
} __attribute__((packed));
};

struct jffs2_raw_dirent
{
Expand All @@ -117,7 +117,7 @@ struct jffs2_raw_dirent
jint32_t node_crc;
jint32_t name_crc;
uint8_t name[0];
} __attribute__((packed));
};

/* The JFFS2 raw inode structure: Used for storage on physical media. */
/* The uid, gid, atime, mtime and ctime members could be longer, but
Expand Down Expand Up @@ -149,7 +149,7 @@ struct jffs2_raw_inode
jint32_t data_crc; /* CRC for the (compressed) data. */
jint32_t node_crc; /* CRC for the raw inode (excluding data) */
uint8_t data[0];
} __attribute__((packed));
};

struct jffs2_raw_summary
{
Expand All @@ -163,7 +163,7 @@ struct jffs2_raw_summary
jint32_t sum_crc; /* summary information crc */
jint32_t node_crc; /* node crc */
jint32_t sum[0]; /* inode summary info */
} __attribute__((packed));
};

union jffs2_node_union
{
Expand Down

0 comments on commit 1cd6f07

Please sign in to comment.