Commit 6327be35 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] efs endianness annotations

Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 9ac6b2af
......@@ -121,7 +121,8 @@ module_exit(exit_efs_fs)
static efs_block_t efs_validate_vh(struct volume_header *vh) {
int i;
unsigned int cs, csum, *ui;
__be32 cs, *ui;
int csum;
efs_block_t sblock = 0; /* shuts up gcc */
struct pt_types *pt_entry;
int pt_type, slice = -1;
......@@ -135,8 +136,8 @@ static efs_block_t efs_validate_vh(struct volume_header *vh) {
return 0;
}
ui = ((unsigned int *) (vh + 1)) - 1;
for(csum = 0; ui >= ((unsigned int *) vh);) {
ui = ((__be32 *) (vh + 1)) - 1;
for(csum = 0; ui >= ((__be32 *) vh);) {
cs = *ui--;
csum += be32_to_cpu(cs);
}
......
......@@ -11,7 +11,7 @@
#define EFS_DIRBSIZE (1 << EFS_DIRBSIZE_BITS)
struct efs_dentry {
unsigned int inode;
__be32 inode;
unsigned char namelen;
char name[3];
};
......@@ -23,7 +23,7 @@ struct efs_dentry {
#define EFS_DIRBLK_MAGIC 0xbeef /* moo */
struct efs_dir {
unsigned short magic;
__be16 magic;
unsigned char firstused;
unsigned char slots;
......
......@@ -28,8 +28,8 @@ typedef union extent_u {
} efs_extent;
typedef struct edevs {
short odev;
unsigned int ndev;
__be16 odev;
__be32 ndev;
} efs_devs;
/*
......@@ -37,16 +37,16 @@ typedef struct edevs {
* is exactly 128 bytes long.
*/
struct efs_dinode {
u_short di_mode; /* mode and type of file */
short di_nlink; /* number of links to file */
u_short di_uid; /* owner's user id */
u_short di_gid; /* owner's group id */
int32_t di_size; /* number of bytes in file */
int32_t di_atime; /* time last accessed */
int32_t di_mtime; /* time last modified */
int32_t di_ctime; /* time created */
uint32_t di_gen; /* generation number */
short di_numextents; /* # of extents */
__be16 di_mode; /* mode and type of file */
__be16 di_nlink; /* number of links to file */
__be16 di_uid; /* owner's user id */
__be16 di_gid; /* owner's group id */
__be32 di_size; /* number of bytes in file */
__be32 di_atime; /* time last accessed */
__be32 di_mtime; /* time last modified */
__be32 di_ctime; /* time created */
__be32 di_gen; /* generation number */
__be16 di_numextents; /* # of extents */
u_char di_version; /* version of inode */
u_char di_spare; /* spare - used by AFS */
union di_addr {
......
......@@ -23,39 +23,39 @@
/* efs superblock on disk */
struct efs_super {
int32_t fs_size; /* size of filesystem, in sectors */
int32_t fs_firstcg; /* bb offset to first cg */
int32_t fs_cgfsize; /* size of cylinder group in bb's */
short fs_cgisize; /* bb's of inodes per cylinder group */
short fs_sectors; /* sectors per track */
short fs_heads; /* heads per cylinder */
short fs_ncg; /* # of cylinder groups in filesystem */
short fs_dirty; /* fs needs to be fsck'd */
int32_t fs_time; /* last super-block update */
int32_t fs_magic; /* magic number */
__be32 fs_size; /* size of filesystem, in sectors */
__be32 fs_firstcg; /* bb offset to first cg */
__be32 fs_cgfsize; /* size of cylinder group in bb's */
__be16 fs_cgisize; /* bb's of inodes per cylinder group */
__be16 fs_sectors; /* sectors per track */
__be16 fs_heads; /* heads per cylinder */
__be16 fs_ncg; /* # of cylinder groups in filesystem */
__be16 fs_dirty; /* fs needs to be fsck'd */
__be32 fs_time; /* last super-block update */
__be32 fs_magic; /* magic number */
char fs_fname[6]; /* file system name */
char fs_fpack[6]; /* file system pack name */
int32_t fs_bmsize; /* size of bitmap in bytes */
int32_t fs_tfree; /* total free data blocks */
int32_t fs_tinode; /* total free inodes */
int32_t fs_bmblock; /* bitmap location. */
int32_t fs_replsb; /* Location of replicated superblock. */
int32_t fs_lastialloc; /* last allocated inode */
__be32 fs_bmsize; /* size of bitmap in bytes */
__be32 fs_tfree; /* total free data blocks */
__be32 fs_tinode; /* total free inodes */
__be32 fs_bmblock; /* bitmap location. */
__be32 fs_replsb; /* Location of replicated superblock. */
__be32 fs_lastialloc; /* last allocated inode */
char fs_spare[20]; /* space for expansion - MUST BE ZERO */
int32_t fs_checksum; /* checksum of volume portion of fs */
__be32 fs_checksum; /* checksum of volume portion of fs */
};
/* efs superblock information in memory */
struct efs_sb_info {
int32_t fs_magic; /* superblock magic number */
int32_t fs_start; /* first block of filesystem */
int32_t first_block; /* first data block in filesystem */
int32_t total_blocks; /* total number of blocks in filesystem */
int32_t group_size; /* # of blocks a group consists of */
int32_t data_free; /* # of free data blocks */
int32_t inode_free; /* # of free inodes */
short inode_blocks; /* # of blocks used for inodes in every grp */
short total_groups; /* # of groups */
__u32 fs_magic; /* superblock magic number */
__u32 fs_start; /* first block of filesystem */
__u32 first_block; /* first data block in filesystem */
__u32 total_blocks; /* total number of blocks in filesystem */
__u32 group_size; /* # of blocks a group consists of */
__u32 data_free; /* # of free data blocks */
__u32 inode_free; /* # of free inodes */
__u16 inode_blocks; /* # of blocks used for inodes in every grp */
__u16 total_groups; /* # of groups */
};
#endif /* __EFS_FS_SB_H__ */
......
......@@ -17,26 +17,26 @@
struct volume_directory {
char vd_name[VDNAMESIZE]; /* name */
int vd_lbn; /* logical block number */
int vd_nbytes; /* file length in bytes */
__be32 vd_lbn; /* logical block number */
__be32 vd_nbytes; /* file length in bytes */
};
struct partition_table { /* one per logical partition */
int pt_nblks; /* # of logical blks in partition */
int pt_firstlbn; /* first lbn of partition */
int pt_type; /* use of partition */
__be32 pt_nblks; /* # of logical blks in partition */
__be32 pt_firstlbn; /* first lbn of partition */
__be32 pt_type; /* use of partition */
};
struct volume_header {
int vh_magic; /* identifies volume header */
short vh_rootpt; /* root partition number */
short vh_swappt; /* swap partition number */
__be32 vh_magic; /* identifies volume header */
__be16 vh_rootpt; /* root partition number */
__be16 vh_swappt; /* swap partition number */
char vh_bootfile[BFNAMESIZE]; /* name of file to boot */
char pad[48]; /* device param space */
struct volume_directory vh_vd[NVDIR]; /* other vol hdr contents */
struct partition_table vh_pt[NPARTAB]; /* device partition layout */
int vh_csum; /* volume header checksum */
int vh_fill; /* fill out to 512 bytes */
__be32 vh_csum; /* volume header checksum */
__be32 vh_fill; /* fill out to 512 bytes */
};
/* partition type sysv is used for EFS format CD-ROM partitions */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment