From: Zach Brown Date: Sun, 10 Dec 2006 10:21:01 +0000 (-0800) Subject: [PATCH] dio: remove duplicate bio wait code X-Git-Tag: v2.6.20-rc2~85^2~31 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20258b2b397031649e4a41922fe803d57017df84;p=pandora-kernel.git [PATCH] dio: remove duplicate bio wait code Now that we have a single refcount and waiting path we can reuse it in the async 'should_wait' path. It continues to rely on the fragile link between the conditional in dio_complete_aio() which decides to complete the AIO and the conditional in direct_io_worker() which decides to wait and free. By waiting before dropping the reference we stop dio_bio_end_aio() from calling dio_complete_aio() which used to wake up the waiter after seeing the reference count drop to 0. We hoist this wake up into dio_bio_end_aio() which now notices when it's left a single remaining reference that is held by the waiter. Signed-off-by: Zach Brown Cc: Badari Pulavarty Cc: Suparna Bhattacharya Acked-by: Jeff Moyer Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed