aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorChris Mason <clm@fb.com>2015-07-02 16:57:22 -0400
committerChris Mason <clm@fb.com>2015-08-09 10:35:06 -0400
commitda2f0f74cf7d074e5a8918c8efdf6aba4a989b4a (patch)
tree3a2cf977b893863ce5938132a802804a56291f05 /fs/btrfs/inode.c
parenta4027a20c57a2c8779e17a61425737634bb7163d (diff)
Btrfs: add support for blkio controllers
This attaches accounting information to bios as we submit them so the new blkio controllers can throttle on btrfs filesystems. Not much is required, we're just associating bios with blkcgs during clone, calling wbc_init_bio()/wbc_account_io() during writepages submission, and attaching the bios to the current context during direct IO. Finally if we are splitting bios during btrfs_map_bio, this attaches accounting information to the split. The end result is able to throttle nicely on single disk filesystems. A little more work is required for multi-device filesystems. Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 79a73645346e..bda3c41dc9d5 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -7987,7 +7987,11 @@ static struct bio *btrfs_dio_bio_alloc(struct block_device *bdev,
7987 u64 first_sector, gfp_t gfp_flags) 7987 u64 first_sector, gfp_t gfp_flags)
7988{ 7988{
7989 int nr_vecs = bio_get_nr_vecs(bdev); 7989 int nr_vecs = bio_get_nr_vecs(bdev);
7990 return btrfs_bio_alloc(bdev, first_sector, nr_vecs, gfp_flags); 7990 struct bio *bio;
7991 bio = btrfs_bio_alloc(bdev, first_sector, nr_vecs, gfp_flags);
7992 if (bio)
7993 bio_associate_current(bio);
7994 return bio;
7991} 7995}
7992 7996
7993static inline int btrfs_lookup_and_bind_dio_csum(struct btrfs_root *root, 7997static inline int btrfs_lookup_and_bind_dio_csum(struct btrfs_root *root,