Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[firefly-linux-kernel-4.4.55.git] / fs / f2fs / recovery.c
index 72adbbfdb3e59a005f5fc56d1fc8fbec5b33a529..b1ae89f0f44e53878a7e37aea926c4e3a201c2a3 100644 (file)
@@ -27,14 +27,12 @@ bool space_for_roll_forward(struct f2fs_sb_info *sbi)
 static struct fsync_inode_entry *get_fsync_inode(struct list_head *head,
                                                                nid_t ino)
 {
-       struct list_head *this;
        struct fsync_inode_entry *entry;
 
-       list_for_each(this, head) {
-               entry = list_entry(this, struct fsync_inode_entry, list);
+       list_for_each_entry(entry, head, list)
                if (entry->inode->i_ino == ino)
                        return entry;
-       }
+
        return NULL;
 }
 
@@ -136,7 +134,7 @@ static int find_fsync_dnodes(struct f2fs_sb_info *sbi, struct list_head *head)
 
        /* get node pages in the current segment */
        curseg = CURSEG_I(sbi, CURSEG_WARM_NODE);
-       blkaddr = START_BLOCK(sbi, curseg->segno) + curseg->next_blkoff;
+       blkaddr = NEXT_FREE_BLKADDR(sbi, curseg);
 
        /* read node page */
        page = alloc_page(GFP_F2FS_ZERO);
@@ -316,7 +314,7 @@ static int do_recover_data(struct f2fs_sb_info *sbi, struct inode *inode,
                goto out;
        }
 
-       wait_on_page_writeback(dn.node_page);
+       f2fs_wait_on_page_writeback(dn.node_page, NODE);
 
        get_node_info(sbi, dn.nid, &ni);
        f2fs_bug_on(ni.ino != ino_of_node(page));
@@ -436,7 +434,7 @@ int recover_fsync_data(struct f2fs_sb_info *sbi)
        bool need_writecp = false;
 
        fsync_entry_slab = f2fs_kmem_cache_create("f2fs_fsync_inode_entry",
-                       sizeof(struct fsync_inode_entry), NULL);
+                       sizeof(struct fsync_inode_entry));
        if (!fsync_entry_slab)
                return -ENOMEM;