aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/inode.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2007-05-08 03:35:16 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 14:15:21 -0400
commit3bf25cb40d899eeb5a471f497e56ddfe2c96c019 (patch)
tree98d425edd6392d3037218851084dde6736e7ba32 /fs/udf/inode.c
parentff116fc8d1d43927c7651b91d5aec41eb30c4429 (diff)
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 <jack@suse.cz> Acked-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/udf/inode.c')
-rw-r--r--fs/udf/inode.c74
1 files changed, 37 insertions, 37 deletions
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);