From 3bf25cb40d899eeb5a471f497e56ddfe2c96c019 Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Tue, 8 May 2007 00:35:16 -0700 Subject: udf: use get_bh() Make UDF use get_bh() instead of directly accessing b_count and use brelse() instead of udf_release_data() which does just brelse()... Signed-off-by: Jan Kara Acked-by: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/udf/super.c | 56 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'fs/udf/super.c') diff --git a/fs/udf/super.c b/fs/udf/super.c index dafa05f0110b..9f516d4baf9d 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c @@ -563,7 +563,7 @@ udf_vrs(struct super_block *sb, int silent) if (vsd->stdIdent[0] == 0) { - udf_release_data(bh); + brelse(bh); break; } else if (!strncmp(vsd->stdIdent, VSD_STD_ID_CD001, VSD_STD_ID_LEN)) @@ -596,7 +596,7 @@ udf_vrs(struct super_block *sb, int silent) } else if (!strncmp(vsd->stdIdent, VSD_STD_ID_TEA01, VSD_STD_ID_LEN)) { - udf_release_data(bh); + brelse(bh); break; } else if (!strncmp(vsd->stdIdent, VSD_STD_ID_NSR02, VSD_STD_ID_LEN)) @@ -607,7 +607,7 @@ udf_vrs(struct super_block *sb, int silent) { nsr03 = sector; } - udf_release_data(bh); + brelse(bh); } if (nsr03) @@ -673,7 +673,7 @@ udf_find_anchor(struct super_block *sb) { ident = le16_to_cpu(((tag *)bh->b_data)->tagIdent); location = le32_to_cpu(((tag *)bh->b_data)->tagLocation); - udf_release_data(bh); + brelse(bh); } if (ident == TAG_IDENT_AVDP) @@ -708,7 +708,7 @@ udf_find_anchor(struct super_block *sb) { ident = le16_to_cpu(((tag *)bh->b_data)->tagIdent); location = le32_to_cpu(((tag *)bh->b_data)->tagLocation); - udf_release_data(bh); + brelse(bh); } if (ident == TAG_IDENT_AVDP && @@ -727,7 +727,7 @@ udf_find_anchor(struct super_block *sb) { ident = le16_to_cpu(((tag *)bh->b_data)->tagIdent); location = le32_to_cpu(((tag *)bh->b_data)->tagLocation); - udf_release_data(bh); + brelse(bh); } if (ident == TAG_IDENT_AVDP && @@ -749,7 +749,7 @@ udf_find_anchor(struct super_block *sb) { ident = le16_to_cpu(((tag *)bh->b_data)->tagIdent); location = le32_to_cpu(((tag *)bh->b_data)->tagLocation); - udf_release_data(bh); + brelse(bh); if (ident == TAG_IDENT_AVDP && location == 256) UDF_SET_FLAG(sb, UDF_FLAG_VARCONV); @@ -766,7 +766,7 @@ udf_find_anchor(struct super_block *sb) } else { - udf_release_data(bh); + brelse(bh); if ((ident != TAG_IDENT_AVDP) && (i || (ident != TAG_IDENT_FE && ident != TAG_IDENT_EFE))) { @@ -795,7 +795,7 @@ udf_find_fileset(struct super_block *sb, kernel_lb_addr *fileset, kernel_lb_addr return 1; else if (ident != TAG_IDENT_FSD) { - udf_release_data(bh); + brelse(bh); return 1; } @@ -834,7 +834,7 @@ udf_find_fileset(struct super_block *sb, kernel_lb_addr *fileset, kernel_lb_addr newfileset.logicalBlockNum += 1 + ((le32_to_cpu(sp->numOfBytes) + sizeof(struct spaceBitmapDesc) - 1) >> sb->s_blocksize_bits); - udf_release_data(bh); + brelse(bh); break; } case TAG_IDENT_FSD: @@ -845,7 +845,7 @@ udf_find_fileset(struct super_block *sb, kernel_lb_addr *fileset, kernel_lb_addr default: { newfileset.logicalBlockNum ++; - udf_release_data(bh); + brelse(bh); bh = NULL; break; } @@ -865,7 +865,7 @@ udf_find_fileset(struct super_block *sb, kernel_lb_addr *fileset, kernel_lb_addr UDF_SB_PARTITION(sb) = fileset->partitionReferenceNum; udf_load_fileset(sb, bh, root); - udf_release_data(bh); + brelse(bh); return 0; } return 1; @@ -1083,7 +1083,7 @@ udf_load_logicalvol(struct super_block *sb, struct buffer_head * bh, kernel_lb_a if (ident != 0 || strncmp(st->sparingIdent.ident, UDF_ID_SPARING, strlen(UDF_ID_SPARING))) { - udf_release_data(UDF_SB_TYPESPAR(sb,i).s_spar_map[j]); + brelse(UDF_SB_TYPESPAR(sb,i).s_spar_map[j]); UDF_SB_TYPESPAR(sb,i).s_spar_map[j] = NULL; } } @@ -1137,12 +1137,12 @@ udf_load_logicalvolint(struct super_block *sb, kernel_extent_ad loc) udf_load_logicalvolint(sb, leea_to_cpu(UDF_SB_LVID(sb)->nextIntegrityExt)); if (UDF_SB_LVIDBH(sb) != bh) - udf_release_data(bh); + brelse(bh); loc.extLength -= sb->s_blocksize; loc.extLocation ++; } if (UDF_SB_LVIDBH(sb) != bh) - udf_release_data(bh); + brelse(bh); } /* @@ -1245,7 +1245,7 @@ udf_process_sequence(struct super_block *sb, long block, long lastblock, kernel_ done = 1; break; } - udf_release_data(bh); + brelse(bh); } for (i=0; ib_data; if (ident == TAG_IDENT_PD) udf_load_partdesc(sb, bh2); - udf_release_data(bh2); + brelse(bh2); } } - udf_release_data(bh); + brelse(bh); } } @@ -1333,7 +1333,7 @@ udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset) reserve_e = reserve_e >> sb->s_blocksize_bits; reserve_e += reserve_s; - udf_release_data(bh); + brelse(bh); /* Process the main & reserve sequences */ /* responsible for finding the PartitionDesc(s) */ @@ -1408,7 +1408,7 @@ udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset) udf_ext0_offset(UDF_SB_VAT(sb)); UDF_SB_TYPEVIRT(sb,i).s_num_entries = (UDF_SB_VAT(sb)->i_size - UDF_SB_TYPEVIRT(sb,i).s_start_offset) >> 2; - udf_release_data(bh); + brelse(bh); } UDF_SB_PARTROOT(sb,i) = udf_get_pblock(sb, 0, i, 0); UDF_SB_PARTLEN(sb,i) = UDF_SB_PARTLEN(sb,ino.partitionReferenceNum); @@ -1680,7 +1680,7 @@ error_out: if (UDF_SB_PARTTYPE(sb, UDF_SB_PARTITION(sb)) == UDF_SPARABLE_MAP15) { for (i=0; i<4; i++) - udf_release_data(UDF_SB_TYPESPAR(sb, UDF_SB_PARTITION(sb)).s_spar_map[i]); + brelse(UDF_SB_TYPESPAR(sb, UDF_SB_PARTITION(sb)).s_spar_map[i]); } } #ifdef CONFIG_UDF_NLS @@ -1689,7 +1689,7 @@ error_out: #endif if (!(sb->s_flags & MS_RDONLY)) udf_close_lvid(sb); - udf_release_data(UDF_SB_LVIDBH(sb)); + brelse(UDF_SB_LVIDBH(sb)); UDF_SB_FREE(sb); kfree(sbi); sb->s_fs_info = NULL; @@ -1758,7 +1758,7 @@ udf_put_super(struct super_block *sb) if (UDF_SB_PARTTYPE(sb, UDF_SB_PARTITION(sb)) == UDF_SPARABLE_MAP15) { for (i=0; i<4; i++) - udf_release_data(UDF_SB_TYPESPAR(sb, UDF_SB_PARTITION(sb)).s_spar_map[i]); + brelse(UDF_SB_TYPESPAR(sb, UDF_SB_PARTITION(sb)).s_spar_map[i]); } } #ifdef CONFIG_UDF_NLS @@ -1767,7 +1767,7 @@ udf_put_super(struct super_block *sb) #endif if (!(sb->s_flags & MS_RDONLY)) udf_close_lvid(sb); - udf_release_data(UDF_SB_LVIDBH(sb)); + brelse(UDF_SB_LVIDBH(sb)); UDF_SB_FREE(sb); kfree(sb->s_fs_info); sb->s_fs_info = NULL; @@ -1837,7 +1837,7 @@ udf_count_free_bitmap(struct super_block *sb, struct udf_bitmap *bitmap) } else if (ident != TAG_IDENT_SBD) { - udf_release_data(bh); + brelse(bh); printk(KERN_ERR "udf: udf_count_free failed\n"); goto out; } @@ -1859,7 +1859,7 @@ udf_count_free_bitmap(struct super_block *sb, struct udf_bitmap *bitmap) } if ( bytes ) { - udf_release_data(bh); + brelse(bh); newblock = udf_get_lb_pblock(sb, loc, ++block); bh = udf_tread(sb, newblock); if (!bh) @@ -1871,7 +1871,7 @@ udf_count_free_bitmap(struct super_block *sb, struct udf_bitmap *bitmap) ptr = (uint8_t *)bh->b_data; } } - udf_release_data(bh); + brelse(bh); out: unlock_kernel(); @@ -1896,7 +1896,7 @@ udf_count_free_table(struct super_block *sb, struct inode * table) while ((etype = udf_next_aext(table, &epos, &eloc, &elen, 1)) != -1) accum += (elen >> table->i_sb->s_blocksize_bits); - udf_release_data(epos.bh); + brelse(epos.bh); unlock_kernel(); -- cgit v1.2.2