diff options
-rw-r--r-- | fs/btrfs/extent_io.c | 9 | ||||
-rw-r--r-- | fs/btrfs/super.c | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index ba41da59e31b..0cee46e01081 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/swap.h> | 10 | #include <linux/swap.h> |
11 | #include <linux/writeback.h> | 11 | #include <linux/writeback.h> |
12 | #include <linux/pagevec.h> | 12 | #include <linux/pagevec.h> |
13 | #include <linux/cleancache.h> | ||
13 | #include "extent_io.h" | 14 | #include "extent_io.h" |
14 | #include "extent_map.h" | 15 | #include "extent_map.h" |
15 | #include "compat.h" | 16 | #include "compat.h" |
@@ -2015,6 +2016,13 @@ static int __extent_read_full_page(struct extent_io_tree *tree, | |||
2015 | 2016 | ||
2016 | set_page_extent_mapped(page); | 2017 | set_page_extent_mapped(page); |
2017 | 2018 | ||
2019 | if (!PageUptodate(page)) { | ||
2020 | if (cleancache_get_page(page) == 0) { | ||
2021 | BUG_ON(blocksize != PAGE_SIZE); | ||
2022 | goto out; | ||
2023 | } | ||
2024 | } | ||
2025 | |||
2018 | end = page_end; | 2026 | end = page_end; |
2019 | while (1) { | 2027 | while (1) { |
2020 | lock_extent(tree, start, end, GFP_NOFS); | 2028 | lock_extent(tree, start, end, GFP_NOFS); |
@@ -2148,6 +2156,7 @@ static int __extent_read_full_page(struct extent_io_tree *tree, | |||
2148 | cur = cur + iosize; | 2156 | cur = cur + iosize; |
2149 | page_offset += iosize; | 2157 | page_offset += iosize; |
2150 | } | 2158 | } |
2159 | out: | ||
2151 | if (!nr) { | 2160 | if (!nr) { |
2152 | if (!PageError(page)) | 2161 | if (!PageError(page)) |
2153 | SetPageUptodate(page); | 2162 | SetPageUptodate(page); |
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 0ac712efcdf2..be4ffa12f3ef 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/miscdevice.h> | 39 | #include <linux/miscdevice.h> |
40 | #include <linux/magic.h> | 40 | #include <linux/magic.h> |
41 | #include <linux/slab.h> | 41 | #include <linux/slab.h> |
42 | #include <linux/cleancache.h> | ||
42 | #include "compat.h" | 43 | #include "compat.h" |
43 | #include "ctree.h" | 44 | #include "ctree.h" |
44 | #include "disk-io.h" | 45 | #include "disk-io.h" |
@@ -624,6 +625,7 @@ static int btrfs_fill_super(struct super_block *sb, | |||
624 | sb->s_root = root_dentry; | 625 | sb->s_root = root_dentry; |
625 | 626 | ||
626 | save_mount_options(sb, data); | 627 | save_mount_options(sb, data); |
628 | cleancache_init_fs(sb); | ||
627 | return 0; | 629 | return 0; |
628 | 630 | ||
629 | fail_close: | 631 | fail_close: |