aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/extents.c49
1 files changed, 22 insertions, 27 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 19d8059b58aa..68537229ee1c 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -374,7 +374,7 @@ ext4_ext_binsearch_idx(struct inode *inode,
374 struct ext4_extent_idx *r, *l, *m; 374 struct ext4_extent_idx *r, *l, *m;
375 375
376 376
377 ext_debug("binsearch for %lu(idx): ", (unsigned long)block); 377 ext_debug("binsearch for %u(idx): ", block);
378 378
379 l = EXT_FIRST_INDEX(eh) + 1; 379 l = EXT_FIRST_INDEX(eh) + 1;
380 r = EXT_LAST_INDEX(eh); 380 r = EXT_LAST_INDEX(eh);
@@ -440,7 +440,7 @@ ext4_ext_binsearch(struct inode *inode,
440 return; 440 return;
441 } 441 }
442 442
443 ext_debug("binsearch for %lu: ", (unsigned long)block); 443 ext_debug("binsearch for %u: ", block);
444 444
445 l = EXT_FIRST_EXTENT(eh) + 1; 445 l = EXT_FIRST_EXTENT(eh) + 1;
446 r = EXT_LAST_EXTENT(eh); 446 r = EXT_LAST_EXTENT(eh);
@@ -766,7 +766,7 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode,
766 while (k--) { 766 while (k--) {
767 oldblock = newblock; 767 oldblock = newblock;
768 newblock = ablocks[--a]; 768 newblock = ablocks[--a];
769 bh = sb_getblk(inode->i_sb, (ext4_fsblk_t)newblock); 769 bh = sb_getblk(inode->i_sb, newblock);
770 if (!bh) { 770 if (!bh) {
771 err = -EIO; 771 err = -EIO;
772 goto cleanup; 772 goto cleanup;
@@ -786,9 +786,8 @@ static int ext4_ext_split(handle_t *handle, struct inode *inode,
786 fidx->ei_block = border; 786 fidx->ei_block = border;
787 ext4_idx_store_pblock(fidx, oldblock); 787 ext4_idx_store_pblock(fidx, oldblock);
788 788
789 ext_debug("int.index at %d (block %llu): %lu -> %llu\n", i, 789 ext_debug("int.index at %d (block %llu): %u -> %llu\n",
790 newblock, (unsigned long) le32_to_cpu(border), 790 i, newblock, le32_to_cpu(border), oldblock);
791 oldblock);
792 /* copy indexes */ 791 /* copy indexes */
793 m = 0; 792 m = 0;
794 path[i].p_idx++; 793 path[i].p_idx++;
@@ -1476,10 +1475,10 @@ ext4_ext_put_gap_in_cache(struct inode *inode, struct ext4_ext_path *path,
1476 } else if (block < le32_to_cpu(ex->ee_block)) { 1475 } else if (block < le32_to_cpu(ex->ee_block)) {
1477 lblock = block; 1476 lblock = block;
1478 len = le32_to_cpu(ex->ee_block) - block; 1477 len = le32_to_cpu(ex->ee_block) - block;
1479 ext_debug("cache gap(before): %lu [%lu:%lu]", 1478 ext_debug("cache gap(before): %u [%u:%u]",
1480 (unsigned long) block, 1479 block,
1481 (unsigned long) le32_to_cpu(ex->ee_block), 1480 le32_to_cpu(ex->ee_block),
1482 (unsigned long) ext4_ext_get_actual_len(ex)); 1481 ext4_ext_get_actual_len(ex));
1483 } else if (block >= le32_to_cpu(ex->ee_block) 1482 } else if (block >= le32_to_cpu(ex->ee_block)
1484 + ext4_ext_get_actual_len(ex)) { 1483 + ext4_ext_get_actual_len(ex)) {
1485 ext4_lblk_t next; 1484 ext4_lblk_t next;
@@ -1487,10 +1486,10 @@ ext4_ext_put_gap_in_cache(struct inode *inode, struct ext4_ext_path *path,
1487 + ext4_ext_get_actual_len(ex); 1486 + ext4_ext_get_actual_len(ex);
1488 1487
1489 next = ext4_ext_next_allocated_block(path); 1488 next = ext4_ext_next_allocated_block(path);
1490 ext_debug("cache gap(after): [%lu:%lu] %lu", 1489 ext_debug("cache gap(after): [%u:%u] %u",
1491 (unsigned long) le32_to_cpu(ex->ee_block), 1490 le32_to_cpu(ex->ee_block),
1492 (unsigned long) ext4_ext_get_actual_len(ex), 1491 ext4_ext_get_actual_len(ex),
1493 (unsigned long) block); 1492 block);
1494 BUG_ON(next == lblock); 1493 BUG_ON(next == lblock);
1495 len = next - lblock; 1494 len = next - lblock;
1496 } else { 1495 } else {
@@ -1498,7 +1497,7 @@ ext4_ext_put_gap_in_cache(struct inode *inode, struct ext4_ext_path *path,
1498 BUG(); 1497 BUG();
1499 } 1498 }
1500 1499
1501 ext_debug(" -> %lu:%lu\n", (unsigned long) lblock, len); 1500 ext_debug(" -> %u:%lu\n", lblock, len);
1502 ext4_ext_put_in_cache(inode, lblock, len, 0, EXT4_EXT_CACHE_GAP); 1501 ext4_ext_put_in_cache(inode, lblock, len, 0, EXT4_EXT_CACHE_GAP);
1503} 1502}
1504 1503
@@ -1520,11 +1519,9 @@ ext4_ext_in_cache(struct inode *inode, ext4_lblk_t block,
1520 ex->ee_block = cpu_to_le32(cex->ec_block); 1519 ex->ee_block = cpu_to_le32(cex->ec_block);
1521 ext4_ext_store_pblock(ex, cex->ec_start); 1520 ext4_ext_store_pblock(ex, cex->ec_start);
1522 ex->ee_len = cpu_to_le16(cex->ec_len); 1521 ex->ee_len = cpu_to_le16(cex->ec_len);
1523 ext_debug("%lu cached by %lu:%lu:%llu\n", 1522 ext_debug("%u cached by %u:%u:%llu\n",
1524 (unsigned long) block, 1523 block,
1525 (unsigned long) cex->ec_block, 1524 cex->ec_block, cex->ec_len, cex->ec_start);
1526 (unsigned long) cex->ec_len,
1527 cex->ec_start);
1528 return cex->ec_type; 1525 return cex->ec_type;
1529 } 1526 }
1530 1527
@@ -2145,9 +2142,8 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
2145 unsigned long allocated = 0; 2142 unsigned long allocated = 0;
2146 2143
2147 __clear_bit(BH_New, &bh_result->b_state); 2144 __clear_bit(BH_New, &bh_result->b_state);
2148 ext_debug("blocks %lu/%lu requested for inode %u\n", 2145 ext_debug("blocks %u/%lu requested for inode %u\n",
2149 (unsigned long) iblock, max_blocks, 2146 iblock, max_blocks, inode->i_ino);
2150 (unsigned) inode->i_ino);
2151 mutex_lock(&EXT4_I(inode)->truncate_mutex); 2147 mutex_lock(&EXT4_I(inode)->truncate_mutex);
2152 2148
2153 /* check in cache */ 2149 /* check in cache */
@@ -2210,7 +2206,7 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
2210 newblock = iblock - ee_block + ee_start; 2206 newblock = iblock - ee_block + ee_start;
2211 /* number of remaining blocks in the extent */ 2207 /* number of remaining blocks in the extent */
2212 allocated = ee_len - (iblock - ee_block); 2208 allocated = ee_len - (iblock - ee_block);
2213 ext_debug("%d fit into %lu:%d -> %llu\n", (int) iblock, 2209 ext_debug("%u fit into %lu:%d -> %llu\n", iblock,
2214 ee_block, ee_len, newblock); 2210 ee_block, ee_len, newblock);
2215 2211
2216 /* Do not put uninitialized extent in the cache */ 2212 /* Do not put uninitialized extent in the cache */
@@ -2470,9 +2466,8 @@ retry:
2470 if (!ret) { 2466 if (!ret) {
2471 ext4_error(inode->i_sb, "ext4_fallocate", 2467 ext4_error(inode->i_sb, "ext4_fallocate",
2472 "ext4_ext_get_blocks returned 0! inode#%lu" 2468 "ext4_ext_get_blocks returned 0! inode#%lu"
2473 ", block=%lu, max_blocks=%lu", 2469 ", block=%u, max_blocks=%lu",
2474 inode->i_ino, (unsigned long)block, 2470 inode->i_ino, block, max_blocks);
2475 (unsigned long)max_blocks);
2476 ret = -EIO; 2471 ret = -EIO;
2477 ext4_mark_inode_dirty(handle, inode); 2472 ext4_mark_inode_dirty(handle, inode);
2478 ret2 = ext4_journal_stop(handle); 2473 ret2 = ext4_journal_stop(handle);