Skip to content

Commit

Permalink
Remove struct typedefs from fs/udf/ecma_167.h et al.
Browse files Browse the repository at this point in the history
Signed-off-by: Pekka Enberg <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
  • Loading branch information
Pekka Enberg authored and jankara committed Apr 2, 2009
1 parent 833bb30 commit 5ca4e4b
Show file tree
Hide file tree
Showing 15 changed files with 444 additions and 442 deletions.
38 changes: 19 additions & 19 deletions fs/udf/balloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static int read_block_bitmap(struct super_block *sb,
{
struct buffer_head *bh = NULL;
int retval = 0;
kernel_lb_addr loc;
struct kernel_lb_addr loc;

loc.logicalBlockNum = bitmap->s_extPosition;
loc.partitionReferenceNum = UDF_SB(sb)->s_partition;
Expand Down Expand Up @@ -156,7 +156,7 @@ static bool udf_add_free_space(struct udf_sb_info *sbi,
static void udf_bitmap_free_blocks(struct super_block *sb,
struct inode *inode,
struct udf_bitmap *bitmap,
kernel_lb_addr bloc, uint32_t offset,
struct kernel_lb_addr bloc, uint32_t offset,
uint32_t count)
{
struct udf_sb_info *sbi = UDF_SB(sb);
Expand Down Expand Up @@ -425,13 +425,13 @@ static int udf_bitmap_new_block(struct super_block *sb,
static void udf_table_free_blocks(struct super_block *sb,
struct inode *inode,
struct inode *table,
kernel_lb_addr bloc, uint32_t offset,
struct kernel_lb_addr bloc, uint32_t offset,
uint32_t count)
{
struct udf_sb_info *sbi = UDF_SB(sb);
uint32_t start, end;
uint32_t elen;
kernel_lb_addr eloc;
struct kernel_lb_addr eloc;
struct extent_position oepos, epos;
int8_t etype;
int i;
Expand Down Expand Up @@ -532,18 +532,18 @@ static void udf_table_free_blocks(struct super_block *sb,
*/

int adsize;
short_ad *sad = NULL;
long_ad *lad = NULL;
struct short_ad *sad = NULL;
struct long_ad *lad = NULL;
struct allocExtDesc *aed;

eloc.logicalBlockNum = start;
elen = EXT_RECORDED_ALLOCATED |
(count << sb->s_blocksize_bits);

if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
adsize = sizeof(short_ad);
adsize = sizeof(struct short_ad);
else if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_LONG)
adsize = sizeof(long_ad);
adsize = sizeof(struct long_ad);
else {
brelse(oepos.bh);
brelse(epos.bh);
Expand Down Expand Up @@ -601,23 +601,23 @@ static void udf_table_free_blocks(struct super_block *sb,
if (sbi->s_udfrev >= 0x0200)
udf_new_tag(epos.bh->b_data, TAG_IDENT_AED,
3, 1, epos.block.logicalBlockNum,
sizeof(tag));
sizeof(struct tag));
else
udf_new_tag(epos.bh->b_data, TAG_IDENT_AED,
2, 1, epos.block.logicalBlockNum,
sizeof(tag));
sizeof(struct tag));

switch (iinfo->i_alloc_type) {
case ICBTAG_FLAG_AD_SHORT:
sad = (short_ad *)sptr;
sad = (struct short_ad *)sptr;
sad->extLength = cpu_to_le32(
EXT_NEXT_EXTENT_ALLOCDECS |
sb->s_blocksize);
sad->extPosition =
cpu_to_le32(epos.block.logicalBlockNum);
break;
case ICBTAG_FLAG_AD_LONG:
lad = (long_ad *)sptr;
lad = (struct long_ad *)sptr;
lad->extLength = cpu_to_le32(
EXT_NEXT_EXTENT_ALLOCDECS |
sb->s_blocksize);
Expand Down Expand Up @@ -666,7 +666,7 @@ static int udf_table_prealloc_blocks(struct super_block *sb,
struct udf_sb_info *sbi = UDF_SB(sb);
int alloc_count = 0;
uint32_t elen, adsize;
kernel_lb_addr eloc;
struct kernel_lb_addr eloc;
struct extent_position epos;
int8_t etype = -1;
struct udf_inode_info *iinfo;
Expand All @@ -677,9 +677,9 @@ static int udf_table_prealloc_blocks(struct super_block *sb,

iinfo = UDF_I(table);
if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
adsize = sizeof(short_ad);
adsize = sizeof(struct short_ad);
else if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_LONG)
adsize = sizeof(long_ad);
adsize = sizeof(struct long_ad);
else
return 0;

Expand Down Expand Up @@ -735,17 +735,17 @@ static int udf_table_new_block(struct super_block *sb,
uint32_t spread = 0xFFFFFFFF, nspread = 0xFFFFFFFF;
uint32_t newblock = 0, adsize;
uint32_t elen, goal_elen = 0;
kernel_lb_addr eloc, uninitialized_var(goal_eloc);
struct kernel_lb_addr eloc, uninitialized_var(goal_eloc);
struct extent_position epos, goal_epos;
int8_t etype;
struct udf_inode_info *iinfo = UDF_I(table);

*err = -ENOSPC;

if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
adsize = sizeof(short_ad);
adsize = sizeof(struct short_ad);
else if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_LONG)
adsize = sizeof(long_ad);
adsize = sizeof(struct long_ad);
else
return newblock;

Expand Down Expand Up @@ -830,7 +830,7 @@ static int udf_table_new_block(struct super_block *sb,

inline void udf_free_blocks(struct super_block *sb,
struct inode *inode,
kernel_lb_addr bloc, uint32_t offset,
struct kernel_lb_addr bloc, uint32_t offset,
uint32_t count)
{
uint16_t partition = bloc.partitionReferenceNum;
Expand Down
8 changes: 4 additions & 4 deletions fs/udf/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static int do_udf_readdir(struct inode *dir, struct file *filp,
uint8_t lfi;
loff_t size = udf_ext0_offset(dir) + dir->i_size;
struct buffer_head *tmp, *bha[16];
kernel_lb_addr eloc;
struct kernel_lb_addr eloc;
uint32_t elen;
sector_t offset;
int i, num, ret = 0;
Expand Down Expand Up @@ -83,10 +83,10 @@ static int do_udf_readdir(struct inode *dir, struct file *filp,
block = udf_get_lb_pblock(dir->i_sb, eloc, offset);
if ((++offset << dir->i_sb->s_blocksize_bits) < elen) {
if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
epos.offset -= sizeof(short_ad);
epos.offset -= sizeof(struct short_ad);
else if (iinfo->i_alloc_type ==
ICBTAG_FLAG_AD_LONG)
epos.offset -= sizeof(long_ad);
epos.offset -= sizeof(struct long_ad);
} else {
offset = 0;
}
Expand Down Expand Up @@ -161,7 +161,7 @@ static int do_udf_readdir(struct inode *dir, struct file *filp,
memcpy(fname, "..", flen);
dt_type = DT_DIR;
} else {
kernel_lb_addr tloc = lelb_to_cpu(cfi.icb.extLocation);
struct kernel_lb_addr tloc = lelb_to_cpu(cfi.icb.extLocation);

iblock = udf_get_lb_pblock(dir->i_sb, tloc, 0);
flen = udf_get_filename(dir->i_sb, nameptr, fname, lfi);
Expand Down
32 changes: 16 additions & 16 deletions fs/udf/directory.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#if 0
static uint8_t *udf_filead_read(struct inode *dir, uint8_t *tmpad,
uint8_t ad_size, kernel_lb_addr fe_loc,
uint8_t ad_size, struct kernel_lb_addr fe_loc,
int *pos, int *offset, struct buffer_head **bh,
int *error)
{
Expand Down Expand Up @@ -75,7 +75,7 @@ struct fileIdentDesc *udf_fileident_read(struct inode *dir, loff_t *nf_pos,
struct udf_fileident_bh *fibh,
struct fileIdentDesc *cfi,
struct extent_position *epos,
kernel_lb_addr *eloc, uint32_t *elen,
struct kernel_lb_addr *eloc, uint32_t *elen,
sector_t *offset)
{
struct fileIdentDesc *fi;
Expand Down Expand Up @@ -249,9 +249,9 @@ struct fileIdentDesc *udf_get_fileident(void *buffer, int bufsize, int *offset)
}

#if 0
static extent_ad *udf_get_fileextent(void *buffer, int bufsize, int *offset)
static struct extent_ad *udf_get_fileextent(void *buffer, int bufsize, int *offset)
{
extent_ad *ext;
struct extent_ad *ext;
struct fileEntry *fe;
uint8_t *ptr;

Expand All @@ -274,54 +274,54 @@ static extent_ad *udf_get_fileextent(void *buffer, int bufsize, int *offset)
if ((*offset > 0) && (*offset < le32_to_cpu(fe->lengthAllocDescs)))
ptr += *offset;

ext = (extent_ad *)ptr;
ext = (struct extent_ad *)ptr;

*offset = *offset + sizeof(extent_ad);
*offset = *offset + sizeof(struct extent_ad);
return ext;
}
#endif

short_ad *udf_get_fileshortad(uint8_t *ptr, int maxoffset, uint32_t *offset,
struct short_ad *udf_get_fileshortad(uint8_t *ptr, int maxoffset, uint32_t *offset,
int inc)
{
short_ad *sa;
struct short_ad *sa;

if ((!ptr) || (!offset)) {
printk(KERN_ERR "udf: udf_get_fileshortad() invalidparms\n");
return NULL;
}

if ((*offset + sizeof(short_ad)) > maxoffset)
if ((*offset + sizeof(struct short_ad)) > maxoffset)
return NULL;
else {
sa = (short_ad *)ptr;
sa = (struct short_ad *)ptr;
if (sa->extLength == 0)
return NULL;
}

if (inc)
*offset += sizeof(short_ad);
*offset += sizeof(struct short_ad);
return sa;
}

long_ad *udf_get_filelongad(uint8_t *ptr, int maxoffset, uint32_t *offset, int inc)
struct long_ad *udf_get_filelongad(uint8_t *ptr, int maxoffset, uint32_t *offset, int inc)
{
long_ad *la;
struct long_ad *la;

if ((!ptr) || (!offset)) {
printk(KERN_ERR "udf: udf_get_filelongad() invalidparms\n");
return NULL;
}

if ((*offset + sizeof(long_ad)) > maxoffset)
if ((*offset + sizeof(struct long_ad)) > maxoffset)
return NULL;
else {
la = (long_ad *)ptr;
la = (struct long_ad *)ptr;
if (la->extLength == 0)
return NULL;
}

if (inc)
*offset += sizeof(long_ad);
*offset += sizeof(struct long_ad);
return la;
}
Loading

0 comments on commit 5ca4e4b

Please sign in to comment.