dm snapshot: rename struct exception_store

Rename struct exception_store to dm_exception_store.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>

authored by

Jonathan Brassow and committed by
Alasdair G Kergon
1ae25f9c aea53d92

+25 -24
+14 -14
drivers/md/dm-exception-store.c
··· 462 return 0; 463 } 464 465 - static struct pstore *get_info(struct exception_store *store) 466 { 467 return (struct pstore *) store->context; 468 } 469 470 - static void persistent_fraction_full(struct exception_store *store, 471 sector_t *numerator, sector_t *denominator) 472 { 473 *numerator = get_info(store)->next_free * store->snap->chunk_size; 474 *denominator = get_dev_size(store->snap->cow->bdev); 475 } 476 477 - static void persistent_destroy(struct exception_store *store) 478 { 479 struct pstore *ps = get_info(store); 480 ··· 485 kfree(ps); 486 } 487 488 - static int persistent_read_metadata(struct exception_store *store) 489 { 490 int r, uninitialized_var(new_snapshot); 491 struct pstore *ps = get_info(store); ··· 551 return 0; 552 } 553 554 - static int persistent_prepare(struct exception_store *store, 555 struct dm_snap_exception *e) 556 { 557 struct pstore *ps = get_info(store); ··· 578 return 0; 579 } 580 581 - static void persistent_commit(struct exception_store *store, 582 struct dm_snap_exception *e, 583 void (*callback) (void *, int success), 584 void *callback_context) ··· 640 ps->callback_count = 0; 641 } 642 643 - static void persistent_drop(struct exception_store *store) 644 { 645 struct pstore *ps = get_info(store); 646 ··· 649 DMWARN("write header failed"); 650 } 651 652 - int dm_create_persistent(struct exception_store *store) 653 { 654 struct pstore *ps; 655 ··· 694 sector_t next_free; 695 }; 696 697 - static void transient_destroy(struct exception_store *store) 698 { 699 kfree(store->context); 700 } 701 702 - static int transient_read_metadata(struct exception_store *store) 703 { 704 return 0; 705 } 706 707 - static int transient_prepare(struct exception_store *store, 708 struct dm_snap_exception *e) 709 { 710 struct transient_c *tc = (struct transient_c *) store->context; ··· 719 return 0; 720 } 721 722 - static void transient_commit(struct exception_store *store, 723 struct dm_snap_exception *e, 724 void (*callback) (void *, int success), 725 void *callback_context) ··· 728 callback(callback_context, 1); 729 } 730 731 - static void transient_fraction_full(struct exception_store *store, 732 sector_t *numerator, sector_t *denominator) 733 { 734 *numerator = ((struct transient_c *) store->context)->next_free; 735 *denominator = get_dev_size(store->snap->cow->bdev); 736 } 737 738 - int dm_create_transient(struct exception_store *store) 739 { 740 struct transient_c *tc; 741
··· 462 return 0; 463 } 464 465 + static struct pstore *get_info(struct dm_exception_store *store) 466 { 467 return (struct pstore *) store->context; 468 } 469 470 + static void persistent_fraction_full(struct dm_exception_store *store, 471 sector_t *numerator, sector_t *denominator) 472 { 473 *numerator = get_info(store)->next_free * store->snap->chunk_size; 474 *denominator = get_dev_size(store->snap->cow->bdev); 475 } 476 477 + static void persistent_destroy(struct dm_exception_store *store) 478 { 479 struct pstore *ps = get_info(store); 480 ··· 485 kfree(ps); 486 } 487 488 + static int persistent_read_metadata(struct dm_exception_store *store) 489 { 490 int r, uninitialized_var(new_snapshot); 491 struct pstore *ps = get_info(store); ··· 551 return 0; 552 } 553 554 + static int persistent_prepare(struct dm_exception_store *store, 555 struct dm_snap_exception *e) 556 { 557 struct pstore *ps = get_info(store); ··· 578 return 0; 579 } 580 581 + static void persistent_commit(struct dm_exception_store *store, 582 struct dm_snap_exception *e, 583 void (*callback) (void *, int success), 584 void *callback_context) ··· 640 ps->callback_count = 0; 641 } 642 643 + static void persistent_drop(struct dm_exception_store *store) 644 { 645 struct pstore *ps = get_info(store); 646 ··· 649 DMWARN("write header failed"); 650 } 651 652 + int dm_create_persistent(struct dm_exception_store *store) 653 { 654 struct pstore *ps; 655 ··· 694 sector_t next_free; 695 }; 696 697 + static void transient_destroy(struct dm_exception_store *store) 698 { 699 kfree(store->context); 700 } 701 702 + static int transient_read_metadata(struct dm_exception_store *store) 703 { 704 return 0; 705 } 706 707 + static int transient_prepare(struct dm_exception_store *store, 708 struct dm_snap_exception *e) 709 { 710 struct transient_c *tc = (struct transient_c *) store->context; ··· 719 return 0; 720 } 721 722 + static void transient_commit(struct dm_exception_store *store, 723 struct dm_snap_exception *e, 724 void (*callback) (void *, int success), 725 void *callback_context) ··· 728 callback(callback_context, 1); 729 } 730 731 + static void transient_fraction_full(struct dm_exception_store *store, 732 sector_t *numerator, sector_t *denominator) 733 { 734 *numerator = ((struct transient_c *) store->context)->next_free; 735 *denominator = get_dev_size(store->snap->cow->bdev); 736 } 737 738 + int dm_create_transient(struct dm_exception_store *store) 739 { 740 struct transient_c *tc; 741
+10 -9
drivers/md/dm-exception-store.h
··· 36 * Abstraction to handle the meta/layout of exception stores (the 37 * COW device). 38 */ 39 - struct exception_store { 40 /* 41 * Destroys this object when you've finished with it. 42 */ 43 - void (*destroy) (struct exception_store *store); 44 45 /* 46 * The target shouldn't read the COW device until this is 47 * called. 48 */ 49 - int (*read_metadata) (struct exception_store *store); 50 51 /* 52 * Find somewhere to store the next exception. 53 */ 54 - int (*prepare_exception) (struct exception_store *store, 55 struct dm_snap_exception *e); 56 57 /* 58 * Update the metadata with this exception. 59 */ 60 - void (*commit_exception) (struct exception_store *store, 61 struct dm_snap_exception *e, 62 void (*callback) (void *, int success), 63 void *callback_context); ··· 66 /* 67 * The snapshot is invalid, note this in the metadata. 68 */ 69 - void (*drop_snapshot) (struct exception_store *store); 70 71 /* 72 * Return how full the snapshot is. 73 */ 74 - void (*fraction_full) (struct exception_store *store, 75 sector_t *numerator, 76 sector_t *denominator); 77 ··· 125 /* 126 * Two exception store implementations. 127 */ 128 - int dm_create_persistent(struct exception_store *store); 129 130 - int dm_create_transient(struct exception_store *store); 131 132 #endif /* _LINUX_DM_EXCEPTION_STORE */
··· 36 * Abstraction to handle the meta/layout of exception stores (the 37 * COW device). 38 */ 39 + struct dm_exception_store { 40 + 41 /* 42 * Destroys this object when you've finished with it. 43 */ 44 + void (*destroy) (struct dm_exception_store *store); 45 46 /* 47 * The target shouldn't read the COW device until this is 48 * called. 49 */ 50 + int (*read_metadata) (struct dm_exception_store *store); 51 52 /* 53 * Find somewhere to store the next exception. 54 */ 55 + int (*prepare_exception) (struct dm_exception_store *store, 56 struct dm_snap_exception *e); 57 58 /* 59 * Update the metadata with this exception. 60 */ 61 + void (*commit_exception) (struct dm_exception_store *store, 62 struct dm_snap_exception *e, 63 void (*callback) (void *, int success), 64 void *callback_context); ··· 65 /* 66 * The snapshot is invalid, note this in the metadata. 67 */ 68 + void (*drop_snapshot) (struct dm_exception_store *store); 69 70 /* 71 * Return how full the snapshot is. 72 */ 73 + void (*fraction_full) (struct dm_exception_store *store, 74 sector_t *numerator, 75 sector_t *denominator); 76 ··· 124 /* 125 * Two exception store implementations. 126 */ 127 + int dm_create_persistent(struct dm_exception_store *store); 128 129 + int dm_create_transient(struct dm_exception_store *store); 130 131 #endif /* _LINUX_DM_EXCEPTION_STORE */
+1 -1
drivers/md/dm-snap.h
··· 61 spinlock_t pe_lock; 62 63 /* The on disk metadata handler */ 64 - struct exception_store store; 65 66 struct dm_kcopyd_client *kcopyd_client; 67
··· 61 spinlock_t pe_lock; 62 63 /* The on disk metadata handler */ 64 + struct dm_exception_store store; 65 66 struct dm_kcopyd_client *kcopyd_client; 67