Btrfs: free sys_array eb as soon as possible
authorLiu Bo <bo.li.liu@oracle.com>
Sat, 14 May 2016 00:06:59 +0000 (17:06 -0700)
committerDavid Sterba <dsterba@suse.com>
Wed, 25 May 2016 17:53:51 +0000 (19:53 +0200)
While reading sys_chunk_array in superblock, btrfs creates a temporary
extent buffer.  Since we don't use it after finishing reading
 sys_chunk_array, we don't need to keep it in memory.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c

index e0290303bb35aef956a90edd7144c0d8343aed0f..fd3e8280b549ea3b4f3602fd2494ba445fd5856e 100644 (file)
@@ -6630,13 +6630,13 @@ int btrfs_read_sys_array(struct btrfs_root *root)
                sb_array_offset += len;
                cur_offset += len;
        }
-       free_extent_buffer(sb);
+       free_extent_buffer_stale(sb);
        return ret;
 
 out_short_read:
        printk(KERN_ERR "BTRFS: sys_array too short to read %u bytes at offset %u\n",
                        len, cur_offset);
-       free_extent_buffer(sb);
+       free_extent_buffer_stale(sb);
        return -EIO;
 }