btrfs: merge critical sections of discard lock in workfn
authorPavel Begunkov <asml.silence@gmail.com>
Sun, 6 Dec 2020 15:56:22 +0000 (15:56 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Jan 2021 17:27:24 +0000 (18:27 +0100)
commitf89d84b35af33b58ec67c78ac7cc670f57ae2466
tree83ee14065446921d7ed23340bfc189d4ed7c024b
parent33061bd104cbf6798738cf2f5608f18910d9f9da
btrfs: merge critical sections of discard lock in workfn

[ Upstream commit 8fc058597a283e9a37720abb0e8d68e342b9387d ]

btrfs_discard_workfn() drops discard_ctl->lock just to take it again in
a moment in btrfs_discard_schedule_work(). Avoid that and also reuse
ktime.

Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/btrfs/discard.c