aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-snap.c
diff options
context:
space:
mode:
authorJon Brassow <jbrassow@redhat.com>2009-12-10 18:52:10 -0500
committerAlasdair G Kergon <agk@redhat.com>2009-12-10 18:52:10 -0500
commit191437a53c8269df3a2c6199206781e742c57bb5 (patch)
treecf0c03388fe387a7f2e40a1eb5cf1b8761cf7db6 /drivers/md/dm-snap.c
parent1d4989c858093bda0426be536fc7f9c415857836 (diff)
dm snapshot: rename exception_table to dm_exception_table
Rename exception_table for broader use outside dm-snap.c Signed-off-by: Jonathan Brassow <jbrassow@redhat.com> Reviewed-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-snap.c')
-rw-r--r--drivers/md/dm-snap.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index a7d60f644063..f40331cb1f6e 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -49,7 +49,7 @@
49#define DM_TRACKED_CHUNK_HASH(x) ((unsigned long)(x) & \ 49#define DM_TRACKED_CHUNK_HASH(x) ((unsigned long)(x) & \
50 (DM_TRACKED_CHUNK_HASH_SIZE - 1)) 50 (DM_TRACKED_CHUNK_HASH_SIZE - 1))
51 51
52struct exception_table { 52struct dm_exception_table {
53 uint32_t hash_mask; 53 uint32_t hash_mask;
54 unsigned hash_shift; 54 unsigned hash_shift;
55 struct list_head *table; 55 struct list_head *table;
@@ -73,8 +73,8 @@ struct dm_snapshot {
73 73
74 atomic_t pending_exceptions_count; 74 atomic_t pending_exceptions_count;
75 75
76 struct exception_table pending; 76 struct dm_exception_table pending;
77 struct exception_table complete; 77 struct dm_exception_table complete;
78 78
79 /* 79 /*
80 * pe_lock protects all pending_exception operations and access 80 * pe_lock protects all pending_exception operations and access
@@ -351,7 +351,7 @@ static void unregister_snapshot(struct dm_snapshot *s)
351 * The lowest hash_shift bits of the chunk number are ignored, allowing 351 * The lowest hash_shift bits of the chunk number are ignored, allowing
352 * some consecutive chunks to be grouped together. 352 * some consecutive chunks to be grouped together.
353 */ 353 */
354static int init_exception_table(struct exception_table *et, uint32_t size, 354static int init_exception_table(struct dm_exception_table *et, uint32_t size,
355 unsigned hash_shift) 355 unsigned hash_shift)
356{ 356{
357 unsigned int i; 357 unsigned int i;
@@ -368,7 +368,8 @@ static int init_exception_table(struct exception_table *et, uint32_t size,
368 return 0; 368 return 0;
369} 369}
370 370
371static void exit_exception_table(struct exception_table *et, struct kmem_cache *mem) 371static void exit_exception_table(struct dm_exception_table *et,
372 struct kmem_cache *mem)
372{ 373{
373 struct list_head *slot; 374 struct list_head *slot;
374 struct dm_exception *ex, *next; 375 struct dm_exception *ex, *next;
@@ -385,7 +386,7 @@ static void exit_exception_table(struct exception_table *et, struct kmem_cache *
385 vfree(et->table); 386 vfree(et->table);
386} 387}
387 388
388static uint32_t exception_hash(struct exception_table *et, chunk_t chunk) 389static uint32_t exception_hash(struct dm_exception_table *et, chunk_t chunk)
389{ 390{
390 return (chunk >> et->hash_shift) & et->hash_mask; 391 return (chunk >> et->hash_shift) & et->hash_mask;
391} 392}
@@ -399,7 +400,7 @@ static void remove_exception(struct dm_exception *e)
399 * Return the exception data for a sector, or NULL if not 400 * Return the exception data for a sector, or NULL if not
400 * remapped. 401 * remapped.
401 */ 402 */
402static struct dm_exception *lookup_exception(struct exception_table *et, 403static struct dm_exception *lookup_exception(struct dm_exception_table *et,
403 chunk_t chunk) 404 chunk_t chunk)
404{ 405{
405 struct list_head *slot; 406 struct list_head *slot;
@@ -450,7 +451,7 @@ static void free_pending_exception(struct dm_snap_pending_exception *pe)
450 atomic_dec(&s->pending_exceptions_count); 451 atomic_dec(&s->pending_exceptions_count);
451} 452}
452 453
453static void insert_exception(struct exception_table *eh, 454static void insert_exception(struct dm_exception_table *eh,
454 struct dm_exception *new_e) 455 struct dm_exception *new_e)
455{ 456{
456 struct list_head *l; 457 struct list_head *l;