aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/udf/balloc.c35
-rw-r--r--fs/udf/dir.c22
-rw-r--r--fs/udf/directory.c10
-rw-r--r--fs/udf/inode.c74
-rw-r--r--fs/udf/misc.c6
-rw-r--r--fs/udf/namei.c136
-rw-r--r--fs/udf/partition.c2
-rw-r--r--fs/udf/super.c56
-rw-r--r--fs/udf/symlink.c2
-rw-r--r--fs/udf/truncate.c4
-rw-r--r--fs/udf/udf_sb.h2
-rw-r--r--fs/udf/udfdecl.h2
12 files changed, 174 insertions, 177 deletions
diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c
index 756dbbf0eafd..4cec91015681 100644
--- a/fs/udf/balloc.c
+++ b/fs/udf/balloc.c
@@ -508,8 +508,8 @@ static void udf_table_free_blocks(struct super_block * sb,
508 { 508 {
509 i = -1; 509 i = -1;
510 oepos.block = epos.block; 510 oepos.block = epos.block;
511 udf_release_data(oepos.bh); 511 brelse(oepos.bh);
512 atomic_inc(&epos.bh->b_count); 512 get_bh(epos.bh);
513 oepos.bh = epos.bh; 513 oepos.bh = epos.bh;
514 oepos.offset = 0; 514 oepos.offset = 0;
515 } 515 }
@@ -546,8 +546,8 @@ static void udf_table_free_blocks(struct super_block * sb,
546 adsize = sizeof(long_ad); 546 adsize = sizeof(long_ad);
547 else 547 else
548 { 548 {
549 udf_release_data(oepos.bh); 549 brelse(oepos.bh);
550 udf_release_data(epos.bh); 550 brelse(epos.bh);
551 goto error_return; 551 goto error_return;
552 } 552 }
553 553
@@ -556,7 +556,7 @@ static void udf_table_free_blocks(struct super_block * sb,
556 char *sptr, *dptr; 556 char *sptr, *dptr;
557 int loffset; 557 int loffset;
558 558
559 udf_release_data(oepos.bh); 559 brelse(oepos.bh);
560 oepos = epos; 560 oepos = epos;
561 561
562 /* Steal a block from the extent being free'd */ 562 /* Steal a block from the extent being free'd */
@@ -567,7 +567,7 @@ static void udf_table_free_blocks(struct super_block * sb,
567 if (!(epos.bh = udf_tread(sb, 567 if (!(epos.bh = udf_tread(sb,
568 udf_get_lb_pblock(sb, epos.block, 0)))) 568 udf_get_lb_pblock(sb, epos.block, 0))))
569 { 569 {
570 udf_release_data(oepos.bh); 570 brelse(oepos.bh);
571 goto error_return; 571 goto error_return;
572 } 572 }
573 aed = (struct allocExtDesc *)(epos.bh->b_data); 573 aed = (struct allocExtDesc *)(epos.bh->b_data);
@@ -658,8 +658,8 @@ static void udf_table_free_blocks(struct super_block * sb,
658 } 658 }
659 } 659 }
660 660
661 udf_release_data(epos.bh); 661 brelse(epos.bh);
662 udf_release_data(oepos.bh); 662 brelse(oepos.bh);
663 663
664error_return: 664error_return:
665 sb->s_dirt = 1; 665 sb->s_dirt = 1;
@@ -723,7 +723,7 @@ static int udf_table_prealloc_blocks(struct super_block * sb,
723 else 723 else
724 alloc_count = 0; 724 alloc_count = 0;
725 725
726 udf_release_data(epos.bh); 726 brelse(epos.bh);
727 727
728 if (alloc_count && UDF_SB_LVIDBH(sb)) 728 if (alloc_count && UDF_SB_LVIDBH(sb))
729 { 729 {
@@ -789,9 +789,9 @@ static int udf_table_new_block(struct super_block * sb,
789 spread = nspread; 789 spread = nspread;
790 if (goal_epos.bh != epos.bh) 790 if (goal_epos.bh != epos.bh)
791 { 791 {
792 udf_release_data(goal_epos.bh); 792 brelse(goal_epos.bh);
793 goal_epos.bh = epos.bh; 793 goal_epos.bh = epos.bh;
794 atomic_inc(&goal_epos.bh->b_count); 794 get_bh(goal_epos.bh);
795 } 795 }
796 goal_epos.block = epos.block; 796 goal_epos.block = epos.block;
797 goal_epos.offset = epos.offset - adsize; 797 goal_epos.offset = epos.offset - adsize;
@@ -800,11 +800,11 @@ static int udf_table_new_block(struct super_block * sb,
800 } 800 }
801 } 801 }
802 802
803 udf_release_data(epos.bh); 803 brelse(epos.bh);
804 804
805 if (spread == 0xFFFFFFFF) 805 if (spread == 0xFFFFFFFF)
806 { 806 {
807 udf_release_data(goal_epos.bh); 807 brelse(goal_epos.bh);
808 mutex_unlock(&sbi->s_alloc_mutex); 808 mutex_unlock(&sbi->s_alloc_mutex);
809 return 0; 809 return 0;
810 } 810 }
@@ -820,7 +820,7 @@ static int udf_table_new_block(struct super_block * sb,
820 820
821 if (inode && DQUOT_ALLOC_BLOCK(inode, 1)) 821 if (inode && DQUOT_ALLOC_BLOCK(inode, 1))
822 { 822 {
823 udf_release_data(goal_epos.bh); 823 brelse(goal_epos.bh);
824 mutex_unlock(&sbi->s_alloc_mutex); 824 mutex_unlock(&sbi->s_alloc_mutex);
825 *err = -EDQUOT; 825 *err = -EDQUOT;
826 return 0; 826 return 0;
@@ -830,7 +830,7 @@ static int udf_table_new_block(struct super_block * sb,
830 udf_write_aext(table, &goal_epos, goal_eloc, goal_elen, 1); 830 udf_write_aext(table, &goal_epos, goal_eloc, goal_elen, 1);
831 else 831 else
832 udf_delete_aext(table, goal_epos, goal_eloc, goal_elen); 832 udf_delete_aext(table, goal_epos, goal_eloc, goal_elen);
833 udf_release_data(goal_epos.bh); 833 brelse(goal_epos.bh);
834 834
835 if (UDF_SB_LVIDBH(sb)) 835 if (UDF_SB_LVIDBH(sb))
836 { 836 {
@@ -915,11 +915,14 @@ inline int udf_new_block(struct super_block * sb,
915 struct inode * inode, 915 struct inode * inode,
916 uint16_t partition, uint32_t goal, int *err) 916 uint16_t partition, uint32_t goal, int *err)
917{ 917{
918 int ret;
919
918 if (UDF_SB_PARTFLAGS(sb, partition) & UDF_PART_FLAG_UNALLOC_BITMAP) 920 if (UDF_SB_PARTFLAGS(sb, partition) & UDF_PART_FLAG_UNALLOC_BITMAP)
919 { 921 {
920 return udf_bitmap_new_block(sb, inode, 922 ret = udf_bitmap_new_block(sb, inode,
921 UDF_SB_PARTMAPS(sb)[partition].s_uspace.s_bitmap, 923 UDF_SB_PARTMAPS(sb)[partition].s_uspace.s_bitmap,
922 partition, goal, err); 924 partition, goal, err);
925 return ret;
923 } 926 }
924 else if (UDF_SB_PARTFLAGS(sb, partition) & UDF_PART_FLAG_UNALLOC_TABLE) 927 else if (UDF_SB_PARTFLAGS(sb, partition) & UDF_PART_FLAG_UNALLOC_TABLE)
925 { 928 {
diff --git a/fs/udf/dir.c b/fs/udf/dir.c
index 00c15d3dd756..e45f86b5e7b0 100644
--- a/fs/udf/dir.c
+++ b/fs/udf/dir.c
@@ -144,7 +144,7 @@ do_udf_readdir(struct inode * dir, struct file *filp, filldir_t filldir, void *d
144 144
145 if (!(fibh.sbh = fibh.ebh = udf_tread(dir->i_sb, block))) 145 if (!(fibh.sbh = fibh.ebh = udf_tread(dir->i_sb, block)))
146 { 146 {
147 udf_release_data(epos.bh); 147 brelse(epos.bh);
148 return -EIO; 148 return -EIO;
149 } 149 }
150 150
@@ -172,7 +172,7 @@ do_udf_readdir(struct inode * dir, struct file *filp, filldir_t filldir, void *d
172 } 172 }
173 else 173 else
174 { 174 {
175 udf_release_data(epos.bh); 175 brelse(epos.bh);
176 return -ENOENT; 176 return -ENOENT;
177 } 177 }
178 178
@@ -185,9 +185,9 @@ do_udf_readdir(struct inode * dir, struct file *filp, filldir_t filldir, void *d
185 if (!fi) 185 if (!fi)
186 { 186 {
187 if (fibh.sbh != fibh.ebh) 187 if (fibh.sbh != fibh.ebh)
188 udf_release_data(fibh.ebh); 188 brelse(fibh.ebh);
189 udf_release_data(fibh.sbh); 189 brelse(fibh.sbh);
190 udf_release_data(epos.bh); 190 brelse(epos.bh);
191 return 0; 191 return 0;
192 } 192 }
193 193
@@ -245,9 +245,9 @@ do_udf_readdir(struct inode * dir, struct file *filp, filldir_t filldir, void *d
245 if (filldir(dirent, fname, flen, filp->f_pos, iblock, dt_type) < 0) 245 if (filldir(dirent, fname, flen, filp->f_pos, iblock, dt_type) < 0)
246 { 246 {
247 if (fibh.sbh != fibh.ebh) 247 if (fibh.sbh != fibh.ebh)
248 udf_release_data(fibh.ebh); 248 brelse(fibh.ebh);
249 udf_release_data(fibh.sbh); 249 brelse(fibh.sbh);
250 udf_release_data(epos.bh); 250 brelse(epos.bh);
251 return 0; 251 return 0;
252 } 252 }
253 } 253 }
@@ -256,9 +256,9 @@ do_udf_readdir(struct inode * dir, struct file *filp, filldir_t filldir, void *d
256 filp->f_pos = nf_pos + 1; 256 filp->f_pos = nf_pos + 1;
257 257
258 if (fibh.sbh != fibh.ebh) 258 if (fibh.sbh != fibh.ebh)
259 udf_release_data(fibh.ebh); 259 brelse(fibh.ebh);
260 udf_release_data(fibh.sbh); 260 brelse(fibh.sbh);
261 udf_release_data(epos.bh); 261 brelse(epos.bh);
262 262
263 return 0; 263 return 0;
264} 264}
diff --git a/fs/udf/directory.c b/fs/udf/directory.c
index 9f66cfe124c6..198caa33027a 100644
--- a/fs/udf/directory.c
+++ b/fs/udf/directory.c
@@ -36,14 +36,14 @@ udf_filead_read(struct inode *dir, uint8_t *tmpad, uint8_t ad_size,
36 36
37 if (!ad) 37 if (!ad)
38 { 38 {
39 udf_release_data(*bh); 39 brelse(*bh);
40 *error = 1; 40 *error = 1;
41 return NULL; 41 return NULL;
42 } 42 }
43 43
44 if (*offset == dir->i_sb->s_blocksize) 44 if (*offset == dir->i_sb->s_blocksize)
45 { 45 {
46 udf_release_data(*bh); 46 brelse(*bh);
47 block = udf_get_lb_pblock(dir->i_sb, fe_loc, ++*pos); 47 block = udf_get_lb_pblock(dir->i_sb, fe_loc, ++*pos);
48 if (!block) 48 if (!block)
49 return NULL; 49 return NULL;
@@ -57,7 +57,7 @@ udf_filead_read(struct inode *dir, uint8_t *tmpad, uint8_t ad_size,
57 remainder = dir->i_sb->s_blocksize - loffset; 57 remainder = dir->i_sb->s_blocksize - loffset;
58 memcpy((uint8_t *)ad, (*bh)->b_data + loffset, remainder); 58 memcpy((uint8_t *)ad, (*bh)->b_data + loffset, remainder);
59 59
60 udf_release_data(*bh); 60 brelse(*bh);
61 block = udf_get_lb_pblock(dir->i_sb, fe_loc, ++*pos); 61 block = udf_get_lb_pblock(dir->i_sb, fe_loc, ++*pos);
62 if (!block) 62 if (!block)
63 return NULL; 63 return NULL;
@@ -120,7 +120,7 @@ udf_fileident_read(struct inode *dir, loff_t *nf_pos,
120 else 120 else
121 epos->offset = lextoffset; 121 epos->offset = lextoffset;
122 122
123 udf_release_data(fibh->sbh); 123 brelse(fibh->sbh);
124 if (!(fibh->sbh = fibh->ebh = udf_tread(dir->i_sb, block))) 124 if (!(fibh->sbh = fibh->ebh = udf_tread(dir->i_sb, block)))
125 return NULL; 125 return NULL;
126 fibh->soffset = fibh->eoffset = 0; 126 fibh->soffset = fibh->eoffset = 0;
@@ -149,7 +149,7 @@ udf_fileident_read(struct inode *dir, loff_t *nf_pos,
149 } 149 }
150 else if (fibh->sbh != fibh->ebh) 150 else if (fibh->sbh != fibh->ebh)
151 { 151 {
152 udf_release_data(fibh->sbh); 152 brelse(fibh->sbh);
153 fibh->sbh = fibh->ebh; 153 fibh->sbh = fibh->ebh;
154 } 154 }
155 155
diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index a106acb58292..2171bcfeec20 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -247,7 +247,7 @@ struct buffer_head * udf_expand_dir_adinicb(struct inode *inode, int *block, int
247 sfi = udf_fileident_read(inode, &f_pos, &sfibh, &cfi, NULL, NULL, NULL, NULL); 247 sfi = udf_fileident_read(inode, &f_pos, &sfibh, &cfi, NULL, NULL, NULL, NULL);
248 if (!sfi) 248 if (!sfi)
249 { 249 {
250 udf_release_data(dbh); 250 brelse(dbh);
251 return NULL; 251 return NULL;
252 } 252 }
253 UDF_I_ALLOCTYPE(inode) = alloctype; 253 UDF_I_ALLOCTYPE(inode) = alloctype;
@@ -259,7 +259,7 @@ struct buffer_head * udf_expand_dir_adinicb(struct inode *inode, int *block, int
259 sfi->fileIdent + le16_to_cpu(sfi->lengthOfImpUse))) 259 sfi->fileIdent + le16_to_cpu(sfi->lengthOfImpUse)))
260 { 260 {
261 UDF_I_ALLOCTYPE(inode) = ICBTAG_FLAG_AD_IN_ICB; 261 UDF_I_ALLOCTYPE(inode) = ICBTAG_FLAG_AD_IN_ICB;
262 udf_release_data(dbh); 262 brelse(dbh);
263 return NULL; 263 return NULL;
264 } 264 }
265 } 265 }
@@ -277,7 +277,7 @@ struct buffer_head * udf_expand_dir_adinicb(struct inode *inode, int *block, int
277 udf_add_aext(inode, &epos, eloc, elen, 0); 277 udf_add_aext(inode, &epos, eloc, elen, 0);
278 /* UniqueID stuff */ 278 /* UniqueID stuff */
279 279
280 udf_release_data(epos.bh); 280 brelse(epos.bh);
281 mark_inode_dirty(inode); 281 mark_inode_dirty(inode);
282 return dbh; 282 return dbh;
283} 283}
@@ -386,14 +386,14 @@ static struct buffer_head * inode_getblk(struct inode * inode, sector_t block,
386 { 386 {
387 if (prev_epos.bh != cur_epos.bh) 387 if (prev_epos.bh != cur_epos.bh)
388 { 388 {
389 udf_release_data(prev_epos.bh); 389 brelse(prev_epos.bh);
390 atomic_inc(&cur_epos.bh->b_count); 390 get_bh(cur_epos.bh);
391 prev_epos.bh = cur_epos.bh; 391 prev_epos.bh = cur_epos.bh;
392 } 392 }
393 if (cur_epos.bh != next_epos.bh) 393 if (cur_epos.bh != next_epos.bh)
394 { 394 {
395 udf_release_data(cur_epos.bh); 395 brelse(cur_epos.bh);
396 atomic_inc(&next_epos.bh->b_count); 396 get_bh(next_epos.bh);
397 cur_epos.bh = next_epos.bh; 397 cur_epos.bh = next_epos.bh;
398 } 398 }
399 399
@@ -436,9 +436,9 @@ static struct buffer_head * inode_getblk(struct inode * inode, sector_t block,
436 ~(inode->i_sb->s_blocksize - 1)); 436 ~(inode->i_sb->s_blocksize - 1));
437 etype = udf_write_aext(inode, &cur_epos, eloc, elen, 1); 437 etype = udf_write_aext(inode, &cur_epos, eloc, elen, 1);
438 } 438 }
439 udf_release_data(prev_epos.bh); 439 brelse(prev_epos.bh);
440 udf_release_data(cur_epos.bh); 440 brelse(cur_epos.bh);
441 udf_release_data(next_epos.bh); 441 brelse(next_epos.bh);
442 newblock = udf_get_lb_pblock(inode->i_sb, eloc, offset); 442 newblock = udf_get_lb_pblock(inode->i_sb, eloc, offset);
443 *phys = newblock; 443 *phys = newblock;
444 return NULL; 444 return NULL;
@@ -492,8 +492,8 @@ static struct buffer_head * inode_getblk(struct inode * inode, sector_t block,
492 else 492 else
493 lastblock = 1; 493 lastblock = 1;
494 } 494 }
495 udf_release_data(cur_epos.bh); 495 brelse(cur_epos.bh);
496 udf_release_data(next_epos.bh); 496 brelse(next_epos.bh);
497 497
498 /* if the current extent is not recorded but allocated, get the 498 /* if the current extent is not recorded but allocated, get the
499 block in the extent corresponding to the requested block */ 499 block in the extent corresponding to the requested block */
@@ -513,7 +513,7 @@ static struct buffer_head * inode_getblk(struct inode * inode, sector_t block,
513 if (!(newblocknum = udf_new_block(inode->i_sb, inode, 513 if (!(newblocknum = udf_new_block(inode->i_sb, inode,
514 UDF_I_LOCATION(inode).partitionReferenceNum, goal, err))) 514 UDF_I_LOCATION(inode).partitionReferenceNum, goal, err)))
515 { 515 {
516 udf_release_data(prev_epos.bh); 516 brelse(prev_epos.bh);
517 *err = -ENOSPC; 517 *err = -ENOSPC;
518 return NULL; 518 return NULL;
519 } 519 }
@@ -538,7 +538,7 @@ static struct buffer_head * inode_getblk(struct inode * inode, sector_t block,
538 the new number of extents is less than the old number */ 538 the new number of extents is less than the old number */
539 udf_update_extents(inode, laarr, startnum, endnum, &prev_epos); 539 udf_update_extents(inode, laarr, startnum, endnum, &prev_epos);
540 540
541 udf_release_data(prev_epos.bh); 541 brelse(prev_epos.bh);
542 542
543 if (!(newblock = udf_get_pblock(inode->i_sb, newblocknum, 543 if (!(newblock = udf_get_pblock(inode->i_sb, newblocknum,
544 UDF_I_LOCATION(inode).partitionReferenceNum, 0))) 544 UDF_I_LOCATION(inode).partitionReferenceNum, 0)))
@@ -934,7 +934,7 @@ __udf_read_inode(struct inode *inode)
934 { 934 {
935 printk(KERN_ERR "udf: udf_read_inode(ino %ld) failed ident=%d\n", 935 printk(KERN_ERR "udf: udf_read_inode(ino %ld) failed ident=%d\n",
936 inode->i_ino, ident); 936 inode->i_ino, ident);
937 udf_release_data(bh); 937 brelse(bh);
938 make_bad_inode(inode); 938 make_bad_inode(inode);
939 return; 939 return;
940 } 940 }
@@ -963,35 +963,35 @@ __udf_read_inode(struct inode *inode)
963 ident == TAG_IDENT_EFE) 963 ident == TAG_IDENT_EFE)
964 { 964 {
965 memcpy(&UDF_I_LOCATION(inode), &loc, sizeof(kernel_lb_addr)); 965 memcpy(&UDF_I_LOCATION(inode), &loc, sizeof(kernel_lb_addr));
966 udf_release_data(bh); 966 brelse(bh);
967 udf_release_data(ibh); 967 brelse(ibh);
968 udf_release_data(nbh); 968 brelse(nbh);
969 __udf_read_inode(inode); 969 __udf_read_inode(inode);
970 return; 970 return;
971 } 971 }
972 else 972 else
973 { 973 {
974 udf_release_data(nbh); 974 brelse(nbh);
975 udf_release_data(ibh); 975 brelse(ibh);
976 } 976 }
977 } 977 }
978 else 978 else
979 udf_release_data(ibh); 979 brelse(ibh);
980 } 980 }
981 } 981 }
982 else 982 else
983 udf_release_data(ibh); 983 brelse(ibh);
984 } 984 }
985 else if (le16_to_cpu(fe->icbTag.strategyType) != 4) 985 else if (le16_to_cpu(fe->icbTag.strategyType) != 4)
986 { 986 {
987 printk(KERN_ERR "udf: unsupported strategy type: %d\n", 987 printk(KERN_ERR "udf: unsupported strategy type: %d\n",
988 le16_to_cpu(fe->icbTag.strategyType)); 988 le16_to_cpu(fe->icbTag.strategyType));
989 udf_release_data(bh); 989 brelse(bh);
990 make_bad_inode(inode); 990 make_bad_inode(inode);
991 return; 991 return;
992 } 992 }
993 udf_fill_inode(inode, bh); 993 udf_fill_inode(inode, bh);
994 udf_release_data(bh); 994 brelse(bh);
995} 995}
996 996
997static void udf_fill_inode(struct inode *inode, struct buffer_head *bh) 997static void udf_fill_inode(struct inode *inode, struct buffer_head *bh)
@@ -1334,7 +1334,7 @@ udf_update_inode(struct inode *inode, int do_sync)
1334 use->descTag.tagChecksum += ((uint8_t *)&(use->descTag))[i]; 1334 use->descTag.tagChecksum += ((uint8_t *)&(use->descTag))[i];
1335 1335
1336 mark_buffer_dirty(bh); 1336 mark_buffer_dirty(bh);
1337 udf_release_data(bh); 1337 brelse(bh);
1338 return err; 1338 return err;
1339 } 1339 }
1340 1340
@@ -1523,7 +1523,7 @@ udf_update_inode(struct inode *inode, int do_sync)
1523 err = -EIO; 1523 err = -EIO;
1524 } 1524 }
1525 } 1525 }
1526 udf_release_data(bh); 1526 brelse(bh);
1527 return err; 1527 return err;
1528} 1528}
1529 1529
@@ -1670,7 +1670,7 @@ int8_t udf_add_aext(struct inode *inode, struct extent_position *epos,
1670 else 1670 else
1671 udf_update_tag(epos->bh->b_data, sizeof(struct allocExtDesc)); 1671 udf_update_tag(epos->bh->b_data, sizeof(struct allocExtDesc));
1672 mark_buffer_dirty_inode(epos->bh, inode); 1672 mark_buffer_dirty_inode(epos->bh, inode);
1673 udf_release_data(epos->bh); 1673 brelse(epos->bh);
1674 } 1674 }
1675 else 1675 else
1676 mark_inode_dirty(inode); 1676 mark_inode_dirty(inode);
@@ -1761,7 +1761,7 @@ int8_t udf_next_aext(struct inode *inode, struct extent_position *epos,
1761 { 1761 {
1762 epos->block = *eloc; 1762 epos->block = *eloc;
1763 epos->offset = sizeof(struct allocExtDesc); 1763 epos->offset = sizeof(struct allocExtDesc);
1764 udf_release_data(epos->bh); 1764 brelse(epos->bh);
1765 if (!(epos->bh = udf_tread(inode->i_sb, udf_get_lb_pblock(inode->i_sb, epos->block, 0)))) 1765 if (!(epos->bh = udf_tread(inode->i_sb, udf_get_lb_pblock(inode->i_sb, epos->block, 0))))
1766 { 1766 {
1767 udf_debug("reading block %d failed!\n", 1767 udf_debug("reading block %d failed!\n",
@@ -1841,7 +1841,7 @@ udf_insert_aext(struct inode *inode, struct extent_position epos,
1841 int8_t etype; 1841 int8_t etype;
1842 1842
1843 if (epos.bh) 1843 if (epos.bh)
1844 atomic_inc(&epos.bh->b_count); 1844 get_bh(epos.bh);
1845 1845
1846 while ((etype = udf_next_aext(inode, &epos, &oeloc, &oelen, 0)) != -1) 1846 while ((etype = udf_next_aext(inode, &epos, &oeloc, &oelen, 0)) != -1)
1847 { 1847 {
@@ -1851,7 +1851,7 @@ udf_insert_aext(struct inode *inode, struct extent_position epos,
1851 nelen = (etype << 30) | oelen; 1851 nelen = (etype << 30) | oelen;
1852 } 1852 }
1853 udf_add_aext(inode, &epos, neloc, nelen, 1); 1853 udf_add_aext(inode, &epos, neloc, nelen, 1);
1854 udf_release_data(epos.bh); 1854 brelse(epos.bh);
1855 return (nelen >> 30); 1855 return (nelen >> 30);
1856} 1856}
1857 1857
@@ -1865,8 +1865,8 @@ int8_t udf_delete_aext(struct inode *inode, struct extent_position epos,
1865 1865
1866 if (epos.bh) 1866 if (epos.bh)
1867 { 1867 {
1868 atomic_inc(&epos.bh->b_count); 1868 get_bh(epos.bh);
1869 atomic_inc(&epos.bh->b_count); 1869 get_bh(epos.bh);
1870 } 1870 }
1871 1871
1872 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_SHORT) 1872 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_SHORT)
@@ -1886,8 +1886,8 @@ int8_t udf_delete_aext(struct inode *inode, struct extent_position epos,
1886 if (oepos.bh != epos.bh) 1886 if (oepos.bh != epos.bh)
1887 { 1887 {
1888 oepos.block = epos.block; 1888 oepos.block = epos.block;
1889 udf_release_data(oepos.bh); 1889 brelse(oepos.bh);
1890 atomic_inc(&epos.bh->b_count); 1890 get_bh(epos.bh);
1891 oepos.bh = epos.bh; 1891 oepos.bh = epos.bh;
1892 oepos.offset = epos.offset - adsize; 1892 oepos.offset = epos.offset - adsize;
1893 } 1893 }
@@ -1938,8 +1938,8 @@ int8_t udf_delete_aext(struct inode *inode, struct extent_position epos,
1938 } 1938 }
1939 } 1939 }
1940 1940
1941 udf_release_data(epos.bh); 1941 brelse(epos.bh);
1942 udf_release_data(oepos.bh); 1942 brelse(oepos.bh);
1943 return (elen >> 30); 1943 return (elen >> 30);
1944} 1944}
1945 1945
@@ -1992,7 +1992,7 @@ long udf_block_map(struct inode *inode, sector_t block)
1992 ret = 0; 1992 ret = 0;
1993 1993
1994 unlock_kernel(); 1994 unlock_kernel();
1995 udf_release_data(epos.bh); 1995 brelse(epos.bh);
1996 1996
1997 if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_VARCONV)) 1997 if (UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_VARCONV))
1998 return udf_fixed_to_variable(ret); 1998 return udf_fixed_to_variable(ret);
diff --git a/fs/udf/misc.c b/fs/udf/misc.c
index cc8ca3254db1..a2b2a98ce78a 100644
--- a/fs/udf/misc.c
+++ b/fs/udf/misc.c
@@ -274,12 +274,6 @@ udf_read_ptagged(struct super_block *sb, kernel_lb_addr loc, uint32_t offset, ui
274 loc.logicalBlockNum + offset, ident); 274 loc.logicalBlockNum + offset, ident);
275} 275}
276 276
277void udf_release_data(struct buffer_head *bh)
278{
279 if (bh)
280 brelse(bh);
281}
282
283void udf_update_tag(char *data, int length) 277void udf_update_tag(char *data, int length)
284{ 278{
285 tag *tptr = (tag *)data; 279 tag *tptr = (tag *)data;
diff --git a/fs/udf/namei.c b/fs/udf/namei.c
index f85ad13b3dff..91df4928651c 100644
--- a/fs/udf/namei.c
+++ b/fs/udf/namei.c
@@ -182,13 +182,13 @@ udf_find_entry(struct inode *dir, struct dentry *dentry,
182 182
183 if (!(fibh->sbh = fibh->ebh = udf_tread(dir->i_sb, block))) 183 if (!(fibh->sbh = fibh->ebh = udf_tread(dir->i_sb, block)))
184 { 184 {
185 udf_release_data(epos.bh); 185 brelse(epos.bh);
186 return NULL; 186 return NULL;
187 } 187 }
188 } 188 }
189 else 189 else
190 { 190 {
191 udf_release_data(epos.bh); 191 brelse(epos.bh);
192 return NULL; 192 return NULL;
193 } 193 }
194 194
@@ -199,9 +199,9 @@ udf_find_entry(struct inode *dir, struct dentry *dentry,
199 if (!fi) 199 if (!fi)
200 { 200 {
201 if (fibh->sbh != fibh->ebh) 201 if (fibh->sbh != fibh->ebh)
202 udf_release_data(fibh->ebh); 202 brelse(fibh->ebh);
203 udf_release_data(fibh->sbh); 203 brelse(fibh->sbh);
204 udf_release_data(epos.bh); 204 brelse(epos.bh);
205 return NULL; 205 return NULL;
206 } 206 }
207 207
@@ -247,15 +247,15 @@ udf_find_entry(struct inode *dir, struct dentry *dentry,
247 { 247 {
248 if (udf_match(flen, fname, dentry->d_name.len, dentry->d_name.name)) 248 if (udf_match(flen, fname, dentry->d_name.len, dentry->d_name.name))
249 { 249 {
250 udf_release_data(epos.bh); 250 brelse(epos.bh);
251 return fi; 251 return fi;
252 } 252 }
253 } 253 }
254 } 254 }
255 if (fibh->sbh != fibh->ebh) 255 if (fibh->sbh != fibh->ebh)
256 udf_release_data(fibh->ebh); 256 brelse(fibh->ebh);
257 udf_release_data(fibh->sbh); 257 brelse(fibh->sbh);
258 udf_release_data(epos.bh); 258 brelse(epos.bh);
259 return NULL; 259 return NULL;
260} 260}
261 261
@@ -321,8 +321,8 @@ udf_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
321 if (udf_find_entry(dir, dentry, &fibh, &cfi)) 321 if (udf_find_entry(dir, dentry, &fibh, &cfi))
322 { 322 {
323 if (fibh.sbh != fibh.ebh) 323 if (fibh.sbh != fibh.ebh)
324 udf_release_data(fibh.ebh); 324 brelse(fibh.ebh);
325 udf_release_data(fibh.sbh); 325 brelse(fibh.sbh);
326 326
327 inode = udf_iget(dir->i_sb, lelb_to_cpu(cfi.icb.extLocation)); 327 inode = udf_iget(dir->i_sb, lelb_to_cpu(cfi.icb.extLocation));
328 if ( !inode ) 328 if ( !inode )
@@ -400,7 +400,7 @@ udf_add_entry(struct inode *dir, struct dentry *dentry,
400 400
401 if (!(fibh->sbh = fibh->ebh = udf_tread(dir->i_sb, block))) 401 if (!(fibh->sbh = fibh->ebh = udf_tread(dir->i_sb, block)))
402 { 402 {
403 udf_release_data(epos.bh); 403 brelse(epos.bh);
404 *err = -EIO; 404 *err = -EIO;
405 return NULL; 405 return NULL;
406 } 406 }
@@ -423,9 +423,9 @@ udf_add_entry(struct inode *dir, struct dentry *dentry,
423 if (!fi) 423 if (!fi)
424 { 424 {
425 if (fibh->sbh != fibh->ebh) 425 if (fibh->sbh != fibh->ebh)
426 udf_release_data(fibh->ebh); 426 brelse(fibh->ebh);
427 udf_release_data(fibh->sbh); 427 brelse(fibh->sbh);
428 udf_release_data(epos.bh); 428 brelse(epos.bh);
429 *err = -EIO; 429 *err = -EIO;
430 return NULL; 430 return NULL;
431 } 431 }
@@ -455,7 +455,7 @@ udf_add_entry(struct inode *dir, struct dentry *dentry,
455 { 455 {
456 if (((sizeof(struct fileIdentDesc) + liu + lfi + 3) & ~3) == nfidlen) 456 if (((sizeof(struct fileIdentDesc) + liu + lfi + 3) & ~3) == nfidlen)
457 { 457 {
458 udf_release_data(epos.bh); 458 brelse(epos.bh);
459 cfi->descTag.tagSerialNum = cpu_to_le16(1); 459 cfi->descTag.tagSerialNum = cpu_to_le16(1);
460 cfi->fileVersionNum = cpu_to_le16(1); 460 cfi->fileVersionNum = cpu_to_le16(1);
461 cfi->fileCharacteristics = 0; 461 cfi->fileCharacteristics = 0;
@@ -478,9 +478,9 @@ udf_add_entry(struct inode *dir, struct dentry *dentry,
478 udf_match(flen, fname, dentry->d_name.len, dentry->d_name.name)) 478 udf_match(flen, fname, dentry->d_name.len, dentry->d_name.name))
479 { 479 {
480 if (fibh->sbh != fibh->ebh) 480 if (fibh->sbh != fibh->ebh)
481 udf_release_data(fibh->ebh); 481 brelse(fibh->ebh);
482 udf_release_data(fibh->sbh); 482 brelse(fibh->sbh);
483 udf_release_data(epos.bh); 483 brelse(epos.bh);
484 *err = -EEXIST; 484 *err = -EEXIST;
485 return NULL; 485 return NULL;
486 } 486 }
@@ -492,14 +492,14 @@ add:
492 if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_IN_ICB && 492 if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_IN_ICB &&
493 sb->s_blocksize - fibh->eoffset < nfidlen) 493 sb->s_blocksize - fibh->eoffset < nfidlen)
494 { 494 {
495 udf_release_data(epos.bh); 495 brelse(epos.bh);
496 epos.bh = NULL; 496 epos.bh = NULL;
497 fibh->soffset -= udf_ext0_offset(dir); 497 fibh->soffset -= udf_ext0_offset(dir);
498 fibh->eoffset -= udf_ext0_offset(dir); 498 fibh->eoffset -= udf_ext0_offset(dir);
499 f_pos -= (udf_ext0_offset(dir) >> 2); 499 f_pos -= (udf_ext0_offset(dir) >> 2);
500 if (fibh->sbh != fibh->ebh) 500 if (fibh->sbh != fibh->ebh)
501 udf_release_data(fibh->ebh); 501 brelse(fibh->ebh);
502 udf_release_data(fibh->sbh); 502 brelse(fibh->sbh);
503 if (!(fibh->sbh = fibh->ebh = udf_expand_dir_adinicb(dir, &block, err))) 503 if (!(fibh->sbh = fibh->ebh = udf_expand_dir_adinicb(dir, &block, err)))
504 return NULL; 504 return NULL;
505 epos.block = UDF_I_LOCATION(dir); 505 epos.block = UDF_I_LOCATION(dir);
@@ -519,7 +519,7 @@ add:
519 fibh->eoffset += nfidlen; 519 fibh->eoffset += nfidlen;
520 if (fibh->sbh != fibh->ebh) 520 if (fibh->sbh != fibh->ebh)
521 { 521 {
522 udf_release_data(fibh->sbh); 522 brelse(fibh->sbh);
523 fibh->sbh = fibh->ebh; 523 fibh->sbh = fibh->ebh;
524 } 524 }
525 525
@@ -541,7 +541,7 @@ add:
541 fibh->eoffset += nfidlen - sb->s_blocksize; 541 fibh->eoffset += nfidlen - sb->s_blocksize;
542 if (fibh->sbh != fibh->ebh) 542 if (fibh->sbh != fibh->ebh)
543 { 543 {
544 udf_release_data(fibh->sbh); 544 brelse(fibh->sbh);
545 fibh->sbh = fibh->ebh; 545 fibh->sbh = fibh->ebh;
546 } 546 }
547 547
@@ -550,8 +550,8 @@ add:
550 550
551 if (!(fibh->ebh = udf_bread(dir, f_pos >> (dir->i_sb->s_blocksize_bits - 2), 1, err))) 551 if (!(fibh->ebh = udf_bread(dir, f_pos >> (dir->i_sb->s_blocksize_bits - 2), 1, err)))
552 { 552 {
553 udf_release_data(epos.bh); 553 brelse(epos.bh);
554 udf_release_data(fibh->sbh); 554 brelse(fibh->sbh);
555 return NULL; 555 return NULL;
556 } 556 }
557 557
@@ -566,7 +566,7 @@ add:
566 else 566 else
567 block ++; 567 block ++;
568 568
569 udf_release_data(fibh->sbh); 569 brelse(fibh->sbh);
570 fibh->sbh = fibh->ebh; 570 fibh->sbh = fibh->ebh;
571 fi = (struct fileIdentDesc *)(fibh->sbh->b_data); 571 fi = (struct fileIdentDesc *)(fibh->sbh->b_data);
572 } 572 }
@@ -587,7 +587,7 @@ add:
587 cfi->lengthOfImpUse = cpu_to_le16(0); 587 cfi->lengthOfImpUse = cpu_to_le16(0);
588 if (!udf_write_fi(dir, cfi, fi, fibh, NULL, name)) 588 if (!udf_write_fi(dir, cfi, fi, fibh, NULL, name))
589 { 589 {
590 udf_release_data(epos.bh); 590 brelse(epos.bh);
591 dir->i_size += nfidlen; 591 dir->i_size += nfidlen;
592 if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_IN_ICB) 592 if (UDF_I_ALLOCTYPE(dir) == ICBTAG_FLAG_AD_IN_ICB)
593 UDF_I_LENALLOC(dir) += nfidlen; 593 UDF_I_LENALLOC(dir) += nfidlen;
@@ -596,10 +596,10 @@ add:
596 } 596 }
597 else 597 else
598 { 598 {
599 udf_release_data(epos.bh); 599 brelse(epos.bh);
600 if (fibh->sbh != fibh->ebh) 600 if (fibh->sbh != fibh->ebh)
601 udf_release_data(fibh->ebh); 601 brelse(fibh->ebh);
602 udf_release_data(fibh->sbh); 602 brelse(fibh->sbh);
603 *err = -EIO; 603 *err = -EIO;
604 return NULL; 604 return NULL;
605 } 605 }
@@ -656,8 +656,8 @@ static int udf_create(struct inode *dir, struct dentry *dentry, int mode, struct
656 mark_inode_dirty(dir); 656 mark_inode_dirty(dir);
657 } 657 }
658 if (fibh.sbh != fibh.ebh) 658 if (fibh.sbh != fibh.ebh)
659 udf_release_data(fibh.ebh); 659 brelse(fibh.ebh);
660 udf_release_data(fibh.sbh); 660 brelse(fibh.sbh);
661 unlock_kernel(); 661 unlock_kernel();
662 d_instantiate(dentry, inode); 662 d_instantiate(dentry, inode);
663 return 0; 663 return 0;
@@ -701,8 +701,8 @@ static int udf_mknod(struct inode * dir, struct dentry * dentry, int mode, dev_t
701 mark_inode_dirty(inode); 701 mark_inode_dirty(inode);
702 702
703 if (fibh.sbh != fibh.ebh) 703 if (fibh.sbh != fibh.ebh)
704 udf_release_data(fibh.ebh); 704 brelse(fibh.ebh);
705 udf_release_data(fibh.sbh); 705 brelse(fibh.sbh);
706 d_instantiate(dentry, inode); 706 d_instantiate(dentry, inode);
707 err = 0; 707 err = 0;
708out: 708out:
@@ -743,7 +743,7 @@ static int udf_mkdir(struct inode * dir, struct dentry * dentry, int mode)
743 cpu_to_le32(UDF_I_UNIQUE(dir) & 0x00000000FFFFFFFFUL); 743 cpu_to_le32(UDF_I_UNIQUE(dir) & 0x00000000FFFFFFFFUL);
744 cfi.fileCharacteristics = FID_FILE_CHAR_DIRECTORY | FID_FILE_CHAR_PARENT; 744 cfi.fileCharacteristics = FID_FILE_CHAR_DIRECTORY | FID_FILE_CHAR_PARENT;
745 udf_write_fi(inode, &cfi, fi, &fibh, NULL, NULL); 745 udf_write_fi(inode, &cfi, fi, &fibh, NULL, NULL);
746 udf_release_data(fibh.sbh); 746 brelse(fibh.sbh);
747 inode->i_mode = S_IFDIR | mode; 747 inode->i_mode = S_IFDIR | mode;
748 if (dir->i_mode & S_ISGID) 748 if (dir->i_mode & S_ISGID)
749 inode->i_mode |= S_ISGID; 749 inode->i_mode |= S_ISGID;
@@ -766,8 +766,8 @@ static int udf_mkdir(struct inode * dir, struct dentry * dentry, int mode)
766 mark_inode_dirty(dir); 766 mark_inode_dirty(dir);
767 d_instantiate(dentry, inode); 767 d_instantiate(dentry, inode);
768 if (fibh.sbh != fibh.ebh) 768 if (fibh.sbh != fibh.ebh)
769 udf_release_data(fibh.ebh); 769 brelse(fibh.ebh);
770 udf_release_data(fibh.sbh); 770 brelse(fibh.sbh);
771 err = 0; 771 err = 0;
772out: 772out:
773 unlock_kernel(); 773 unlock_kernel();
@@ -808,13 +808,13 @@ static int empty_dir(struct inode *dir)
808 808
809 if (!(fibh.sbh = fibh.ebh = udf_tread(dir->i_sb, block))) 809 if (!(fibh.sbh = fibh.ebh = udf_tread(dir->i_sb, block)))
810 { 810 {
811 udf_release_data(epos.bh); 811 brelse(epos.bh);
812 return 0; 812 return 0;
813 } 813 }
814 } 814 }
815 else 815 else
816 { 816 {
817 udf_release_data(epos.bh); 817 brelse(epos.bh);
818 return 0; 818 return 0;
819 } 819 }
820 820
@@ -826,25 +826,25 @@ static int empty_dir(struct inode *dir)
826 if (!fi) 826 if (!fi)
827 { 827 {
828 if (fibh.sbh != fibh.ebh) 828 if (fibh.sbh != fibh.ebh)
829 udf_release_data(fibh.ebh); 829 brelse(fibh.ebh);
830 udf_release_data(fibh.sbh); 830 brelse(fibh.sbh);
831 udf_release_data(epos.bh); 831 brelse(epos.bh);
832 return 0; 832 return 0;
833 } 833 }
834 834
835 if (cfi.lengthFileIdent && (cfi.fileCharacteristics & FID_FILE_CHAR_DELETED) == 0) 835 if (cfi.lengthFileIdent && (cfi.fileCharacteristics & FID_FILE_CHAR_DELETED) == 0)
836 { 836 {
837 if (fibh.sbh != fibh.ebh) 837 if (fibh.sbh != fibh.ebh)
838 udf_release_data(fibh.ebh); 838 brelse(fibh.ebh);
839 udf_release_data(fibh.sbh); 839 brelse(fibh.sbh);
840 udf_release_data(epos.bh); 840 brelse(epos.bh);
841 return 0; 841 return 0;
842 } 842 }
843 } 843 }
844 if (fibh.sbh != fibh.ebh) 844 if (fibh.sbh != fibh.ebh)
845 udf_release_data(fibh.ebh); 845 brelse(fibh.ebh);
846 udf_release_data(fibh.sbh); 846 brelse(fibh.sbh);
847 udf_release_data(epos.bh); 847 brelse(epos.bh);
848 return 1; 848 return 1;
849} 849}
850 850
@@ -884,8 +884,8 @@ static int udf_rmdir(struct inode * dir, struct dentry * dentry)
884 884
885end_rmdir: 885end_rmdir:
886 if (fibh.sbh != fibh.ebh) 886 if (fibh.sbh != fibh.ebh)
887 udf_release_data(fibh.ebh); 887 brelse(fibh.ebh);
888 udf_release_data(fibh.sbh); 888 brelse(fibh.sbh);
889out: 889out:
890 unlock_kernel(); 890 unlock_kernel();
891 return retval; 891 return retval;
@@ -928,8 +928,8 @@ static int udf_unlink(struct inode * dir, struct dentry * dentry)
928 928
929end_unlink: 929end_unlink:
930 if (fibh.sbh != fibh.ebh) 930 if (fibh.sbh != fibh.ebh)
931 udf_release_data(fibh.ebh); 931 brelse(fibh.ebh);
932 udf_release_data(fibh.sbh); 932 brelse(fibh.sbh);
933out: 933out:
934 unlock_kernel(); 934 unlock_kernel();
935 return retval; 935 return retval;
@@ -977,7 +977,7 @@ static int udf_symlink(struct inode * dir, struct dentry * dentry, const char *
977 elen = inode->i_sb->s_blocksize; 977 elen = inode->i_sb->s_blocksize;
978 UDF_I_LENEXTENTS(inode) = elen; 978 UDF_I_LENEXTENTS(inode) = elen;
979 udf_add_aext(inode, &epos, eloc, elen, 0); 979 udf_add_aext(inode, &epos, eloc, elen, 0);
980 udf_release_data(epos.bh); 980 brelse(epos.bh);
981 981
982 block = udf_get_pblock(inode->i_sb, block, 982 block = udf_get_pblock(inode->i_sb, block,
983 UDF_I_LOCATION(inode).partitionReferenceNum, 0); 983 UDF_I_LOCATION(inode).partitionReferenceNum, 0);
@@ -1060,7 +1060,7 @@ static int udf_symlink(struct inode * dir, struct dentry * dentry, const char *
1060 } 1060 }
1061 } 1061 }
1062 1062
1063 udf_release_data(epos.bh); 1063 brelse(epos.bh);
1064 inode->i_size = elen; 1064 inode->i_size = elen;
1065 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_IN_ICB) 1065 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_IN_ICB)
1066 UDF_I_LENALLOC(inode) = inode->i_size; 1066 UDF_I_LENALLOC(inode) = inode->i_size;
@@ -1089,8 +1089,8 @@ static int udf_symlink(struct inode * dir, struct dentry * dentry, const char *
1089 mark_inode_dirty(dir); 1089 mark_inode_dirty(dir);
1090 } 1090 }
1091 if (fibh.sbh != fibh.ebh) 1091 if (fibh.sbh != fibh.ebh)
1092 udf_release_data(fibh.ebh); 1092 brelse(fibh.ebh);
1093 udf_release_data(fibh.sbh); 1093 brelse(fibh.sbh);
1094 d_instantiate(dentry, inode); 1094 d_instantiate(dentry, inode);
1095 err = 0; 1095 err = 0;
1096 1096
@@ -1145,8 +1145,8 @@ static int udf_link(struct dentry * old_dentry, struct inode * dir,
1145 mark_inode_dirty(dir); 1145 mark_inode_dirty(dir);
1146 } 1146 }
1147 if (fibh.sbh != fibh.ebh) 1147 if (fibh.sbh != fibh.ebh)
1148 udf_release_data(fibh.ebh); 1148 brelse(fibh.ebh);
1149 udf_release_data(fibh.sbh); 1149 brelse(fibh.sbh);
1150 inc_nlink(inode); 1150 inc_nlink(inode);
1151 inode->i_ctime = current_fs_time(inode->i_sb); 1151 inode->i_ctime = current_fs_time(inode->i_sb);
1152 mark_inode_dirty(inode); 1152 mark_inode_dirty(inode);
@@ -1174,8 +1174,8 @@ static int udf_rename (struct inode * old_dir, struct dentry * old_dentry,
1174 if ((ofi = udf_find_entry(old_dir, old_dentry, &ofibh, &ocfi))) 1174 if ((ofi = udf_find_entry(old_dir, old_dentry, &ofibh, &ocfi)))
1175 { 1175 {
1176 if (ofibh.sbh != ofibh.ebh) 1176 if (ofibh.sbh != ofibh.ebh)
1177 udf_release_data(ofibh.ebh); 1177 brelse(ofibh.ebh);
1178 udf_release_data(ofibh.sbh); 1178 brelse(ofibh.sbh);
1179 } 1179 }
1180 tloc = lelb_to_cpu(ocfi.icb.extLocation); 1180 tloc = lelb_to_cpu(ocfi.icb.extLocation);
1181 if (!ofi || udf_get_lb_pblock(old_dir->i_sb, tloc, 0) 1181 if (!ofi || udf_get_lb_pblock(old_dir->i_sb, tloc, 0)
@@ -1188,8 +1188,8 @@ static int udf_rename (struct inode * old_dir, struct dentry * old_dentry,
1188 if (!new_inode) 1188 if (!new_inode)
1189 { 1189 {
1190 if (nfibh.sbh != nfibh.ebh) 1190 if (nfibh.sbh != nfibh.ebh)
1191 udf_release_data(nfibh.ebh); 1191 brelse(nfibh.ebh);
1192 udf_release_data(nfibh.sbh); 1192 brelse(nfibh.sbh);
1193 nfi = NULL; 1193 nfi = NULL;
1194 } 1194 }
1195 } 1195 }
@@ -1290,19 +1290,19 @@ static int udf_rename (struct inode * old_dir, struct dentry * old_dentry,
1290 if (ofi) 1290 if (ofi)
1291 { 1291 {
1292 if (ofibh.sbh != ofibh.ebh) 1292 if (ofibh.sbh != ofibh.ebh)
1293 udf_release_data(ofibh.ebh); 1293 brelse(ofibh.ebh);
1294 udf_release_data(ofibh.sbh); 1294 brelse(ofibh.sbh);
1295 } 1295 }
1296 1296
1297 retval = 0; 1297 retval = 0;
1298 1298
1299end_rename: 1299end_rename:
1300 udf_release_data(dir_bh); 1300 brelse(dir_bh);
1301 if (nfi) 1301 if (nfi)
1302 { 1302 {
1303 if (nfibh.sbh != nfibh.ebh) 1303 if (nfibh.sbh != nfibh.ebh)
1304 udf_release_data(nfibh.ebh); 1304 brelse(nfibh.ebh);
1305 udf_release_data(nfibh.sbh); 1305 brelse(nfibh.sbh);
1306 } 1306 }
1307 unlock_kernel(); 1307 unlock_kernel();
1308 return retval; 1308 return retval;
diff --git a/fs/udf/partition.c b/fs/udf/partition.c
index dabf2b841db8..467a26171cd9 100644
--- a/fs/udf/partition.c
+++ b/fs/udf/partition.c
@@ -81,7 +81,7 @@ uint32_t udf_get_pblock_virt15(struct super_block *sb, uint32_t block, uint16_t
81 81
82 loc = le32_to_cpu(((__le32 *)bh->b_data)[index]); 82 loc = le32_to_cpu(((__le32 *)bh->b_data)[index]);
83 83
84 udf_release_data(bh); 84 brelse(bh);
85 85
86 if (UDF_I_LOCATION(UDF_SB_VAT(sb)).partitionReferenceNum == partition) 86 if (UDF_I_LOCATION(UDF_SB_VAT(sb)).partitionReferenceNum == partition)
87 { 87 {
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)
563 563
564 if (vsd->stdIdent[0] == 0) 564 if (vsd->stdIdent[0] == 0)
565 { 565 {
566 udf_release_data(bh); 566 brelse(bh);
567 break; 567 break;
568 } 568 }
569 else if (!strncmp(vsd->stdIdent, VSD_STD_ID_CD001, VSD_STD_ID_LEN)) 569 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)
596 } 596 }
597 else if (!strncmp(vsd->stdIdent, VSD_STD_ID_TEA01, VSD_STD_ID_LEN)) 597 else if (!strncmp(vsd->stdIdent, VSD_STD_ID_TEA01, VSD_STD_ID_LEN))
598 { 598 {
599 udf_release_data(bh); 599 brelse(bh);
600 break; 600 break;
601 } 601 }
602 else if (!strncmp(vsd->stdIdent, VSD_STD_ID_NSR02, VSD_STD_ID_LEN)) 602 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)
607 { 607 {
608 nsr03 = sector; 608 nsr03 = sector;
609 } 609 }
610 udf_release_data(bh); 610 brelse(bh);
611 } 611 }
612 612
613 if (nsr03) 613 if (nsr03)
@@ -673,7 +673,7 @@ udf_find_anchor(struct super_block *sb)
673 { 673 {
674 ident = le16_to_cpu(((tag *)bh->b_data)->tagIdent); 674 ident = le16_to_cpu(((tag *)bh->b_data)->tagIdent);
675 location = le32_to_cpu(((tag *)bh->b_data)->tagLocation); 675 location = le32_to_cpu(((tag *)bh->b_data)->tagLocation);
676 udf_release_data(bh); 676 brelse(bh);
677 } 677 }
678 678
679 if (ident == TAG_IDENT_AVDP) 679 if (ident == TAG_IDENT_AVDP)
@@ -708,7 +708,7 @@ udf_find_anchor(struct super_block *sb)
708 { 708 {
709 ident = le16_to_cpu(((tag *)bh->b_data)->tagIdent); 709 ident = le16_to_cpu(((tag *)bh->b_data)->tagIdent);
710 location = le32_to_cpu(((tag *)bh->b_data)->tagLocation); 710 location = le32_to_cpu(((tag *)bh->b_data)->tagLocation);
711 udf_release_data(bh); 711 brelse(bh);
712 } 712 }
713 713
714 if (ident == TAG_IDENT_AVDP && 714 if (ident == TAG_IDENT_AVDP &&
@@ -727,7 +727,7 @@ udf_find_anchor(struct super_block *sb)
727 { 727 {
728 ident = le16_to_cpu(((tag *)bh->b_data)->tagIdent); 728 ident = le16_to_cpu(((tag *)bh->b_data)->tagIdent);
729 location = le32_to_cpu(((tag *)bh->b_data)->tagLocation); 729 location = le32_to_cpu(((tag *)bh->b_data)->tagLocation);
730 udf_release_data(bh); 730 brelse(bh);
731 } 731 }
732 732
733 if (ident == TAG_IDENT_AVDP && 733 if (ident == TAG_IDENT_AVDP &&
@@ -749,7 +749,7 @@ udf_find_anchor(struct super_block *sb)
749 { 749 {
750 ident = le16_to_cpu(((tag *)bh->b_data)->tagIdent); 750 ident = le16_to_cpu(((tag *)bh->b_data)->tagIdent);
751 location = le32_to_cpu(((tag *)bh->b_data)->tagLocation); 751 location = le32_to_cpu(((tag *)bh->b_data)->tagLocation);
752 udf_release_data(bh); 752 brelse(bh);
753 753
754 if (ident == TAG_IDENT_AVDP && location == 256) 754 if (ident == TAG_IDENT_AVDP && location == 256)
755 UDF_SET_FLAG(sb, UDF_FLAG_VARCONV); 755 UDF_SET_FLAG(sb, UDF_FLAG_VARCONV);
@@ -766,7 +766,7 @@ udf_find_anchor(struct super_block *sb)
766 } 766 }
767 else 767 else
768 { 768 {
769 udf_release_data(bh); 769 brelse(bh);
770 if ((ident != TAG_IDENT_AVDP) && (i || 770 if ((ident != TAG_IDENT_AVDP) && (i ||
771 (ident != TAG_IDENT_FE && ident != TAG_IDENT_EFE))) 771 (ident != TAG_IDENT_FE && ident != TAG_IDENT_EFE)))
772 { 772 {
@@ -795,7 +795,7 @@ udf_find_fileset(struct super_block *sb, kernel_lb_addr *fileset, kernel_lb_addr
795 return 1; 795 return 1;
796 else if (ident != TAG_IDENT_FSD) 796 else if (ident != TAG_IDENT_FSD)
797 { 797 {
798 udf_release_data(bh); 798 brelse(bh);
799 return 1; 799 return 1;
800 } 800 }
801 801
@@ -834,7 +834,7 @@ udf_find_fileset(struct super_block *sb, kernel_lb_addr *fileset, kernel_lb_addr
834 newfileset.logicalBlockNum += 1 + 834 newfileset.logicalBlockNum += 1 +
835 ((le32_to_cpu(sp->numOfBytes) + sizeof(struct spaceBitmapDesc) - 1) 835 ((le32_to_cpu(sp->numOfBytes) + sizeof(struct spaceBitmapDesc) - 1)
836 >> sb->s_blocksize_bits); 836 >> sb->s_blocksize_bits);
837 udf_release_data(bh); 837 brelse(bh);
838 break; 838 break;
839 } 839 }
840 case TAG_IDENT_FSD: 840 case TAG_IDENT_FSD:
@@ -845,7 +845,7 @@ udf_find_fileset(struct super_block *sb, kernel_lb_addr *fileset, kernel_lb_addr
845 default: 845 default:
846 { 846 {
847 newfileset.logicalBlockNum ++; 847 newfileset.logicalBlockNum ++;
848 udf_release_data(bh); 848 brelse(bh);
849 bh = NULL; 849 bh = NULL;
850 break; 850 break;
851 } 851 }
@@ -865,7 +865,7 @@ udf_find_fileset(struct super_block *sb, kernel_lb_addr *fileset, kernel_lb_addr
865 865
866 UDF_SB_PARTITION(sb) = fileset->partitionReferenceNum; 866 UDF_SB_PARTITION(sb) = fileset->partitionReferenceNum;
867 udf_load_fileset(sb, bh, root); 867 udf_load_fileset(sb, bh, root);
868 udf_release_data(bh); 868 brelse(bh);
869 return 0; 869 return 0;
870 } 870 }
871 return 1; 871 return 1;
@@ -1083,7 +1083,7 @@ udf_load_logicalvol(struct super_block *sb, struct buffer_head * bh, kernel_lb_a
1083 if (ident != 0 || 1083 if (ident != 0 ||
1084 strncmp(st->sparingIdent.ident, UDF_ID_SPARING, strlen(UDF_ID_SPARING))) 1084 strncmp(st->sparingIdent.ident, UDF_ID_SPARING, strlen(UDF_ID_SPARING)))
1085 { 1085 {
1086 udf_release_data(UDF_SB_TYPESPAR(sb,i).s_spar_map[j]); 1086 brelse(UDF_SB_TYPESPAR(sb,i).s_spar_map[j]);
1087 UDF_SB_TYPESPAR(sb,i).s_spar_map[j] = NULL; 1087 UDF_SB_TYPESPAR(sb,i).s_spar_map[j] = NULL;
1088 } 1088 }
1089 } 1089 }
@@ -1137,12 +1137,12 @@ udf_load_logicalvolint(struct super_block *sb, kernel_extent_ad loc)
1137 udf_load_logicalvolint(sb, leea_to_cpu(UDF_SB_LVID(sb)->nextIntegrityExt)); 1137 udf_load_logicalvolint(sb, leea_to_cpu(UDF_SB_LVID(sb)->nextIntegrityExt));
1138 1138
1139 if (UDF_SB_LVIDBH(sb) != bh) 1139 if (UDF_SB_LVIDBH(sb) != bh)
1140 udf_release_data(bh); 1140 brelse(bh);
1141 loc.extLength -= sb->s_blocksize; 1141 loc.extLength -= sb->s_blocksize;
1142 loc.extLocation ++; 1142 loc.extLocation ++;
1143 } 1143 }
1144 if (UDF_SB_LVIDBH(sb) != bh) 1144 if (UDF_SB_LVIDBH(sb) != bh)
1145 udf_release_data(bh); 1145 brelse(bh);
1146} 1146}
1147 1147
1148/* 1148/*
@@ -1245,7 +1245,7 @@ udf_process_sequence(struct super_block *sb, long block, long lastblock, kernel_
1245 done = 1; 1245 done = 1;
1246 break; 1246 break;
1247 } 1247 }
1248 udf_release_data(bh); 1248 brelse(bh);
1249 } 1249 }
1250 for (i=0; i<VDS_POS_LENGTH; i++) 1250 for (i=0; i<VDS_POS_LENGTH; i++)
1251 { 1251 {
@@ -1267,10 +1267,10 @@ udf_process_sequence(struct super_block *sb, long block, long lastblock, kernel_
1267 gd = (struct generic_desc *)bh2->b_data; 1267 gd = (struct generic_desc *)bh2->b_data;
1268 if (ident == TAG_IDENT_PD) 1268 if (ident == TAG_IDENT_PD)
1269 udf_load_partdesc(sb, bh2); 1269 udf_load_partdesc(sb, bh2);
1270 udf_release_data(bh2); 1270 brelse(bh2);
1271 } 1271 }
1272 } 1272 }
1273 udf_release_data(bh); 1273 brelse(bh);
1274 } 1274 }
1275 } 1275 }
1276 1276
@@ -1333,7 +1333,7 @@ udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset)
1333 reserve_e = reserve_e >> sb->s_blocksize_bits; 1333 reserve_e = reserve_e >> sb->s_blocksize_bits;
1334 reserve_e += reserve_s; 1334 reserve_e += reserve_s;
1335 1335
1336 udf_release_data(bh); 1336 brelse(bh);
1337 1337
1338 /* Process the main & reserve sequences */ 1338 /* Process the main & reserve sequences */
1339 /* responsible for finding the PartitionDesc(s) */ 1339 /* responsible for finding the PartitionDesc(s) */
@@ -1408,7 +1408,7 @@ udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset)
1408 udf_ext0_offset(UDF_SB_VAT(sb)); 1408 udf_ext0_offset(UDF_SB_VAT(sb));
1409 UDF_SB_TYPEVIRT(sb,i).s_num_entries = (UDF_SB_VAT(sb)->i_size - 1409 UDF_SB_TYPEVIRT(sb,i).s_num_entries = (UDF_SB_VAT(sb)->i_size -
1410 UDF_SB_TYPEVIRT(sb,i).s_start_offset) >> 2; 1410 UDF_SB_TYPEVIRT(sb,i).s_start_offset) >> 2;
1411 udf_release_data(bh); 1411 brelse(bh);
1412 } 1412 }
1413 UDF_SB_PARTROOT(sb,i) = udf_get_pblock(sb, 0, i, 0); 1413 UDF_SB_PARTROOT(sb,i) = udf_get_pblock(sb, 0, i, 0);
1414 UDF_SB_PARTLEN(sb,i) = UDF_SB_PARTLEN(sb,ino.partitionReferenceNum); 1414 UDF_SB_PARTLEN(sb,i) = UDF_SB_PARTLEN(sb,ino.partitionReferenceNum);
@@ -1680,7 +1680,7 @@ error_out:
1680 if (UDF_SB_PARTTYPE(sb, UDF_SB_PARTITION(sb)) == UDF_SPARABLE_MAP15) 1680 if (UDF_SB_PARTTYPE(sb, UDF_SB_PARTITION(sb)) == UDF_SPARABLE_MAP15)
1681 { 1681 {
1682 for (i=0; i<4; i++) 1682 for (i=0; i<4; i++)
1683 udf_release_data(UDF_SB_TYPESPAR(sb, UDF_SB_PARTITION(sb)).s_spar_map[i]); 1683 brelse(UDF_SB_TYPESPAR(sb, UDF_SB_PARTITION(sb)).s_spar_map[i]);
1684 } 1684 }
1685 } 1685 }
1686#ifdef CONFIG_UDF_NLS 1686#ifdef CONFIG_UDF_NLS
@@ -1689,7 +1689,7 @@ error_out:
1689#endif 1689#endif
1690 if (!(sb->s_flags & MS_RDONLY)) 1690 if (!(sb->s_flags & MS_RDONLY))
1691 udf_close_lvid(sb); 1691 udf_close_lvid(sb);
1692 udf_release_data(UDF_SB_LVIDBH(sb)); 1692 brelse(UDF_SB_LVIDBH(sb));
1693 UDF_SB_FREE(sb); 1693 UDF_SB_FREE(sb);
1694 kfree(sbi); 1694 kfree(sbi);
1695 sb->s_fs_info = NULL; 1695 sb->s_fs_info = NULL;
@@ -1758,7 +1758,7 @@ udf_put_super(struct super_block *sb)
1758 if (UDF_SB_PARTTYPE(sb, UDF_SB_PARTITION(sb)) == UDF_SPARABLE_MAP15) 1758 if (UDF_SB_PARTTYPE(sb, UDF_SB_PARTITION(sb)) == UDF_SPARABLE_MAP15)
1759 { 1759 {
1760 for (i=0; i<4; i++) 1760 for (i=0; i<4; i++)
1761 udf_release_data(UDF_SB_TYPESPAR(sb, UDF_SB_PARTITION(sb)).s_spar_map[i]); 1761 brelse(UDF_SB_TYPESPAR(sb, UDF_SB_PARTITION(sb)).s_spar_map[i]);
1762 } 1762 }
1763 } 1763 }
1764#ifdef CONFIG_UDF_NLS 1764#ifdef CONFIG_UDF_NLS
@@ -1767,7 +1767,7 @@ udf_put_super(struct super_block *sb)
1767#endif 1767#endif
1768 if (!(sb->s_flags & MS_RDONLY)) 1768 if (!(sb->s_flags & MS_RDONLY))
1769 udf_close_lvid(sb); 1769 udf_close_lvid(sb);
1770 udf_release_data(UDF_SB_LVIDBH(sb)); 1770 brelse(UDF_SB_LVIDBH(sb));
1771 UDF_SB_FREE(sb); 1771 UDF_SB_FREE(sb);
1772 kfree(sb->s_fs_info); 1772 kfree(sb->s_fs_info);
1773 sb->s_fs_info = NULL; 1773 sb->s_fs_info = NULL;
@@ -1837,7 +1837,7 @@ udf_count_free_bitmap(struct super_block *sb, struct udf_bitmap *bitmap)
1837 } 1837 }
1838 else if (ident != TAG_IDENT_SBD) 1838 else if (ident != TAG_IDENT_SBD)
1839 { 1839 {
1840 udf_release_data(bh); 1840 brelse(bh);
1841 printk(KERN_ERR "udf: udf_count_free failed\n"); 1841 printk(KERN_ERR "udf: udf_count_free failed\n");
1842 goto out; 1842 goto out;
1843 } 1843 }
@@ -1859,7 +1859,7 @@ udf_count_free_bitmap(struct super_block *sb, struct udf_bitmap *bitmap)
1859 } 1859 }
1860 if ( bytes ) 1860 if ( bytes )
1861 { 1861 {
1862 udf_release_data(bh); 1862 brelse(bh);
1863 newblock = udf_get_lb_pblock(sb, loc, ++block); 1863 newblock = udf_get_lb_pblock(sb, loc, ++block);
1864 bh = udf_tread(sb, newblock); 1864 bh = udf_tread(sb, newblock);
1865 if (!bh) 1865 if (!bh)
@@ -1871,7 +1871,7 @@ udf_count_free_bitmap(struct super_block *sb, struct udf_bitmap *bitmap)
1871 ptr = (uint8_t *)bh->b_data; 1871 ptr = (uint8_t *)bh->b_data;
1872 } 1872 }
1873 } 1873 }
1874 udf_release_data(bh); 1874 brelse(bh);
1875 1875
1876out: 1876out:
1877 unlock_kernel(); 1877 unlock_kernel();
@@ -1896,7 +1896,7 @@ udf_count_free_table(struct super_block *sb, struct inode * table)
1896 1896
1897 while ((etype = udf_next_aext(table, &epos, &eloc, &elen, 1)) != -1) 1897 while ((etype = udf_next_aext(table, &epos, &eloc, &elen, 1)) != -1)
1898 accum += (elen >> table->i_sb->s_blocksize_bits); 1898 accum += (elen >> table->i_sb->s_blocksize_bits);
1899 udf_release_data(epos.bh); 1899 brelse(epos.bh);
1900 1900
1901 unlock_kernel(); 1901 unlock_kernel();
1902 1902
diff --git a/fs/udf/symlink.c b/fs/udf/symlink.c
index ba068a786563..12613b680cc4 100644
--- a/fs/udf/symlink.c
+++ b/fs/udf/symlink.c
@@ -95,7 +95,7 @@ static int udf_symlink_filler(struct file *file, struct page *page)
95 } 95 }
96 96
97 udf_pc_to_char(inode->i_sb, symlink, inode->i_size, p); 97 udf_pc_to_char(inode->i_sb, symlink, inode->i_size, p);
98 udf_release_data(bh); 98 brelse(bh);
99 99
100 unlock_kernel(); 100 unlock_kernel();
101 SetPageUptodate(page); 101 SetPageUptodate(page);
diff --git a/fs/udf/truncate.c b/fs/udf/truncate.c
index 84191801f4c9..0449b2216e71 100644
--- a/fs/udf/truncate.c
+++ b/fs/udf/truncate.c
@@ -119,7 +119,7 @@ void udf_discard_prealloc(struct inode * inode)
119 } 119 }
120 UDF_I_LENEXTENTS(inode) = lbcount; 120 UDF_I_LENEXTENTS(inode) = lbcount;
121 121
122 udf_release_data(epos.bh); 122 brelse(epos.bh);
123} 123}
124 124
125void udf_truncate_extents(struct inode * inode) 125void udf_truncate_extents(struct inode * inode)
@@ -287,5 +287,5 @@ void udf_truncate_extents(struct inode * inode)
287 } 287 }
288 UDF_I_LENEXTENTS(inode) = inode->i_size; 288 UDF_I_LENEXTENTS(inode) = inode->i_size;
289 289
290 udf_release_data(epos.bh); 290 brelse(epos.bh);
291} 291}
diff --git a/fs/udf/udf_sb.h b/fs/udf/udf_sb.h
index 110f8d62616f..3b2e6c8cb151 100644
--- a/fs/udf/udf_sb.h
+++ b/fs/udf/udf_sb.h
@@ -93,7 +93,7 @@ static inline struct udf_sb_info *UDF_SB(struct super_block *sb)
93 for (i=0; i<nr_groups; i++)\ 93 for (i=0; i<nr_groups; i++)\
94 {\ 94 {\
95 if (UDF_SB_BITMAP(X,Y,Z,i))\ 95 if (UDF_SB_BITMAP(X,Y,Z,i))\
96 udf_release_data(UDF_SB_BITMAP(X,Y,Z,i));\ 96 brelse(UDF_SB_BITMAP(X,Y,Z,i));\
97 }\ 97 }\
98 if (size <= PAGE_SIZE)\ 98 if (size <= PAGE_SIZE)\
99 kfree(UDF_SB_PARTMAPS(X)[Y].Z.s_bitmap);\ 99 kfree(UDF_SB_PARTMAPS(X)[Y].Z.s_bitmap);\
diff --git a/fs/udf/udfdecl.h b/fs/udf/udfdecl.h
index a89f454de1c2..67ded289497c 100644
--- a/fs/udf/udfdecl.h
+++ b/fs/udf/udfdecl.h
@@ -106,6 +106,7 @@ extern void udf_delete_inode(struct inode *);
106extern void udf_clear_inode(struct inode *); 106extern void udf_clear_inode(struct inode *);
107extern int udf_write_inode(struct inode *, int); 107extern int udf_write_inode(struct inode *, int);
108extern long udf_block_map(struct inode *, sector_t); 108extern long udf_block_map(struct inode *, sector_t);
109extern int udf_extend_file(struct inode *, struct extent_position *, kernel_long_ad *, sector_t);
109extern int8_t inode_bmap(struct inode *, sector_t, struct extent_position *, kernel_lb_addr *, uint32_t *, sector_t *); 110extern int8_t inode_bmap(struct inode *, sector_t, struct extent_position *, kernel_lb_addr *, uint32_t *, sector_t *);
110extern int8_t udf_add_aext(struct inode *, struct extent_position *, kernel_lb_addr, uint32_t, int); 111extern int8_t udf_add_aext(struct inode *, struct extent_position *, kernel_lb_addr, uint32_t, int);
111extern int8_t udf_write_aext(struct inode *, struct extent_position *, kernel_lb_addr, uint32_t, int); 112extern int8_t udf_write_aext(struct inode *, struct extent_position *, kernel_lb_addr, uint32_t, int);
@@ -120,7 +121,6 @@ extern struct genericFormat *udf_add_extendedattr(struct inode *, uint32_t, uint
120extern struct genericFormat *udf_get_extendedattr(struct inode *, uint32_t, uint8_t); 121extern struct genericFormat *udf_get_extendedattr(struct inode *, uint32_t, uint8_t);
121extern struct buffer_head *udf_read_tagged(struct super_block *, uint32_t, uint32_t, uint16_t *); 122extern struct buffer_head *udf_read_tagged(struct super_block *, uint32_t, uint32_t, uint16_t *);
122extern struct buffer_head *udf_read_ptagged(struct super_block *, kernel_lb_addr, uint32_t, uint16_t *); 123extern struct buffer_head *udf_read_ptagged(struct super_block *, kernel_lb_addr, uint32_t, uint16_t *);
123extern void udf_release_data(struct buffer_head *);
124extern void udf_update_tag(char *, int); 124extern void udf_update_tag(char *, int);
125extern void udf_new_tag(char *, uint16_t, uint16_t, uint16_t, uint32_t, int); 125extern void udf_new_tag(char *, uint16_t, uint16_t, uint16_t, uint32_t, int);
126 126