Loading drivers/md/dm-exception-store.c +14 −14 Original line number Diff line number Diff line Loading @@ -462,19 +462,19 @@ static int read_exceptions(struct pstore *ps) return 0; } static struct pstore *get_info(struct exception_store *store) static struct pstore *get_info(struct dm_exception_store *store) { return (struct pstore *) store->context; } static void persistent_fraction_full(struct exception_store *store, static void persistent_fraction_full(struct dm_exception_store *store, sector_t *numerator, sector_t *denominator) { *numerator = get_info(store)->next_free * store->snap->chunk_size; *denominator = get_dev_size(store->snap->cow->bdev); } static void persistent_destroy(struct exception_store *store) static void persistent_destroy(struct dm_exception_store *store) { struct pstore *ps = get_info(store); Loading @@ -485,7 +485,7 @@ static void persistent_destroy(struct exception_store *store) kfree(ps); } static int persistent_read_metadata(struct exception_store *store) static int persistent_read_metadata(struct dm_exception_store *store) { int r, uninitialized_var(new_snapshot); struct pstore *ps = get_info(store); Loading Loading @@ -551,7 +551,7 @@ static int persistent_read_metadata(struct exception_store *store) return 0; } static int persistent_prepare(struct exception_store *store, static int persistent_prepare(struct dm_exception_store *store, struct dm_snap_exception *e) { struct pstore *ps = get_info(store); Loading @@ -578,7 +578,7 @@ static int persistent_prepare(struct exception_store *store, return 0; } static void persistent_commit(struct exception_store *store, static void persistent_commit(struct dm_exception_store *store, struct dm_snap_exception *e, void (*callback) (void *, int success), void *callback_context) Loading Loading @@ -640,7 +640,7 @@ static void persistent_commit(struct exception_store *store, ps->callback_count = 0; } static void persistent_drop(struct exception_store *store) static void persistent_drop(struct dm_exception_store *store) { struct pstore *ps = get_info(store); Loading @@ -649,7 +649,7 @@ static void persistent_drop(struct exception_store *store) DMWARN("write header failed"); } int dm_create_persistent(struct exception_store *store) int dm_create_persistent(struct dm_exception_store *store) { struct pstore *ps; Loading Loading @@ -694,17 +694,17 @@ struct transient_c { sector_t next_free; }; static void transient_destroy(struct exception_store *store) static void transient_destroy(struct dm_exception_store *store) { kfree(store->context); } static int transient_read_metadata(struct exception_store *store) static int transient_read_metadata(struct dm_exception_store *store) { return 0; } static int transient_prepare(struct exception_store *store, static int transient_prepare(struct dm_exception_store *store, struct dm_snap_exception *e) { struct transient_c *tc = (struct transient_c *) store->context; Loading @@ -719,7 +719,7 @@ static int transient_prepare(struct exception_store *store, return 0; } static void transient_commit(struct exception_store *store, static void transient_commit(struct dm_exception_store *store, struct dm_snap_exception *e, void (*callback) (void *, int success), void *callback_context) Loading @@ -728,14 +728,14 @@ static void transient_commit(struct exception_store *store, callback(callback_context, 1); } static void transient_fraction_full(struct exception_store *store, static void transient_fraction_full(struct dm_exception_store *store, sector_t *numerator, sector_t *denominator) { *numerator = ((struct transient_c *) store->context)->next_free; *denominator = get_dev_size(store->snap->cow->bdev); } int dm_create_transient(struct exception_store *store) int dm_create_transient(struct dm_exception_store *store) { struct transient_c *tc; Loading drivers/md/dm-exception-store.h +10 −9 Original line number Diff line number Diff line Loading @@ -36,28 +36,29 @@ struct dm_snap_exception { * Abstraction to handle the meta/layout of exception stores (the * COW device). */ struct exception_store { struct dm_exception_store { /* * Destroys this object when you've finished with it. */ void (*destroy) (struct exception_store *store); void (*destroy) (struct dm_exception_store *store); /* * The target shouldn't read the COW device until this is * called. */ int (*read_metadata) (struct exception_store *store); int (*read_metadata) (struct dm_exception_store *store); /* * Find somewhere to store the next exception. */ int (*prepare_exception) (struct exception_store *store, int (*prepare_exception) (struct dm_exception_store *store, struct dm_snap_exception *e); /* * Update the metadata with this exception. */ void (*commit_exception) (struct exception_store *store, void (*commit_exception) (struct dm_exception_store *store, struct dm_snap_exception *e, void (*callback) (void *, int success), void *callback_context); Loading @@ -65,12 +66,12 @@ struct exception_store { /* * The snapshot is invalid, note this in the metadata. */ void (*drop_snapshot) (struct exception_store *store); void (*drop_snapshot) (struct dm_exception_store *store); /* * Return how full the snapshot is. */ void (*fraction_full) (struct exception_store *store, void (*fraction_full) (struct dm_exception_store *store, sector_t *numerator, sector_t *denominator); Loading Loading @@ -124,8 +125,8 @@ static inline void dm_consecutive_chunk_count_inc(struct dm_snap_exception *e) /* * Two exception store implementations. */ int dm_create_persistent(struct exception_store *store); int dm_create_persistent(struct dm_exception_store *store); int dm_create_transient(struct exception_store *store); int dm_create_transient(struct dm_exception_store *store); #endif /* _LINUX_DM_EXCEPTION_STORE */ drivers/md/dm-snap.h +1 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ struct dm_snapshot { spinlock_t pe_lock; /* The on disk metadata handler */ struct exception_store store; struct dm_exception_store store; struct dm_kcopyd_client *kcopyd_client; Loading Loading
drivers/md/dm-exception-store.c +14 −14 Original line number Diff line number Diff line Loading @@ -462,19 +462,19 @@ static int read_exceptions(struct pstore *ps) return 0; } static struct pstore *get_info(struct exception_store *store) static struct pstore *get_info(struct dm_exception_store *store) { return (struct pstore *) store->context; } static void persistent_fraction_full(struct exception_store *store, static void persistent_fraction_full(struct dm_exception_store *store, sector_t *numerator, sector_t *denominator) { *numerator = get_info(store)->next_free * store->snap->chunk_size; *denominator = get_dev_size(store->snap->cow->bdev); } static void persistent_destroy(struct exception_store *store) static void persistent_destroy(struct dm_exception_store *store) { struct pstore *ps = get_info(store); Loading @@ -485,7 +485,7 @@ static void persistent_destroy(struct exception_store *store) kfree(ps); } static int persistent_read_metadata(struct exception_store *store) static int persistent_read_metadata(struct dm_exception_store *store) { int r, uninitialized_var(new_snapshot); struct pstore *ps = get_info(store); Loading Loading @@ -551,7 +551,7 @@ static int persistent_read_metadata(struct exception_store *store) return 0; } static int persistent_prepare(struct exception_store *store, static int persistent_prepare(struct dm_exception_store *store, struct dm_snap_exception *e) { struct pstore *ps = get_info(store); Loading @@ -578,7 +578,7 @@ static int persistent_prepare(struct exception_store *store, return 0; } static void persistent_commit(struct exception_store *store, static void persistent_commit(struct dm_exception_store *store, struct dm_snap_exception *e, void (*callback) (void *, int success), void *callback_context) Loading Loading @@ -640,7 +640,7 @@ static void persistent_commit(struct exception_store *store, ps->callback_count = 0; } static void persistent_drop(struct exception_store *store) static void persistent_drop(struct dm_exception_store *store) { struct pstore *ps = get_info(store); Loading @@ -649,7 +649,7 @@ static void persistent_drop(struct exception_store *store) DMWARN("write header failed"); } int dm_create_persistent(struct exception_store *store) int dm_create_persistent(struct dm_exception_store *store) { struct pstore *ps; Loading Loading @@ -694,17 +694,17 @@ struct transient_c { sector_t next_free; }; static void transient_destroy(struct exception_store *store) static void transient_destroy(struct dm_exception_store *store) { kfree(store->context); } static int transient_read_metadata(struct exception_store *store) static int transient_read_metadata(struct dm_exception_store *store) { return 0; } static int transient_prepare(struct exception_store *store, static int transient_prepare(struct dm_exception_store *store, struct dm_snap_exception *e) { struct transient_c *tc = (struct transient_c *) store->context; Loading @@ -719,7 +719,7 @@ static int transient_prepare(struct exception_store *store, return 0; } static void transient_commit(struct exception_store *store, static void transient_commit(struct dm_exception_store *store, struct dm_snap_exception *e, void (*callback) (void *, int success), void *callback_context) Loading @@ -728,14 +728,14 @@ static void transient_commit(struct exception_store *store, callback(callback_context, 1); } static void transient_fraction_full(struct exception_store *store, static void transient_fraction_full(struct dm_exception_store *store, sector_t *numerator, sector_t *denominator) { *numerator = ((struct transient_c *) store->context)->next_free; *denominator = get_dev_size(store->snap->cow->bdev); } int dm_create_transient(struct exception_store *store) int dm_create_transient(struct dm_exception_store *store) { struct transient_c *tc; Loading
drivers/md/dm-exception-store.h +10 −9 Original line number Diff line number Diff line Loading @@ -36,28 +36,29 @@ struct dm_snap_exception { * Abstraction to handle the meta/layout of exception stores (the * COW device). */ struct exception_store { struct dm_exception_store { /* * Destroys this object when you've finished with it. */ void (*destroy) (struct exception_store *store); void (*destroy) (struct dm_exception_store *store); /* * The target shouldn't read the COW device until this is * called. */ int (*read_metadata) (struct exception_store *store); int (*read_metadata) (struct dm_exception_store *store); /* * Find somewhere to store the next exception. */ int (*prepare_exception) (struct exception_store *store, int (*prepare_exception) (struct dm_exception_store *store, struct dm_snap_exception *e); /* * Update the metadata with this exception. */ void (*commit_exception) (struct exception_store *store, void (*commit_exception) (struct dm_exception_store *store, struct dm_snap_exception *e, void (*callback) (void *, int success), void *callback_context); Loading @@ -65,12 +66,12 @@ struct exception_store { /* * The snapshot is invalid, note this in the metadata. */ void (*drop_snapshot) (struct exception_store *store); void (*drop_snapshot) (struct dm_exception_store *store); /* * Return how full the snapshot is. */ void (*fraction_full) (struct exception_store *store, void (*fraction_full) (struct dm_exception_store *store, sector_t *numerator, sector_t *denominator); Loading Loading @@ -124,8 +125,8 @@ static inline void dm_consecutive_chunk_count_inc(struct dm_snap_exception *e) /* * Two exception store implementations. */ int dm_create_persistent(struct exception_store *store); int dm_create_persistent(struct dm_exception_store *store); int dm_create_transient(struct exception_store *store); int dm_create_transient(struct dm_exception_store *store); #endif /* _LINUX_DM_EXCEPTION_STORE */
drivers/md/dm-snap.h +1 −1 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ struct dm_snapshot { spinlock_t pe_lock; /* The on disk metadata handler */ struct exception_store store; struct dm_exception_store store; struct dm_kcopyd_client *kcopyd_client; Loading