Message ID | 20241003011554.266654-10-linux@treblig.org (mailing list archive) |
---|---|
State | Accepted, archived |
Delegated to: | Mikulas Patocka |
Headers | show |
Series | dm deadcoding | expand |
On 10/2/24 9:15 PM, linux@treblig.org wrote: > From: "Dr. David Alan Gilbert" <linux@treblig.org> > > uds_compute_index_size() has been unused since it was added in > commit b46d79bdb82a ("dm vdo: add deduplication index storage interface") > > Remove it. > > Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org> Reviewed-by: Matthew Sakai <msakai@redhat.com> > --- > drivers/md/dm-vdo/indexer/index-layout.c | 26 ------------------------ > drivers/md/dm-vdo/indexer/indexer.h | 4 ---- > 2 files changed, 30 deletions(-) > > diff --git a/drivers/md/dm-vdo/indexer/index-layout.c b/drivers/md/dm-vdo/indexer/index-layout.c > index 627adc24af3b..af8fab83b0f3 100644 > --- a/drivers/md/dm-vdo/indexer/index-layout.c > +++ b/drivers/md/dm-vdo/indexer/index-layout.c > @@ -248,32 +248,6 @@ static int __must_check compute_sizes(const struct uds_configuration *config, > return UDS_SUCCESS; > } > > -int uds_compute_index_size(const struct uds_parameters *parameters, u64 *index_size) > -{ > - int result; > - struct uds_configuration *index_config; > - struct save_layout_sizes sizes; > - > - if (index_size == NULL) { > - vdo_log_error("Missing output size pointer"); > - return -EINVAL; > - } > - > - result = uds_make_configuration(parameters, &index_config); > - if (result != UDS_SUCCESS) { > - vdo_log_error_strerror(result, "cannot compute index size"); > - return uds_status_to_errno(result); > - } > - > - result = compute_sizes(index_config, &sizes); > - uds_free_configuration(index_config); > - if (result != UDS_SUCCESS) > - return uds_status_to_errno(result); > - > - *index_size = sizes.total_size; > - return UDS_SUCCESS; > -} > - > /* Create unique data using the current time and a pseudorandom number. */ > static void create_unique_nonce_data(u8 *buffer) > { > diff --git a/drivers/md/dm-vdo/indexer/indexer.h b/drivers/md/dm-vdo/indexer/indexer.h > index 3744aaf625b0..183a94eb7e92 100644 > --- a/drivers/md/dm-vdo/indexer/indexer.h > +++ b/drivers/md/dm-vdo/indexer/indexer.h > @@ -283,10 +283,6 @@ struct uds_request { > enum uds_index_region location; > }; > > -/* Compute the number of bytes needed to store an index. */ > -int __must_check uds_compute_index_size(const struct uds_parameters *parameters, > - u64 *index_size); > - > /* A session is required for most index operations. */ > int __must_check uds_create_index_session(struct uds_index_session **session); >
diff --git a/drivers/md/dm-vdo/indexer/index-layout.c b/drivers/md/dm-vdo/indexer/index-layout.c index 627adc24af3b..af8fab83b0f3 100644 --- a/drivers/md/dm-vdo/indexer/index-layout.c +++ b/drivers/md/dm-vdo/indexer/index-layout.c @@ -248,32 +248,6 @@ static int __must_check compute_sizes(const struct uds_configuration *config, return UDS_SUCCESS; } -int uds_compute_index_size(const struct uds_parameters *parameters, u64 *index_size) -{ - int result; - struct uds_configuration *index_config; - struct save_layout_sizes sizes; - - if (index_size == NULL) { - vdo_log_error("Missing output size pointer"); - return -EINVAL; - } - - result = uds_make_configuration(parameters, &index_config); - if (result != UDS_SUCCESS) { - vdo_log_error_strerror(result, "cannot compute index size"); - return uds_status_to_errno(result); - } - - result = compute_sizes(index_config, &sizes); - uds_free_configuration(index_config); - if (result != UDS_SUCCESS) - return uds_status_to_errno(result); - - *index_size = sizes.total_size; - return UDS_SUCCESS; -} - /* Create unique data using the current time and a pseudorandom number. */ static void create_unique_nonce_data(u8 *buffer) { diff --git a/drivers/md/dm-vdo/indexer/indexer.h b/drivers/md/dm-vdo/indexer/indexer.h index 3744aaf625b0..183a94eb7e92 100644 --- a/drivers/md/dm-vdo/indexer/indexer.h +++ b/drivers/md/dm-vdo/indexer/indexer.h @@ -283,10 +283,6 @@ struct uds_request { enum uds_index_region location; }; -/* Compute the number of bytes needed to store an index. */ -int __must_check uds_compute_index_size(const struct uds_parameters *parameters, - u64 *index_size); - /* A session is required for most index operations. */ int __must_check uds_create_index_session(struct uds_index_session **session);