[PATCH 2/6] jbd2: remove unused return value of jbd2_journal_cancel_revoke

Kemeng Shi posted 6 patches 1 year, 1 month ago
There is a newer version of this series
[PATCH 2/6] jbd2: remove unused return value of jbd2_journal_cancel_revoke
Posted by Kemeng Shi 1 year, 1 month ago
Remove unused return value of jbd2_journal_cancel_revoke.

Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
---
 fs/jbd2/revoke.c     | 5 +----
 include/linux/jbd2.h | 2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/fs/jbd2/revoke.c b/fs/jbd2/revoke.c
index 4556e4689024..af0208ed3619 100644
--- a/fs/jbd2/revoke.c
+++ b/fs/jbd2/revoke.c
@@ -420,12 +420,11 @@ int jbd2_journal_revoke(handle_t *handle, unsigned long long blocknr,
  * do not trust the Revoked bit on buffers unless RevokeValid is also
  * set.
  */
-int jbd2_journal_cancel_revoke(handle_t *handle, struct journal_head *jh)
+void jbd2_journal_cancel_revoke(handle_t *handle, struct journal_head *jh)
 {
 	struct jbd2_revoke_record_s *record;
 	journal_t *journal = handle->h_transaction->t_journal;
 	int need_cancel;
-	int did_revoke = 0;	/* akpm: debug */
 	struct buffer_head *bh = jh2bh(jh);
 
 	jbd2_debug(4, "journal_head %p, cancelling revoke\n", jh);
@@ -450,7 +449,6 @@ int jbd2_journal_cancel_revoke(handle_t *handle, struct journal_head *jh)
 			list_del(&record->hash);
 			spin_unlock(&journal->j_revoke_lock);
 			kmem_cache_free(jbd2_revoke_record_cache, record);
-			did_revoke = 1;
 		}
 	}
 
@@ -473,7 +471,6 @@ int jbd2_journal_cancel_revoke(handle_t *handle, struct journal_head *jh)
 			__brelse(bh2);
 		}
 	}
