dm: merge __flush_deferred_io into caller

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Friday, April 3, 2009 - 11:09 am

Gitweb:     http://git.kernel.org/linus/ef2085870ea448b3c19160d899cf4f948da6a384
Commit:     ef2085870ea448b3c19160d899cf4f948da6a384
Parent:     f0b9a4502baa18f8a255a2866bb4e0655fb35974
Author:     Mikulas Patocka <mpatocka@redhat.com>
AuthorDate: Thu Apr 2 19:55:38 2009 +0100
Committer:  Alasdair G Kergon <agk@redhat.com>
CommitDate: Thu Apr 2 19:55:38 2009 +0100

    dm: merge __flush_deferred_io into caller
    
    Merge __flush_deferred_io() into the only caller, dm_wq_work().
    
    There's no need to have a function that has only one caller.
    
    Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
    Signed-off-by: Alasdair G Kergon <agk@redhat.com>
---
 drivers/md/dm.c |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 385c2e8..4ba0811 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1401,14 +1401,20 @@ static int dm_wait_for_completion(struct mapped_device *md)
 /*
  * 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)))
 		__split_and_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)
@@ -1422,16 +1428,6 @@ static void __merge_pushback_list(struct mapped_device *md)
 	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)
 {
 	queue_work(md->wq, &md->work);
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
dm: merge __flush_deferred_io into caller, Linux Kernel Mailing ..., (Fri Apr 3, 11:09 am)