]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dm cache: submit writethrough writes in parallel to origin and cache
authorMike Snitzer <snitzer@redhat.com>
Thu, 19 Oct 2017 21:16:54 +0000 (17:16 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Aug 2020 07:48:23 +0000 (09:48 +0200)
commit8036335f8f4feddcdc118c4442e6e7af9c8116d8
treeb8e40331d752e98c338eec97bbc726eada723020
parent755b4e83e11cfc530e426e1f717e97dc8af31d3d
dm cache: submit writethrough writes in parallel to origin and cache

commit 2df3bae9a6543e90042291707b8db0cbfbae9ee9 upstream.

Discontinue issuing writethrough write IO in series to the origin and
then cache.

Use bio_clone_fast() to create a new origin clone bio that will be
mapped to the origin device and then bio_chain() it to the bio that gets
remapped to the cache device.  The origin clone bio does _not_ have a
copy of the per_bio_data -- as such check_if_tick_bio_needed() will not
be called.

The cache bio (parent bio) will not complete until the origin bio has
completed -- this fulfills bio_clone_fast()'s requirements as well as
the requirement to not complete the original IO until the write IO has
completed to both the origin and cache device.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-cache-target.c