diff mbox series

[2/8] lockref: improve the lockref_get_not_zero description

Message ID 20250115094702.504610-3-hch@lst.de (mailing list archive)
State New
Headers show
Series [1/8] lockref: remove lockref_put_not_zero | expand

Commit Message

Christoph Hellwig Jan. 15, 2025, 9:46 a.m. UTC
lockref_put_return returns exactly -1 and not "an error" when the lockref
is dead or locked.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 lib/lockref.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andreas Gruenbacher Jan. 15, 2025, 1:28 p.m. UTC | #1
On Wed, Jan 15, 2025 at 10:56 AM Christoph Hellwig <hch@lst.de> wrote:
> lockref_put_return returns exactly -1 and not "an error" when the lockref
> is dead or locked.

The function name in the subject needs fixing.

> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  lib/lockref.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/lockref.c b/lib/lockref.c
> index a68192c979b3..b1b042a9a6c8 100644
> --- a/lib/lockref.c
> +++ b/lib/lockref.c
> @@ -86,7 +86,7 @@ EXPORT_SYMBOL(lockref_get_not_zero);
>   * @lockref: pointer to lockref structure
>   *
>   * Decrement the reference count and return the new value.
> - * If the lockref was dead or locked, return an error.
> + * If the lockref was dead or locked, return -1.
>   */
>  int lockref_put_return(struct lockref *lockref)
>  {
> --
> 2.45.2

Thanks,
Andreas
diff mbox series

Patch

diff --git a/lib/lockref.c b/lib/lockref.c
index a68192c979b3..b1b042a9a6c8 100644
--- a/lib/lockref.c
+++ b/lib/lockref.c
@@ -86,7 +86,7 @@  EXPORT_SYMBOL(lockref_get_not_zero);
  * @lockref: pointer to lockref structure
  *
  * Decrement the reference count and return the new value.
- * If the lockref was dead or locked, return an error.
+ * If the lockref was dead or locked, return -1.
  */
 int lockref_put_return(struct lockref *lockref)
 {