From patchwork Tue Mar 17 14:02:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonthan Brassow X-Patchwork-Id: 12604 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 n2HE2jbO018416 for ; Tue, 17 Mar 2009 14:02:45 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 CCF23618D9D; Tue, 17 Mar 2009 10:02:45 -0400 (EDT) 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 n2HE2huw023046 for ; Tue, 17 Mar 2009 10:02:43 -0400 Received: from hydrogen.msp.redhat.com (hydrogen.msp.redhat.com [10.15.80.1]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n2HE2hGs005205 for ; Tue, 17 Mar 2009 10:02:43 -0400 Received: from hydrogen.msp.redhat.com (localhost.localdomain [127.0.0.1]) by hydrogen.msp.redhat.com (8.14.1/8.14.1) with ESMTP id n2HE2frG017344 for ; Tue, 17 Mar 2009 09:02:41 -0500 Received: (from jbrassow@localhost) by hydrogen.msp.redhat.com (8.14.1/8.14.1/Submit) id n2HE2f6Q017342 for dm-devel@redhat.com; Tue, 17 Mar 2009 09:02:41 -0500 Date: Tue, 17 Mar 2009 09:02:41 -0500 From: Jonathan Brassow Message-Id: <200903171402.n2HE2f6Q017342@hydrogen.msp.redhat.com> To: dm-devel@redhat.com X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-loop: dm-devel@redhat.com Subject: [dm-devel] [PATCH 3 of 29] dm-snap-consolidate-insert_exception.patch 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 It is ridiculous to have two 'insert_*exception' functions when one of the functions already handles both cases. Consolidating them. Signed-off-by: Jonathan Brassow --- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel Index: linux-2.6/drivers/md/dm-snap.c =================================================================== --- linux-2.6.orig/drivers/md/dm-snap.c +++ linux-2.6/drivers/md/dm-snap.c @@ -388,13 +388,6 @@ static uint32_t exception_hash(struct dm return (chunk >> et->hash_shift) & et->hash_mask; } -static void insert_exception(struct dm_exception_table *eh, - struct dm_exception *e) -{ - struct list_head *l = &eh->table[exception_hash(eh, e->old_chunk)]; - list_add(&e->hash_list, l); -} - static void remove_exception(struct dm_exception *e) { list_del(&e->hash_list); @@ -455,10 +448,9 @@ static void free_pending_exception(struc atomic_dec(&s->pending_exceptions_count); } -static void insert_completed_exception(struct dm_snapshot *s, - struct dm_exception *new_e) +static void insert_exception(struct dm_exception_table *eh, + struct dm_exception *new_e) { - struct dm_exception_table *eh = &s->complete; struct list_head *l; struct dm_exception *e = NULL; @@ -516,7 +508,7 @@ static int dm_add_exception(void *contex /* Consecutive_count is implicitly initialised to zero */ e->new_chunk = new; - insert_completed_exception(s, e); + insert_exception(&s->complete, e); return 0; } @@ -958,7 +950,7 @@ static void pending_complete(struct dm_s * Add a proper exception, and remove the * in-flight exception from the list. */ - insert_completed_exception(s, e); + insert_exception(&s->complete, e); out: remove_exception(&pe->e);