From patchwork Fri Feb 20 23:11:33 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonthan Brassow X-Patchwork-Id: 8209 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 n1KNBchK029305 for ; Fri, 20 Feb 2009 23:11:38 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 6E01761B3A4; Fri, 20 Feb 2009 18:11:37 -0500 (EST) Received: from int-mx2.corp.redhat.com (nat-pool.util.phx.redhat.com [10.8.5.200]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n1KNBZvM031379 for ; Fri, 20 Feb 2009 18:11:35 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n1KNBZjT012385 for ; Fri, 20 Feb 2009 18:11:35 -0500 Received: from [10.15.80.1] (hydrogen.msp.redhat.com [10.15.80.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n1KNBYQC025612 for ; Fri, 20 Feb 2009 18:11:34 -0500 From: Jonathan Brassow To: dm-devel@redhat.com Date: Fri, 20 Feb 2009 17:11:33 -0600 Message-Id: <1235171493.24593.20.camel@hydrogen.msp.redhat.com> Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 X-loop: dm-devel@redhat.com Subject: [dm-devel] [PATCH 2 of 17] dm-snap-rename-exception_table.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 Rename exception_table for broader use outside dm-snap.c 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 @@ -51,7 +51,7 @@ #define DM_TRACKED_CHUNK_HASH(x) ((unsigned long)(x) & \ (DM_TRACKED_CHUNK_HASH_SIZE - 1)) -struct exception_table { +struct dm_exception_table { uint32_t hash_mask; unsigned hash_shift; struct list_head *table; @@ -75,8 +75,8 @@ struct dm_snapshot { atomic_t pending_exceptions_count; - struct exception_table pending; - struct exception_table complete; + struct dm_exception_table pending; + struct dm_exception_table complete; /* * pe_lock protects all pending_exception operations and access @@ -348,7 +348,7 @@ static void unregister_snapshot(struct d * The lowest hash_shift bits of the chunk number are ignored, allowing * some consecutive chunks to be grouped together. */ -static int init_exception_table(struct exception_table *et, uint32_t size, +static int init_exception_table(struct dm_exception_table *et, uint32_t size, unsigned hash_shift) { unsigned int i; @@ -365,7 +365,7 @@ static int init_exception_table(struct e return 0; } -static void exit_exception_table(struct exception_table *et, +static void exit_exception_table(struct dm_exception_table *et, struct kmem_cache *mem) { struct list_head *slot; @@ -383,12 +383,12 @@ static void exit_exception_table(struct vfree(et->table); } -static uint32_t exception_hash(struct exception_table *et, chunk_t chunk) +static uint32_t exception_hash(struct dm_exception_table *et, chunk_t chunk) { return (chunk >> et->hash_shift) & et->hash_mask; } -static void insert_exception(struct exception_table *eh, +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)]; @@ -404,7 +404,7 @@ static void remove_exception(struct dm_e * Return the exception data for a sector, or NULL if not * remapped. */ -static struct dm_exception *lookup_exception(struct exception_table *et, +static struct dm_exception *lookup_exception(struct dm_exception_table *et, chunk_t chunk) { struct list_head *slot; @@ -458,7 +458,7 @@ static void free_pending_exception(struc static void insert_completed_exception(struct dm_snapshot *s, struct dm_exception *new_e) { - struct exception_table *eh = &s->complete; + struct dm_exception_table *eh = &s->complete; struct list_head *l; struct dm_exception *e = NULL;