diff options
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/ctree.h | 3 | ||||
-rw-r--r-- | fs/btrfs/reada.c | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index e176f8c551f7..1c665ebe47e0 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -173,6 +173,9 @@ static int btrfs_csum_sizes[] = { 4, 0 }; | |||
173 | #define BTRFS_FT_XATTR 8 | 173 | #define BTRFS_FT_XATTR 8 |
174 | #define BTRFS_FT_MAX 9 | 174 | #define BTRFS_FT_MAX 9 |
175 | 175 | ||
176 | /* ioprio of readahead is set to idle */ | ||
177 | #define BTRFS_IOPRIO_READA (IOPRIO_PRIO_VALUE(IOPRIO_CLASS_IDLE, 0)) | ||
178 | |||
176 | /* | 179 | /* |
177 | * The key defines the order in the tree, and so it also defines (optimal) | 180 | * The key defines the order in the tree, and so it also defines (optimal) |
178 | * block layout. | 181 | * block layout. |
diff --git a/fs/btrfs/reada.c b/fs/btrfs/reada.c index ac5d01085884..48a4882d8ad5 100644 --- a/fs/btrfs/reada.c +++ b/fs/btrfs/reada.c | |||
@@ -718,13 +718,18 @@ static void reada_start_machine_worker(struct btrfs_work *work) | |||
718 | { | 718 | { |
719 | struct reada_machine_work *rmw; | 719 | struct reada_machine_work *rmw; |
720 | struct btrfs_fs_info *fs_info; | 720 | struct btrfs_fs_info *fs_info; |
721 | int old_ioprio; | ||
721 | 722 | ||
722 | rmw = container_of(work, struct reada_machine_work, work); | 723 | rmw = container_of(work, struct reada_machine_work, work); |
723 | fs_info = rmw->fs_info; | 724 | fs_info = rmw->fs_info; |
724 | 725 | ||
725 | kfree(rmw); | 726 | kfree(rmw); |
726 | 727 | ||
728 | old_ioprio = IOPRIO_PRIO_VALUE(task_nice_ioclass(current), | ||
729 | task_nice_ioprio(current)); | ||
730 | set_task_ioprio(current, BTRFS_IOPRIO_READA); | ||
727 | __reada_start_machine(fs_info); | 731 | __reada_start_machine(fs_info); |
732 | set_task_ioprio(current, old_ioprio); | ||
728 | } | 733 | } |
729 | 734 | ||
730 | static void __reada_start_machine(struct btrfs_fs_info *fs_info) | 735 | static void __reada_start_machine(struct btrfs_fs_info *fs_info) |