From patchwork Mon Feb 23 19:20:00 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikulas Patocka X-Patchwork-Id: 8484 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 n1NJK6Ck029798 for ; Mon, 23 Feb 2009 19:20:07 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 2A5E26197B4; Mon, 23 Feb 2009 14:20:06 -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 n1NJK30j011263 for ; Mon, 23 Feb 2009 14:20:04 -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 n1NJK32v027963 for ; Mon, 23 Feb 2009 14:20:03 -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 n1NJK0bQ024337 for ; Mon, 23 Feb 2009 14:20:00 -0500 Received: from localhost (mpatocka@localhost) by hs20-bc2-1.build.redhat.com (8.13.1/8.13.1/Submit) with ESMTP id n1NJK0mO024331 for ; Mon, 23 Feb 2009 14:20:00 -0500 X-Authentication-Warning: hs20-bc2-1.build.redhat.com: mpatocka owned process doing -bs Date: Mon, 23 Feb 2009 14:20:00 -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 2/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 Remove "type" argument of dm_wq_req because it can have only one value. And it won't be used later. Signed-off-by: Mikulas Patocka --- drivers/md/dm.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 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:37:44.000000000 +0100 +++ linux-2.6.29-rc3-devel/drivers/md/dm.c 2009-02-05 05:38:27.000000000 +0100 @@ -100,9 +100,6 @@ union map_info *dm_get_mapinfo(struct bi * Work processed by per-device workqueue. */ struct dm_wq_req { - enum { - DM_WQ_FLUSH_DEFERRED, - } type; struct work_struct work; struct mapped_device *md; void *context; @@ -1431,32 +1428,24 @@ static void dm_wq_work(struct work_struc struct mapped_device *md = req->md; down_write(&md->io_lock); - switch (req->type) { - case DM_WQ_FLUSH_DEFERRED: - __flush_deferred_io(md); - break; - default: - DMERR("dm_wq_work: unrecognised work type %d", req->type); - BUG(); - } + __flush_deferred_io(md); up_write(&md->io_lock); } -static void dm_wq_queue(struct mapped_device *md, int type, void *context, +static void dm_wq_queue(struct mapped_device *md, void *context, struct dm_wq_req *req) { - req->type = type; req->md = md; req->context = context; INIT_WORK(&req->work, dm_wq_work); queue_work(md->wq, &req->work); } -static void dm_queue_flush(struct mapped_device *md, int type, void *context) +static void dm_queue_flush(struct mapped_device *md, void *context) { struct dm_wq_req req; - dm_wq_queue(md, type, context, &req); + dm_wq_queue(md, context, &req); flush_workqueue(md->wq); } @@ -1590,7 +1579,7 @@ int dm_suspend(struct mapped_device *md, /* were we interrupted ? */ if (r < 0) { - dm_queue_flush(md, DM_WQ_FLUSH_DEFERRED, NULL); + dm_queue_flush(md, NULL); unlock_fs(md); goto out; /* pushback list is already flushed, so skip flush */ @@ -1625,7 +1614,7 @@ int dm_resume(struct mapped_device *md) if (r) goto out; - dm_queue_flush(md, DM_WQ_FLUSH_DEFERRED, NULL); + dm_queue_flush(md, NULL); unlock_fs(md);