diff mbox series

[8/9] dm vdo: Remove unused functions

Message ID 20241003011554.266654-9-linux@treblig.org (mailing list archive)
State Accepted, archived
Delegated to: Mikulas Patocka
Headers show
Series dm deadcoding | expand

Commit Message

Dr. David Alan Gilbert Oct. 3, 2024, 1:15 a.m. UTC
From: "Dr. David Alan Gilbert" <linux@treblig.org>

get_data_vio_pool_active_discards()
get_data_vio_pool_discard_limit()
get_data_vio_pool_maximum_discards()
set_data_vio_pool_discard_limit()

are all unused since commit
a9da0fb6d8c6 ("dm vdo: remove all sysfs interfaces")

Remove them.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 drivers/md/dm-vdo/data-vio.c | 29 -----------------------------
 drivers/md/dm-vdo/data-vio.h |  5 -----
 2 files changed, 34 deletions(-)

Comments

Matthew Sakai Oct. 3, 2024, 3:43 p.m. UTC | #1
On 10/2/24 9:15 PM, linux@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
> 
> get_data_vio_pool_active_discards()
> get_data_vio_pool_discard_limit()
> get_data_vio_pool_maximum_discards()
> set_data_vio_pool_discard_limit()
> 
> are all unused since commit
> a9da0fb6d8c6 ("dm vdo: remove all sysfs interfaces")
> 
> Remove them.
> 
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>

Reviewed-by: Matthew Sakai <msakai@redhat.com>

