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
commit1d4989c858093bda0426be536fc7f9c415857836 (patch)
treef3d831048cb65b39d5fb89178d2a6de599518a2b /drivers/md/dm-snap.c
parentd32a6ea65fbc33621f9c790da3dff10201640b2a (diff)
dm snapshot: rename dm_snap_exception to dm_exception
The exception structure is not necessarily just a snapshot element (especially after we pull it out of dm-snap.c). Renaming appropriately. 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.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index 9135498213ef..a7d60f644063 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -116,7 +116,7 @@ static int bdev_equal(struct block_device *lhs, struct block_device *rhs)
116} 116}
117 117
118struct dm_snap_pending_exception { 118struct dm_snap_pending_exception {
119 struct dm_snap_exception e; 119 struct dm_exception e;
120 120
121 /* 121 /*
122 * Origin buffers waiting for this to complete are held 122 * Origin buffers waiting for this to complete are held
@@ -371,7 +371,7 @@ static int init_exception_table(struct exception_table *et, uint32_t size,
371static void exit_exception_table(struct exception_table *et, struct kmem_cache *mem) 371static void exit_exception_table(struct exception_table *et, struct kmem_cache *mem)
372{ 372{
373 struct list_head *slot; 373 struct list_head *slot;
374 struct dm_snap_exception *ex, *next; 374 struct dm_exception *ex, *next;
375 int i, size; 375 int i, size;
376 376
377 size = et->hash_mask + 1; 377 size = et->hash_mask + 1;
@@ -390,7 +390,7 @@ static uint32_t exception_hash(struct exception_table *et, chunk_t chunk)
390 return (chunk >> et->hash_shift) & et->hash_mask; 390 return (chunk >> et->hash_shift) & et->hash_mask;
391} 391}
392 392
393static void remove_exception(struct dm_snap_exception *e) 393static void remove_exception(struct dm_exception *e)
394{ 394{
395 list_del(&e->hash_list); 395 list_del(&e->hash_list);
396} 396}
@@ -399,11 +399,11 @@ static void remove_exception(struct dm_snap_exception *e)
399 * Return the exception data for a sector, or NULL if not 399 * Return the exception data for a sector, or NULL if not
400 * remapped. 400 * remapped.
401 */ 401 */
402static struct dm_snap_exception *lookup_exception(struct exception_table *et, 402static struct dm_exception *lookup_exception(struct exception_table *et,
403 chunk_t chunk) 403 chunk_t chunk)
404{ 404{
405 struct list_head *slot; 405 struct list_head *slot;
406 struct dm_snap_exception *e; 406 struct dm_exception *e;
407 407
408 slot = &et->table[exception_hash(et, chunk)]; 408 slot = &et->table[exception_hash(et, chunk)];
409 list_for_each_entry (e, slot, hash_list) 409 list_for_each_entry (e, slot, hash_list)
@@ -414,9 +414,9 @@ static struct dm_snap_exception *lookup_exception(struct exception_table *et,
414 return NULL; 414 return NULL;
415} 415}
416 416
417static struct dm_snap_exception *alloc_exception(void) 417static struct dm_exception *alloc_exception(void)
418{ 418{
419 struct dm_snap_exception *e; 419 struct dm_exception *e;
420 420
421 e = kmem_cache_alloc(exception_cache, GFP_NOIO); 421 e = kmem_cache_alloc(exception_cache, GFP_NOIO);
422 if (!e) 422 if (!e)
@@ -425,7 +425,7 @@ static struct dm_snap_exception *alloc_exception(void)
425 return e; 425 return e;
426} 426}
427 427
428static void free_exception(struct dm_snap_exception *e) 428static void free_exception(struct dm_exception *e)
429{ 429{
430 kmem_cache_free(exception_cache, e); 430 kmem_cache_free(exception_cache, e);
431} 431}
@@ -451,10 +451,10 @@ static void free_pending_exception(struct dm_snap_pending_exception *pe)
451} 451}
452 452
453static void insert_exception(struct exception_table *eh, 453static void insert_exception(struct exception_table *eh,
454 struct dm_snap_exception *new_e) 454 struct dm_exception *new_e)
455{ 455{
456 struct list_head *l; 456 struct list_head *l;
457 struct dm_snap_exception *e = NULL; 457 struct dm_exception *e = NULL;
458 458
459 l = &eh->table[exception_hash(eh, new_e->old_chunk)]; 459 l = &eh->table[exception_hash(eh, new_e->old_chunk)];
460 460
@@ -499,7 +499,7 @@ out:
499static int dm_add_exception(void *context, chunk_t old, chunk_t new) 499static int dm_add_exception(void *context, chunk_t old, chunk_t new)
500{ 500{
501 struct dm_snapshot *s = context; 501 struct dm_snapshot *s = context;
502 struct dm_snap_exception *e; 502 struct dm_exception *e;
503 503
504 e = alloc_exception(); 504 e = alloc_exception();
505 if (!e) 505 if (!e)
@@ -876,7 +876,7 @@ static struct bio *put_pending_exception(struct dm_snap_pending_exception *pe)
876 876
877static void pending_complete(struct dm_snap_pending_exception *pe, int success) 877static void pending_complete(struct dm_snap_pending_exception *pe, int success)
878{ 878{
879 struct dm_snap_exception *e; 879 struct dm_exception *e;
880 struct dm_snapshot *s = pe->snap; 880 struct dm_snapshot *s = pe->snap;
881 struct bio *origin_bios = NULL; 881 struct bio *origin_bios = NULL;
882 struct bio *snapshot_bios = NULL; 882 struct bio *snapshot_bios = NULL;
@@ -988,7 +988,7 @@ static void start_copy(struct dm_snap_pending_exception *pe)
988static struct dm_snap_pending_exception * 988static struct dm_snap_pending_exception *
989__lookup_pending_exception(struct dm_snapshot *s, chunk_t chunk) 989__lookup_pending_exception(struct dm_snapshot *s, chunk_t chunk)
990{ 990{
991 struct dm_snap_exception *e = lookup_exception(&s->pending, chunk); 991 struct dm_exception *e = lookup_exception(&s->pending, chunk);
992 992
993 if (!e) 993 if (!e)
994 return NULL; 994 return NULL;
@@ -1034,7 +1034,7 @@ __find_pending_exception(struct dm_snapshot *s,
1034 return pe; 1034 return pe;
1035} 1035}
1036 1036
1037static void remap_exception(struct dm_snapshot *s, struct dm_snap_exception *e, 1037static void remap_exception(struct dm_snapshot *s, struct dm_exception *e,
1038 struct bio *bio, chunk_t chunk) 1038 struct bio *bio, chunk_t chunk)
1039{ 1039{
1040 bio->bi_bdev = s->store->cow->bdev; 1040 bio->bi_bdev = s->store->cow->bdev;
@@ -1048,7 +1048,7 @@ static void remap_exception(struct dm_snapshot *s, struct dm_snap_exception *e,
1048static int snapshot_map(struct dm_target *ti, struct bio *bio, 1048static int snapshot_map(struct dm_target *ti, struct bio *bio,
1049 union map_info *map_context) 1049 union map_info *map_context)
1050{ 1050{
1051 struct dm_snap_exception *e; 1051 struct dm_exception *e;
1052 struct dm_snapshot *s = ti->private; 1052 struct dm_snapshot *s = ti->private;
1053 int r = DM_MAPIO_REMAPPED; 1053 int r = DM_MAPIO_REMAPPED;
1054 chunk_t chunk; 1054 chunk_t chunk;
@@ -1221,7 +1221,7 @@ static int __origin_write(struct list_head *snapshots, struct bio *bio)
1221{ 1221{
1222 int r = DM_MAPIO_REMAPPED, first = 0; 1222 int r = DM_MAPIO_REMAPPED, first = 0;
1223 struct dm_snapshot *snap; 1223 struct dm_snapshot *snap;
1224 struct dm_snap_exception *e; 1224 struct dm_exception *e;
1225 struct dm_snap_pending_exception *pe, *next_pe, *primary_pe = NULL; 1225 struct dm_snap_pending_exception *pe, *next_pe, *primary_pe = NULL;
1226 chunk_t chunk; 1226 chunk_t chunk;
1227 LIST_HEAD(pe_queue); 1227 LIST_HEAD(pe_queue);
@@ -1500,7 +1500,7 @@ static int __init dm_snapshot_init(void)
1500 goto bad2; 1500 goto bad2;
1501 } 1501 }
1502 1502
1503 exception_cache = KMEM_CACHE(dm_snap_exception, 0); 1503 exception_cache = KMEM_CACHE(dm_exception, 0);
1504 if (!exception_cache) { 1504 if (!exception_cache) {
1505 DMERR("Couldn't create exception cache."); 1505 DMERR("Couldn't create exception cache.");
1506 r = -ENOMEM; 1506 r = -ENOMEM;