aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r--fs/ext4/inode.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 0188e65e1f58..ba33c67d6e48 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -465,7 +465,7 @@ static void ext4_map_blocks_es_recheck(handle_t *handle,
465 if (es_map->m_lblk != map->m_lblk || 465 if (es_map->m_lblk != map->m_lblk ||
466 es_map->m_flags != map->m_flags || 466 es_map->m_flags != map->m_flags ||
467 es_map->m_pblk != map->m_pblk) { 467 es_map->m_pblk != map->m_pblk) {
468 printk("ES cache assertation failed for inode: %lu " 468 printk("ES cache assertion failed for inode: %lu "
469 "es_cached ex [%d/%d/%llu/%x] != " 469 "es_cached ex [%d/%d/%llu/%x] != "
470 "found ex [%d/%d/%llu/%x] retval %d flags %x\n", 470 "found ex [%d/%d/%llu/%x] retval %d flags %x\n",
471 inode->i_ino, es_map->m_lblk, es_map->m_len, 471 inode->i_ino, es_map->m_lblk, es_map->m_len,
@@ -514,10 +514,9 @@ int ext4_map_blocks(handle_t *handle, struct inode *inode,
514 "logical block %lu\n", inode->i_ino, flags, map->m_len, 514 "logical block %lu\n", inode->i_ino, flags, map->m_len,
515 (unsigned long) map->m_lblk); 515 (unsigned long) map->m_lblk);
516 516
517 ext4_es_lru_add(inode);
518
519 /* Lookup extent status tree firstly */ 517 /* Lookup extent status tree firstly */
520 if (ext4_es_lookup_extent(inode, map->m_lblk, &es)) { 518 if (ext4_es_lookup_extent(inode, map->m_lblk, &es)) {
519 ext4_es_lru_add(inode);
521 if (ext4_es_is_written(&es) || ext4_es_is_unwritten(&es)) { 520 if (ext4_es_is_written(&es) || ext4_es_is_unwritten(&es)) {
522 map->m_pblk = ext4_es_pblock(&es) + 521 map->m_pblk = ext4_es_pblock(&es) +
523 map->m_lblk - es.es_lblk; 522 map->m_lblk - es.es_lblk;
@@ -558,7 +557,7 @@ int ext4_map_blocks(handle_t *handle, struct inode *inode,
558 557
559#ifdef ES_AGGRESSIVE_TEST 558#ifdef ES_AGGRESSIVE_TEST
560 if (retval != map->m_len) { 559 if (retval != map->m_len) {
561 printk("ES len assertation failed for inode: %lu " 560 printk("ES len assertion failed for inode: %lu "
562 "retval %d != map->m_len %d " 561 "retval %d != map->m_len %d "
563 "in %s (lookup)\n", inode->i_ino, retval, 562 "in %s (lookup)\n", inode->i_ino, retval,
564 map->m_len, __func__); 563 map->m_len, __func__);
@@ -659,7 +658,7 @@ found:
659 658
660#ifdef ES_AGGRESSIVE_TEST 659#ifdef ES_AGGRESSIVE_TEST
661 if (retval != map->m_len) { 660 if (retval != map->m_len) {
662 printk("ES len assertation failed for inode: %lu " 661 printk("ES len assertion failed for inode: %lu "
663 "retval %d != map->m_len %d " 662 "retval %d != map->m_len %d "
664 "in %s (allocation)\n", inode->i_ino, retval, 663 "in %s (allocation)\n", inode->i_ino, retval,
665 map->m_len, __func__); 664 map->m_len, __func__);
@@ -1529,11 +1528,9 @@ static int ext4_da_map_blocks(struct inode *inode, sector_t iblock,
1529 "logical block %lu\n", inode->i_ino, map->m_len, 1528 "logical block %lu\n", inode->i_ino, map->m_len,
1530 (unsigned long) map->m_lblk); 1529 (unsigned long) map->m_lblk);
1531 1530
1532 ext4_es_lru_add(inode);
1533
1534 /* Lookup extent status tree firstly */ 1531 /* Lookup extent status tree firstly */
1535 if (ext4_es_lookup_extent(inode, iblock, &es)) { 1532 if (ext4_es_lookup_extent(inode, iblock, &es)) {
1536 1533 ext4_es_lru_add(inode);
1537 if (ext4_es_is_hole(&es)) { 1534 if (ext4_es_is_hole(&es)) {
1538 retval = 0; 1535 retval = 0;
1539 down_read((&EXT4_I(inode)->i_data_sem)); 1536 down_read((&EXT4_I(inode)->i_data_sem));
@@ -1642,7 +1639,7 @@ add_delayed:
1642 1639
1643#ifdef ES_AGGRESSIVE_TEST 1640#ifdef ES_AGGRESSIVE_TEST
1644 if (retval != map->m_len) { 1641 if (retval != map->m_len) {
1645 printk("ES len assertation failed for inode: %lu " 1642 printk("ES len assertion failed for inode: %lu "
1646 "retval %d != map->m_len %d " 1643 "retval %d != map->m_len %d "
1647 "in %s (lookup)\n", inode->i_ino, retval, 1644 "in %s (lookup)\n", inode->i_ino, retval,
1648 map->m_len, __func__); 1645 map->m_len, __func__);
@@ -2163,7 +2160,7 @@ static int mpage_map_and_submit_extent(handle_t *handle,
2163 2160
2164 mpd->io_submit.io_end->offset = 2161 mpd->io_submit.io_end->offset =
2165 ((loff_t)map->m_lblk) << inode->i_blkbits; 2162 ((loff_t)map->m_lblk) << inode->i_blkbits;
2166 while (map->m_len) { 2163 do {
2167 err = mpage_map_one_extent(handle, mpd); 2164 err = mpage_map_one_extent(handle, mpd);
2168 if (err < 0) { 2165 if (err < 0) {
2169 struct super_block *sb = inode->i_sb; 2166 struct super_block *sb = inode->i_sb;
@@ -2201,7 +2198,7 @@ static int mpage_map_and_submit_extent(handle_t *handle,
2201 err = mpage_map_and_submit_buffers(mpd); 2198 err = mpage_map_and_submit_buffers(mpd);
2202 if (err < 0) 2199 if (err < 0)
2203 return err; 2200 return err;
2204 } 2201 } while (map->m_len);
2205 2202
2206 /* Update on-disk size after IO is submitted */ 2203 /* Update on-disk size after IO is submitted */
2207 disksize = ((loff_t)mpd->first_page) << PAGE_CACHE_SHIFT; 2204 disksize = ((loff_t)mpd->first_page) << PAGE_CACHE_SHIFT;