From c0b344385fa05f6bea462e707fcba89f9e2776c2 Mon Sep 17 00:00:00 2001 From: Marcin Slusarz Date: Fri, 8 Feb 2008 04:20:42 -0800 Subject: udf: remove UDF_I_* macros and open code them Signed-off-by: Marcin Slusarz Acked-by: Jan Kara Cc: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/udf/balloc.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'fs/udf/balloc.c') diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c index 989259655b40..7b95b3f46211 100644 --- a/fs/udf/balloc.c +++ b/fs/udf/balloc.c @@ -460,7 +460,7 @@ static void udf_table_free_blocks(struct super_block *sb, epos.offset = oepos.offset = sizeof(struct unallocSpaceEntry); elen = 0; - epos.block = oepos.block = UDF_I_LOCATION(table); + epos.block = oepos.block = UDF_I(table)->i_location; epos.bh = oepos.bh = NULL; while (count && @@ -539,9 +539,9 @@ static void udf_table_free_blocks(struct super_block *sb, elen = EXT_RECORDED_ALLOCATED | (count << sb->s_blocksize_bits); - if (UDF_I_ALLOCTYPE(table) == ICBTAG_FLAG_AD_SHORT) { + if (UDF_I(table)->i_alloc_type == ICBTAG_FLAG_AD_SHORT) { adsize = sizeof(short_ad); - } else if (UDF_I_ALLOCTYPE(table) == ICBTAG_FLAG_AD_LONG) { + } else if (UDF_I(table)->i_alloc_type == ICBTAG_FLAG_AD_LONG) { adsize = sizeof(long_ad); } else { brelse(oepos.bh); @@ -573,7 +573,8 @@ static void udf_table_free_blocks(struct super_block *sb, if (epos.offset + adsize > sb->s_blocksize) { loffset = epos.offset; aed->lengthAllocDescs = cpu_to_le32(adsize); - sptr = UDF_I_DATA(table) + epos.offset - adsize; + sptr = UDF_I(table)->i_ext.i_data + epos.offset + - adsize; dptr = epos.bh->b_data + sizeof(struct allocExtDesc); memcpy(dptr, sptr, adsize); @@ -591,8 +592,9 @@ static void udf_table_free_blocks(struct super_block *sb, aed->lengthAllocDescs) + adsize); } else { - sptr = UDF_I_DATA(table) + epos.offset; - UDF_I_LENALLOC(table) += adsize; + sptr = UDF_I(table)->i_ext.i_data + + epos.offset; + UDF_I(table)->i_lenAlloc += adsize; mark_inode_dirty(table); } epos.offset = sizeof(struct allocExtDesc); @@ -606,7 +608,7 @@ static void udf_table_free_blocks(struct super_block *sb, 2, 1, epos.block.logicalBlockNum, sizeof(tag)); - switch (UDF_I_ALLOCTYPE(table)) { + switch (UDF_I(table)->i_alloc_type) { case ICBTAG_FLAG_AD_SHORT: sad = (short_ad *)sptr; sad->extLength = cpu_to_le32( @@ -637,7 +639,7 @@ static void udf_table_free_blocks(struct super_block *sb, udf_write_aext(table, &epos, eloc, elen, 1); if (!epos.bh) { - UDF_I_LENALLOC(table) += adsize; + UDF_I(table)->i_lenAlloc += adsize; mark_inode_dirty(table); } else { aed = (struct allocExtDesc *)epos.bh->b_data; @@ -675,16 +677,16 @@ static int udf_table_prealloc_blocks(struct super_block *sb, first_block >= sbi->s_partmaps[partition].s_partition_len) return 0; - if (UDF_I_ALLOCTYPE(table) == ICBTAG_FLAG_AD_SHORT) + if (UDF_I(table)->i_alloc_type == ICBTAG_FLAG_AD_SHORT) adsize = sizeof(short_ad); - else if (UDF_I_ALLOCTYPE(table) == ICBTAG_FLAG_AD_LONG) + else if (UDF_I(table)->i_alloc_type == ICBTAG_FLAG_AD_LONG) adsize = sizeof(long_ad); else return 0; mutex_lock(&sbi->s_alloc_mutex); epos.offset = sizeof(struct unallocSpaceEntry); - epos.block = UDF_I_LOCATION(table); + epos.block = UDF_I(table)->i_location; epos.bh = NULL; eloc.logicalBlockNum = 0xFFFFFFFF; @@ -740,9 +742,9 @@ static int udf_table_new_block(struct super_block *sb, *err = -ENOSPC; - if (UDF_I_ALLOCTYPE(table) == ICBTAG_FLAG_AD_SHORT) + if (UDF_I(table)->i_alloc_type == ICBTAG_FLAG_AD_SHORT) adsize = sizeof(short_ad); - else if (UDF_I_ALLOCTYPE(table) == ICBTAG_FLAG_AD_LONG) + else if (UDF_I(table)->i_alloc_type == ICBTAG_FLAG_AD_LONG) adsize = sizeof(long_ad); else return newblock; @@ -757,7 +759,7 @@ static int udf_table_new_block(struct super_block *sb, of the current closest match and use that when we are done. */ epos.offset = sizeof(struct unallocSpaceEntry); - epos.block = UDF_I_LOCATION(table); + epos.block = UDF_I(table)->i_location; epos.bh = goal_epos.bh = NULL; while (spread && -- cgit v1.2.3