]> git.karo-electronics.de Git - karo-tx-linux.git/commit
dm thin: replace dm_cell_release_singleton with cell_defer_except
authorJoe Thornber <ejt@redhat.com>
Fri, 21 Dec 2012 20:23:31 +0000 (20:23 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jan 2013 16:46:12 +0000 (08:46 -0800)
commitb5b020e9f6c65b391409552290d0979da5a4f5a6
tree79b7697d5c16adbbf4bc6e1dbc2b5fc55db3f6dc
parente01c4bf8aa398d2abceb73c4e4e2244b3355a51f
dm thin: replace dm_cell_release_singleton with cell_defer_except

commit b7ca9c9273e5eebd63880dd8a6e4e5c18fc7901d upstream.

Change existing users of the function dm_cell_release_singleton to share
cell_defer_except instead, and then remove the now-unused function.

Everywhere that calls dm_cell_release_singleton, the bio in question
is the holder of the cell.

If there are no non-holder entries in the cell then cell_defer_except
behaves exactly like dm_cell_release_singleton.  Conversely, if there
*are* non-holder entries then dm_cell_release_singleton must not be used
because those entries would need to be deferred.

Consequently, it is safe to replace use of dm_cell_release_singleton
with cell_defer_except.

This patch is a pre-requisite for "dm thin: fix race between
simultaneous io and discards to same block".

Signed-off-by: Joe Thornber <ejt@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/dm-bio-prison.c
drivers/md/dm-bio-prison.h
drivers/md/dm-thin.c