Btrfs: refactor caching_thread()

We're also going to load the free space tree from caching_thread(), so
we should refactor some of the common code.

Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
This commit is contained in:
Omar Sandoval
2015-09-29 20:50:33 -07:00
committed by Chris Mason
parent 1abfbcdf56
commit 73fa48b674
2 changed files with 36 additions and 26 deletions

View File

@@ -1262,6 +1262,9 @@ struct btrfs_caching_control {
atomic_t count;
};
/* Once caching_thread() finds this much free space, it will wake up waiters. */
#define CACHING_CTL_WAKE_UP (1024 * 1024 * 2)
struct btrfs_io_ctl {
void *cur, *orig;
struct page *page;