Skip to content

Commit 3895af5

Browse files
committed
dm vdo: internalize UDS index size computation
David Alan Gilbert, upstream, wants to remove this function because it is not currently used in the kernel. However, UDS unit tests use it, as well as our userspace tools, so instead we will hide it from the kernel. Cf. 29e11586b56a ("dm vdo: Remove unused uds_compute_index_size") Note that this function will be needed by the vdoformat-in-kernel story, but in order to make upstreaming that story easier, we should incorporate this removal now. Signed-off-by: Matthew Sakai <[email protected]>
1 parent d2d0b77 commit 3895af5

File tree

2 files changed

+0
-30
lines changed

2 files changed

+0
-30
lines changed

drivers/md/dm-vdo/indexer/index-layout.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -248,32 +248,6 @@ static int __must_check compute_sizes(const struct uds_configuration *config,
248248
return UDS_SUCCESS;
249249
}
250250

251-
int uds_compute_index_size(const struct uds_parameters *parameters, u64 *index_size)
252-
{
253-
int result;
254-
struct uds_configuration *index_config;
255-
struct save_layout_sizes sizes;
256-
257-
if (index_size == NULL) {
258-
vdo_log_error("Missing output size pointer");
259-
return -EINVAL;
260-
}
261-
262-
result = uds_make_configuration(parameters, &index_config);
263-
if (result != UDS_SUCCESS) {
264-
vdo_log_error_strerror(result, "cannot compute index size");
265-
return uds_status_to_errno(result);
266-
}
267-
268-
result = compute_sizes(index_config, &sizes);
269-
uds_free_configuration(index_config);
270-
if (result != UDS_SUCCESS)
271-
return uds_status_to_errno(result);
272-
273-
*index_size = sizes.total_size;
274-
return UDS_SUCCESS;
275-
}
276-
277251
/* Create unique data using the current time and a pseudorandom number. */
278252
static void create_unique_nonce_data(u8 *buffer)
279253
{

drivers/md/dm-vdo/indexer/indexer.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,6 @@ struct uds_request {
283283
enum uds_index_region location;
284284
};
285285

286-
/* Compute the number of bytes needed to store an index. */
287-
int __must_check uds_compute_index_size(const struct uds_parameters *parameters,
288-
u64 *index_size);
289-
290286
/* A session is required for most index operations. */
291287
int __must_check uds_create_index_session(struct uds_index_session **session);
292288

0 commit comments

Comments
 (0)