btrfs: move kthread_associate_blkcg out of btrfs_submit_compressed_write
authorChristoph Hellwig <hch@lst.de>
Mon, 27 Mar 2023 00:49:47 +0000 (09:49 +0900)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Apr 2023 16:01:22 +0000 (18:01 +0200)
commit05d06a5c9d9c3c8119c365246dc1e3de2e3c5dd1
treef0d6d377e1469eb3242e40a744bb0d5f36b75404
parent0f69d1f4d62444bc1e7bdbcbea7c646ddcc35a58
btrfs: move kthread_associate_blkcg out of btrfs_submit_compressed_write

btrfs_submit_compressed_write should not have to care if it is called
from a helper thread or not.  Move the kthread_associate_blkcg handling
into submit_one_async_extent, as that is the one caller that needs it.
Also move the assignment of REQ_CGROUP_PUNT into cow_file_range_async,
as that is the routine that sets up the helper thread offload.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/compression.c
fs/btrfs/compression.h
fs/btrfs/inode.c