aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/udf/super.c')
-rw-r--r--fs/udf/super.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c
index 368d8f81fe54..e45789fe38e8 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -140,7 +140,8 @@ static int init_inodecache(void)
140{ 140{
141 udf_inode_cachep = kmem_cache_create("udf_inode_cache", 141 udf_inode_cachep = kmem_cache_create("udf_inode_cache",
142 sizeof(struct udf_inode_info), 142 sizeof(struct udf_inode_info),
143 0, SLAB_RECLAIM_ACCOUNT, 143 0, (SLAB_RECLAIM_ACCOUNT|
144 SLAB_MEM_SPREAD),
144 init_once, NULL); 145 init_once, NULL);
145 if (udf_inode_cachep == NULL) 146 if (udf_inode_cachep == NULL)
146 return -ENOMEM; 147 return -ENOMEM;
@@ -660,8 +661,7 @@ udf_find_anchor(struct super_block *sb)
660 * lastblock 661 * lastblock
661 * however, if the disc isn't closed, it could be 512 */ 662 * however, if the disc isn't closed, it could be 512 */
662 663
663 for (i=0; (!lastblock && i<sizeof(last)/sizeof(int)); i++) 664 for (i = 0; !lastblock && i < ARRAY_SIZE(last); i++) {
664 {
665 if (last[i] < 0 || !(bh = sb_bread(sb, last[i]))) 665 if (last[i] < 0 || !(bh = sb_bread(sb, last[i])))
666 { 666 {
667 ident = location = 0; 667 ident = location = 0;
@@ -672,7 +672,7 @@ udf_find_anchor(struct super_block *sb)
672 location = le32_to_cpu(((tag *)bh->b_data)->tagLocation); 672 location = le32_to_cpu(((tag *)bh->b_data)->tagLocation);
673 udf_release_data(bh); 673 udf_release_data(bh);
674 } 674 }
675 675
676 if (ident == TAG_IDENT_AVDP) 676 if (ident == TAG_IDENT_AVDP)
677 { 677 {
678 if (location == last[i] - UDF_SB_SESSION(sb)) 678 if (location == last[i] - UDF_SB_SESSION(sb))
@@ -753,8 +753,7 @@ udf_find_anchor(struct super_block *sb)
753 } 753 }
754 } 754 }
755 755
756 for (i=0; i<sizeof(UDF_SB_ANCHOR(sb))/sizeof(int); i++) 756 for (i = 0; i < ARRAY_SIZE(UDF_SB_ANCHOR(sb)); i++) {
757 {
758 if (UDF_SB_ANCHOR(sb)[i]) 757 if (UDF_SB_ANCHOR(sb)[i])
759 { 758 {
760 if (!(bh = udf_read_tagged(sb, 759 if (!(bh = udf_read_tagged(sb,
@@ -1313,8 +1312,7 @@ udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset)
1313 if (!sb) 1312 if (!sb)
1314 return 1; 1313 return 1;
1315 1314
1316 for (i=0; i<sizeof(UDF_SB_ANCHOR(sb))/sizeof(int); i++) 1315 for (i = 0; i < ARRAY_SIZE(UDF_SB_ANCHOR(sb)); i++) {
1317 {
1318 if (UDF_SB_ANCHOR(sb)[i] && (bh = udf_read_tagged(sb, 1316 if (UDF_SB_ANCHOR(sb)[i] && (bh = udf_read_tagged(sb,
1319 UDF_SB_ANCHOR(sb)[i], UDF_SB_ANCHOR(sb)[i], &ident))) 1317 UDF_SB_ANCHOR(sb)[i], UDF_SB_ANCHOR(sb)[i], &ident)))
1320 { 1318 {
@@ -1325,7 +1323,7 @@ udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset)
1325 main_e = le32_to_cpu( anchor->mainVolDescSeqExt.extLength ); 1323 main_e = le32_to_cpu( anchor->mainVolDescSeqExt.extLength );
1326 main_e = main_e >> sb->s_blocksize_bits; 1324 main_e = main_e >> sb->s_blocksize_bits;
1327 main_e += main_s; 1325 main_e += main_s;
1328 1326
1329 /* Locate the reserve sequence */ 1327 /* Locate the reserve sequence */
1330 reserve_s = le32_to_cpu(anchor->reserveVolDescSeqExt.extLocation); 1328 reserve_s = le32_to_cpu(anchor->reserveVolDescSeqExt.extLocation);
1331 reserve_e = le32_to_cpu(anchor->reserveVolDescSeqExt.extLength); 1329 reserve_e = le32_to_cpu(anchor->reserveVolDescSeqExt.extLength);
@@ -1344,12 +1342,10 @@ udf_load_partition(struct super_block *sb, kernel_lb_addr *fileset)
1344 } 1342 }
1345 } 1343 }
1346 1344
1347 if (i == sizeof(UDF_SB_ANCHOR(sb))/sizeof(int)) 1345 if (i == ARRAY_SIZE(UDF_SB_ANCHOR(sb))) {
1348 {
1349 udf_debug("No Anchor block found\n"); 1346 udf_debug("No Anchor block found\n");
1350 return 1; 1347 return 1;
1351 } 1348 } else
1352 else
1353 udf_debug("Using anchor in block %d\n", UDF_SB_ANCHOR(sb)[i]); 1349 udf_debug("Using anchor in block %d\n", UDF_SB_ANCHOR(sb)[i]);
1354 1350
1355 for (i=0; i<UDF_SB_NUMPARTS(sb); i++) 1351 for (i=0; i<UDF_SB_NUMPARTS(sb); i++)
@@ -1515,7 +1511,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
1515 sb->s_fs_info = sbi; 1511 sb->s_fs_info = sbi;
1516 memset(UDF_SB(sb), 0x00, sizeof(struct udf_sb_info)); 1512 memset(UDF_SB(sb), 0x00, sizeof(struct udf_sb_info));
1517 1513
1518 init_MUTEX(&sbi->s_alloc_sem); 1514 mutex_init(&sbi->s_alloc_mutex);
1519 1515
1520 if (!udf_parse_options((char *)options, &uopt)) 1516 if (!udf_parse_options((char *)options, &uopt))
1521 goto error_out; 1517 goto error_out;