From patchwork Mon Feb 23 19:21:16 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikulas Patocka X-Patchwork-Id: 8490 X-Patchwork-Delegate: agk@redhat.com Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n1NJLV5N029906 for ; Mon, 23 Feb 2009 19:21:31 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id 857B9619BCE; Mon, 23 Feb 2009 14:21:30 -0500 (EST) Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n1NJLKGO011442 for ; Mon, 23 Feb 2009 14:21:20 -0500 Received: from hs20-bc2-1.build.redhat.com (hs20-bc2-1.build.redhat.com [10.10.28.34]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n1NJLJNN029094 for ; Mon, 23 Feb 2009 14:21:20 -0500 Received: from hs20-bc2-1.build.redhat.com (localhost.localdomain [127.0.0.1]) by hs20-bc2-1.build.redhat.com (8.13.1/8.13.1) with ESMTP id n1NJLHIs025377 for ; Mon, 23 Feb 2009 14:21:17 -0500 Received: from localhost (mpatocka@localhost) by hs20-bc2-1.build.redhat.com (8.13.1/8.13.1/Submit) with ESMTP id n1NJLHQK025371 for ; Mon, 23 Feb 2009 14:21:17 -0500 X-Authentication-Warning: hs20-bc2-1.build.redhat.com: mpatocka owned process doing -bs Date: Mon, 23 Feb 2009 14:21:16 -0500 (EST) From: Mikulas Patocka X-X-Sender: mpatocka@hs20-bc2-1.build.redhat.com To: dm-devel@redhat.com Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-loop: dm-devel@redhat.com Subject: [dm-devel] [PATCH 7/14] barriers X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com Move content of __flush_deferred_io to the calling function: dm_wq_work. There's no need to have a function that has only one caller. It makes further patches more clean (i.e. no more dropping a lock inside a subfunction that was took by the parent function) Signed-off-by: Mikulas Patocka --- drivers/md/dm.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel Index: linux-2.6.29-rc3-devel/drivers/md/dm.c =================================================================== --- linux-2.6.29-rc3-devel.orig/drivers/md/dm.c 2009-02-05 05:51:29.000000000 +0100 +++ linux-2.6.29-rc3-devel/drivers/md/dm.c 2009-02-05 05:52:11.000000000 +0100 @@ -1398,14 +1398,19 @@ static int dm_wait_for_completion(struct /* * Process the deferred bios */ -static void __flush_deferred_io(struct mapped_device *md) +static void dm_wq_work(struct work_struct *work) { + struct mapped_device *md = container_of(work, struct mapped_device, work); struct bio *c; + down_write(&md->io_lock); + while ((c = bio_list_pop(&md->deferred))) __process_bio(md, c); clear_bit(DMF_BLOCK_IO, &md->flags); + + up_write(&md->io_lock); } static void __merge_pushback_list(struct mapped_device *md) @@ -1419,14 +1424,6 @@ static void __merge_pushback_list(struct spin_unlock_irqrestore(&md->pushback_lock, flags); } -static void dm_wq_work(struct work_struct *work) -{ - struct mapped_device *md = container_of(work, struct mapped_device, work); - - down_write(&md->io_lock); - __flush_deferred_io(md); - up_write(&md->io_lock); -} static void dm_queue_flush(struct mapped_device *md) {