-	return did_revoke;
 }
 
 /*
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index c7fdb2b1b9a6..e2d1426d3e06 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -1635,7 +1635,7 @@ extern int __init jbd2_journal_init_revoke_table_cache(void);
 
 extern void	   jbd2_journal_destroy_revoke(journal_t *);
 extern int	   jbd2_journal_revoke (handle_t *, unsigned long long, struct buffer_head *);
-extern int	   jbd2_journal_cancel_revoke(handle_t *, struct journal_head *);
+extern void	   jbd2_journal_cancel_revoke(handle_t *, struct journal_head *);
 extern void	   jbd2_journal_write_revoke_records(transaction_t *transaction,
 						     struct list_head *log_bufs);
 
-- 
2.30.0
Re: [PATCH 2/6] jbd2: remove unused return value of jbd2_journal_cancel_revoke
Posted by Zhang Yi 1 year, 1 month ago
On 2024/12/25 4:27, Kemeng Shi wrote:
> Remove unused return value of jbd2_journal_cancel_revoke.
> 
> Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>

Looks good to me.

Reviewed-by: Zhang Yi <yi.zhang@huawei.com>

> ---
>  fs/jbd2/revoke.c     | 5 +----
>  include/linux/jbd2.h | 2 +-
>  2 files changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/jbd2/revoke.c b/fs/jbd2/revoke.c
> index 4556e4689024..af0208ed3619 100644
> --- a/fs/jbd2/revoke.c
> +++ b/fs/jbd2/revoke.c
> @@ -420,12 +420,11 @@ int jbd2_journal_revoke(handle_t *handle, unsigned long long blocknr,
>   * do not trust the Revoked bit on buffers unless RevokeValid is also
>   * set.
>   */
> -int jbd2_journal_cancel_revoke(handle_t *handle, struct journal_head *jh)
> +void jbd2_journal_cancel_revoke(handle_t *handle, struct journal_head *jh)
>  {
>  	struct jbd2_revoke_record_s *record;
>  	journal_t *journal = handle->h_transaction->t_journal;
>  	int need_cancel;
> -	int did_revoke = 0;	/* akpm: debug */
>  	struct buffer_head *bh = jh2bh(jh);
>  
>  	jbd2_debug(4, "journal_head %p, cancelling revoke\n", jh);
> @@ -450,7 +449,6 @@ int jbd2_journal_cancel_revoke(handle_t *handle, struct journal_head *jh)
>  			list_del(&record->hash);
>  			spin_unlock(&journal->j_revoke_lock);
>  			kmem_cache_free(jbd2_revoke_record_cache, record);
> -			did_revoke = 1;
>  		}
>  	}
>  
> @@ -473,7 +471,6 @@ int jbd2_journal_cancel_revoke(handle_t *handle, struct journal_head *jh)
>  			__brelse(bh2);
>  		}
>  	}
> -	return did_revoke;
>  }
>  
>  /*
> diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
> index c7fdb2b1b9a6..e2d1426d3e06 100644
> --- a/include/linux/jbd2.h
> +++ b/include/linux/jbd2.h
> @@ -1635,7 +1635,7 @@ extern int __init jbd2_journal_init_revoke_table_cache(void);
>  
>  extern void	   jbd2_journal_destroy_revoke(journal_t *);
>  extern int	   jbd2_journal_revoke (handle_t *, unsigned long long, struct buffer_head *);
> -extern int	   jbd2_journal_cancel_revoke(handle_t *, struct journal_head *);
> +extern void	   jbd2_journal_cancel_revoke(handle_t *, struct journal_head *);
>  extern void	   jbd2_journal_write_revoke_records(transaction_t *transaction,
>  						     struct list_head *log_bufs);
>
Re: [PATCH 2/6] jbd2: remove unused return value of jbd2_journal_cancel_revoke
Posted by Jan Kara 1 year, 1 month ago
On Wed 25-12-24 04:27:03, Kemeng Shi wrote:
> Remove unused return value of jbd2_journal_cancel_revoke.
> 
> Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>

Yeah, nobody used it for years. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/jbd2/revoke.c     | 5 +----
>  include/linux/jbd2.h | 2 +-
>  2 files changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/jbd2/revoke.c b/fs/jbd2/revoke.c
> index 4556e4689024..af0208ed3619 100644
> --- a/fs/jbd2/revoke.c
> +++ b/fs/jbd2/revoke.c
> @@ -420,12 +420,11 @@ int jbd2_journal_revoke(handle_t *handle, unsigned long long blocknr,
>   * do not trust the Revoked bit on buffers unless RevokeValid is also
>   * set.
>   */
> -int jbd2_journal_cancel_revoke(handle_t *handle, struct journal_head *jh)
> +void jbd2_journal_cancel_revoke(handle_t *handle, struct journal_head *jh)
>  {
>  	struct jbd2_revoke_record_s *record;
>  	journal_t *journal = handle->h_transaction->t_journal;
>  	int need_cancel;
> -	int did_revoke = 0;	/* akpm: debug */
>  	struct buffer_head *bh = jh2bh(jh);
>  
>  	jbd2_debug(4, "journal_head %p, cancelling revoke\n", jh);
> @@ -450,7 +449,6 @@ int jbd2_journal_cancel_revoke(handle_t *handle, struct journal_head *jh)
>  			list_del(&record->hash);
>  			spin_unlock(&journal->j_revoke_lock);
>  			kmem_cache_free(jbd2_revoke_record_cache, record);
> -			did_revoke = 1;
>  		}
>  	}
>  
> @@ -473,7 +471,6 @@ int jbd2_journal_cancel_revoke(handle_t *handle, struct journal_head *jh)
>  			__brelse(bh2);
>  		}
>  	}
> -	return did_revoke;
>  }
>  
>  /*
> diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
> index c7fdb2b1b9a6..e2d1426d3e06 100644
> --- a/include/linux/jbd2.h
> +++ b/include/linux/jbd2.h
> @@ -1635,7 +1635,7 @@ extern int __init jbd2_journal_init_revoke_table_cache(void);
>  
>  extern void	   jbd2_journal_destroy_revoke(journal_t *);
>  extern int	   jbd2_journal_revoke (handle_t *, unsigned long long, struct buffer_head *);
> -extern int	   jbd2_journal_cancel_revoke(handle_t *, struct journal_head *);
> +extern void	   jbd2_journal_cancel_revoke(handle_t *, struct journal_head *);
>  extern void	   jbd2_journal_write_revoke_records(transaction_t *transaction,
>  						     struct list_head *log_bufs);
>  
> -- 
> 2.30.0
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR