Skip to content

Commit

Permalink
dm snapshot: allow chunk size to be less than page size
Browse files Browse the repository at this point in the history
Allow the snapshot chunk size to be smaller than the page size
The code is now capable of handling this due to some previous
fixes and enhancements.

As the page size varies between computers, prior to this patch,
the chunk size of a snapshot dictated which machines could read it:
Snapshots created on one machine might not be readable on another.

Signed-off-by: Mikulas Patocka <[email protected]>
Reviewed-by: Mike Snitzer <[email protected]>
Reviewed-by: Jonathan Brassow <[email protected]>
Signed-off-by: Alasdair G Kergon <[email protected]>
  • Loading branch information
Mikulas Patocka authored and kergon committed Oct 16, 2009
1 parent df96eee commit c1cc65c
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions drivers/md/dm-exception-store.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,6 @@ int dm_exception_store_type_unregister(struct dm_exception_store_type *type)
}
EXPORT_SYMBOL(dm_exception_store_type_unregister);

/*
* Round a number up to the nearest 'size' boundary. size must
* be a power of 2.
*/
static ulong round_up(ulong n, ulong size)
{
size--;
return (n + size) & ~size;
}

static int set_chunk_size(struct dm_exception_store *store,
const char *chunk_size_arg, char **error)
{
Expand All @@ -166,12 +156,6 @@ static int set_chunk_size(struct dm_exception_store *store,
return 0;
}

/*
* Chunk size must be multiple of page size. Silently
* round up if it's not.
*/
chunk_size_ulong = round_up(chunk_size_ulong, PAGE_SIZE >> 9);

return dm_exception_store_set_chunk_size(store,
(unsigned) chunk_size_ulong,
error);
Expand Down

0 comments on commit c1cc65c

Please sign in to comment.