Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2defcc3f authored by Mikulas Patocka's avatar Mikulas Patocka Committed by Alasdair G Kergon
Browse files

dm exception store: split set_chunk_size



Break the function set_chunk_size to two functions in preparation for
the fix in the following patch.

Cc: stable@kernel.org
Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
parent 61578dcd
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -171,6 +171,14 @@ static int set_chunk_size(struct dm_exception_store *store,
	 */
	 */
	chunk_size_ulong = round_up(chunk_size_ulong, PAGE_SIZE >> 9);
	chunk_size_ulong = round_up(chunk_size_ulong, PAGE_SIZE >> 9);


	return dm_exception_store_set_chunk_size(store, chunk_size_ulong,
						 error);
}

int dm_exception_store_set_chunk_size(struct dm_exception_store *store,
				      unsigned long chunk_size_ulong,
				      char **error)
{
	/* Check chunk_size is a power of 2 */
	/* Check chunk_size is a power of 2 */
	if (!is_power_of_2(chunk_size_ulong)) {
	if (!is_power_of_2(chunk_size_ulong)) {
		*error = "Chunk size is not a power of 2";
		*error = "Chunk size is not a power of 2";
+4 −0
Original line number Original line Diff line number Diff line
@@ -168,6 +168,10 @@ static inline chunk_t sector_to_chunk(struct dm_exception_store *store,
int dm_exception_store_type_register(struct dm_exception_store_type *type);
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_type_unregister(struct dm_exception_store_type *type);


int dm_exception_store_set_chunk_size(struct dm_exception_store *store,
				      unsigned long chunk_size_ulong,
				      char **error);

int dm_exception_store_create(struct dm_target *ti, int argc, char **argv,
int dm_exception_store_create(struct dm_target *ti, int argc, char **argv,
			      unsigned *args_used,
			      unsigned *args_used,
			      struct dm_exception_store **store);
			      struct dm_exception_store **store);