diff options
Diffstat (limited to 'drivers/md/dm-exception-store.h')
-rw-r--r-- | drivers/md/dm-exception-store.h | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/drivers/md/dm-exception-store.h b/drivers/md/dm-exception-store.h index b5f20eba3641..b67976637538 100644 --- a/drivers/md/dm-exception-store.h +++ b/drivers/md/dm-exception-store.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (C) 2001-2002 Sistina Software (UK) Limited. * Copyright (C) 2008 Red Hat, Inc. All rights reserved. @@ -43,36 +44,36 @@ struct dm_exception_store_type { const char *name; struct module *module; - int (*ctr) (struct dm_exception_store *store, char *options); + int (*ctr)(struct dm_exception_store *store, char *options); /* * Destroys this object when you've finished with it. */ - void (*dtr) (struct dm_exception_store *store); + void (*dtr)(struct dm_exception_store *store); /* * The target shouldn't read the COW device until this is * called. As exceptions are read from the COW, they are * reported back via the callback. */ - int (*read_metadata) (struct dm_exception_store *store, - int (*callback)(void *callback_context, - chunk_t old, chunk_t new), - void *callback_context); + int (*read_metadata)(struct dm_exception_store *store, + int (*callback)(void *callback_context, + chunk_t old, chunk_t new), + void *callback_context); /* * Find somewhere to store the next exception. */ - int (*prepare_exception) (struct dm_exception_store *store, - struct dm_exception *e); + int (*prepare_exception)(struct dm_exception_store *store, + struct dm_exception *e); /* * Update the metadata with this exception. */ - void (*commit_exception) (struct dm_exception_store *store, - struct dm_exception *e, int valid, - void (*callback) (void *, int success), - void *callback_context); + void (*commit_exception)(struct dm_exception_store *store, + struct dm_exception *e, int valid, + void (*callback)(void *, int success), + void *callback_context); /* * Returns 0 if the exception store is empty. @@ -82,30 +83,30 @@ struct dm_exception_store_type { * still-to-be-merged chunk and returns the number of * consecutive previous ones. */ - int (*prepare_merge) (struct dm_exception_store *store, - chunk_t *last_old_chunk, chunk_t *last_new_chunk); + int (*prepare_merge)(struct dm_exception_store *store, + chunk_t *last_old_chunk, chunk_t *last_new_chunk); /* * Clear the last n exceptions. * nr_merged must be <= the value returned by prepare_merge. */ - int (*commit_merge) (struct dm_exception_store *store, int nr_merged); + int (*commit_merge)(struct dm_exception_store *store, int nr_merged); /* * The snapshot is invalid, note this in the metadata. */ - void (*drop_snapshot) (struct dm_exception_store *store); + void (*drop_snapshot)(struct dm_exception_store *store); - unsigned (*status) (struct dm_exception_store *store, - status_type_t status, char *result, - unsigned maxlen); + unsigned int (*status)(struct dm_exception_store *store, + status_type_t status, char *result, + unsigned int maxlen); /* * Return how full the snapshot is. */ - void (*usage) (struct dm_exception_store *store, - sector_t *total_sectors, sector_t *sectors_allocated, - sector_t *metadata_sectors); + void (*usage)(struct dm_exception_store *store, + sector_t *total_sectors, sector_t *sectors_allocated, + sector_t *metadata_sectors); /* For internal device-mapper use only. */ struct list_head list; @@ -118,9 +119,9 @@ struct dm_exception_store { struct dm_snapshot *snap; /* Size of data blocks saved - must be a power of 2 */ - unsigned chunk_size; - unsigned chunk_mask; - unsigned chunk_shift; + unsigned int chunk_size; + unsigned int chunk_mask; + unsigned int chunk_shift; void *context; @@ -144,7 +145,7 @@ static inline chunk_t dm_chunk_number(chunk_t chunk) return chunk & (chunk_t)((1ULL << DM_CHUNK_NUMBER_BITS) - 1ULL); } -static inline unsigned dm_consecutive_chunk_count(struct dm_exception *e) +static inline unsigned int dm_consecutive_chunk_count(struct dm_exception *e) { return e->new_chunk >> DM_CHUNK_NUMBER_BITS; } @@ -181,12 +182,12 @@ int dm_exception_store_type_register(struct dm_exception_store_type *type); int dm_exception_store_type_unregister(struct dm_exception_store_type *type); int dm_exception_store_set_chunk_size(struct dm_exception_store *store, - unsigned chunk_size, + unsigned int chunk_size, char **error); int dm_exception_store_create(struct dm_target *ti, int argc, char **argv, struct dm_snapshot *snap, - unsigned *args_used, + unsigned int *args_used, struct dm_exception_store **store); void dm_exception_store_destroy(struct dm_exception_store *store); |