> ---
>   drivers/md/dm-vdo/data-vio.c | 29 -----------------------------
>   drivers/md/dm-vdo/data-vio.h |  5 -----
>   2 files changed, 34 deletions(-)
> 
> diff --git a/drivers/md/dm-vdo/data-vio.c b/drivers/md/dm-vdo/data-vio.c
> index 0d502f6a86ad..2b489e37538e 100644
> --- a/drivers/md/dm-vdo/data-vio.c
> +++ b/drivers/md/dm-vdo/data-vio.c
> @@ -1074,35 +1074,6 @@ void dump_data_vio_pool(struct data_vio_pool *pool, bool dump_vios)
>   	spin_unlock(&pool->lock);
>   }
>   
> -data_vio_count_t get_data_vio_pool_active_discards(struct data_vio_pool *pool)
> -{
> -	return READ_ONCE(pool->discard_limiter.busy);
> -}
> -
> -data_vio_count_t get_data_vio_pool_discard_limit(struct data_vio_pool *pool)
> -{
> -	return READ_ONCE(pool->discard_limiter.limit);
> -}
> -
> -data_vio_count_t get_data_vio_pool_maximum_discards(struct data_vio_pool *pool)
> -{
> -	return READ_ONCE(pool->discard_limiter.max_busy);
> -}
> -
> -int set_data_vio_pool_discard_limit(struct data_vio_pool *pool, data_vio_count_t limit)
> -{
> -	if (get_data_vio_pool_request_limit(pool) < limit) {
> -		// The discard limit may not be higher than the data_vio limit.
> -		return -EINVAL;
> -	}
> -
> -	spin_lock(&pool->lock);
> -	pool->discard_limiter.limit = limit;
> -	spin_unlock(&pool->lock);
> -
> -	return VDO_SUCCESS;
> -}
> -
>   data_vio_count_t get_data_vio_pool_active_requests(struct data_vio_pool *pool)
>   {
>   	return READ_ONCE(pool->limiter.busy);
> diff --git a/drivers/md/dm-vdo/data-vio.h b/drivers/md/dm-vdo/data-vio.h
> index 25926b6cd98b..067b983bb291 100644
> --- a/drivers/md/dm-vdo/data-vio.h
> +++ b/drivers/md/dm-vdo/data-vio.h
> @@ -336,11 +336,6 @@ void drain_data_vio_pool(struct data_vio_pool *pool, struct vdo_completion *comp
>   void resume_data_vio_pool(struct data_vio_pool *pool, struct vdo_completion *completion);
>   
>   void dump_data_vio_pool(struct data_vio_pool *pool, bool dump_vios);
> -data_vio_count_t get_data_vio_pool_active_discards(struct data_vio_pool *pool);
> -data_vio_count_t get_data_vio_pool_discard_limit(struct data_vio_pool *pool);
> -data_vio_count_t get_data_vio_pool_maximum_discards(struct data_vio_pool *pool);
> -int __must_check set_data_vio_pool_discard_limit(struct data_vio_pool *pool,
> -						 data_vio_count_t limit);
>   data_vio_count_t get_data_vio_pool_active_requests(struct data_vio_pool *pool);
>   data_vio_count_t get_data_vio_pool_request_limit(struct data_vio_pool *pool);
>   data_vio_count_t get_data_vio_pool_maximum_requests(struct data_vio_pool *pool);
diff mbox series

Patch

diff --git a/drivers/md/dm-vdo/data-vio.c b/drivers/md/dm-vdo/data-vio.c
index 0d502f6a86ad..2b489e37538e 100644
--- a/drivers/md/dm-vdo/data-vio.c
+++ b/drivers/md/dm-vdo/data-vio.c
@@ -1074,35 +1074,6 @@  void dump_data_vio_pool(struct data_vio_pool *pool, bool dump_vios)
 	spin_unlock(&pool->lock);
 }
 
-data_vio_count_t get_data_vio_pool_active_discards(struct data_vio_pool *pool)
-{
-	return READ_ONCE(pool->discard_limiter.busy);
-}
-
-data_vio_count_t get_data_vio_pool_discard_limit(struct data_vio_pool *pool)
-{
-	return READ_ONCE(pool->discard_limiter.limit);
-}
-
-data_vio_count_t get_data_vio_pool_maximum_discards(struct data_vio_pool *pool)
-{
-	return READ_ONCE(pool->discard_limiter.max_busy);
-}
-
-int set_data_vio_pool_discard_limit(struct data_vio_pool *pool, data_vio_count_t limit)
-{
-	if (get_data_vio_pool_request_limit(pool) < limit) {
-		// The discard limit may not be higher than the data_vio limit.
-		return -EINVAL;
-	}
-
-	spin_lock(&pool->lock);
-	pool->discard_limiter.limit = limit;
-	spin_unlock(&pool->lock);
-
-	return VDO_SUCCESS;
-}
-
 data_vio_count_t get_data_vio_pool_active_requests(struct data_vio_pool *pool)
 {
 	return READ_ONCE(pool->limiter.busy);
diff --git a/drivers/md/dm-vdo/data-vio.h b/drivers/md/dm-vdo/data-vio.h
index 25926b6cd98b..067b983bb291 100644
--- a/drivers/md/dm-vdo/data-vio.h
+++ b/drivers/md/dm-vdo/data-vio.h
@@ -336,11 +336,6 @@  void drain_data_vio_pool(struct data_vio_pool *pool, struct vdo_completion *comp
 void resume_data_vio_pool(struct data_vio_pool *pool, struct vdo_completion *completion);
 
 void dump_data_vio_pool(struct data_vio_pool *pool, bool dump_vios);
-data_vio_count_t get_data_vio_pool_active_discards(struct data_vio_pool *pool);
-data_vio_count_t get_data_vio_pool_discard_limit(struct data_vio_pool *pool);
-data_vio_count_t get_data_vio_pool_maximum_discards(struct data_vio_pool *pool);
-int __must_check set_data_vio_pool_discard_limit(struct data_vio_pool *pool,
-						 data_vio_count_t limit);
 data_vio_count_t get_data_vio_pool_active_requests(struct data_vio_pool *pool);
 data_vio_count_t get_data_vio_pool_request_limit(struct data_vio_pool *pool);
 data_vio_count_t get_data_vio_pool_maximum_requests(struct data_vio_pool *pool);