]> git.karo-electronics.de Git - linux-beck.git/commitdiff
f2fs: set buffer_new when new blocks are allocated
authorJaegeuk Kim <jaegeuk@kernel.org>
Thu, 12 Mar 2015 03:27:25 +0000 (23:27 -0400)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 10 Apr 2015 22:08:44 +0000 (15:08 -0700)
This patch modifies to call set_buffer_new, if new blocks are allocated.

Reviewed-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c

index ba70a78a396f8f48c693cc54cf08919696cf8c58..4a416e74bb2a151e0e7d2ccca4380e96a4af106e 100644 (file)
@@ -257,7 +257,7 @@ static void f2fs_map_bh(struct super_block *sb, pgoff_t pgofs,
        unsigned int blkbits = sb->s_blocksize_bits;
        size_t count;
 
-       set_buffer_new(bh_result);
+       clear_buffer_new(bh_result);
        map_bh(bh_result, sb, ei->blk + pgofs - ei->fofs);
        count = ei->fofs + ei->len - pgofs;
        if (count < (UINT_MAX >> blkbits))
@@ -1139,7 +1139,7 @@ static int __get_data_block(struct inode *inode, sector_t iblock,
                goto put_out;
 
        if (dn.data_blkaddr != NULL_ADDR) {
-               set_buffer_new(bh_result);
+               clear_buffer_new(bh_result);
                map_bh(bh_result, inode->i_sb, dn.data_blkaddr);
        } else if (create) {
                err = __allocate_data_block(&dn);
@@ -1184,6 +1184,7 @@ get_next:
                        if (err)
                                goto sync_out;
                        allocated = true;
+                       set_buffer_new(bh_result);
                        blkaddr = dn.data_blkaddr;
                }
                /* Give more consecutive addresses for the readahead */