]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
lockref: remove lockref_put_not_zero
authorChristoph Hellwig <hch@lst.de>
Wed, 15 Jan 2025 09:46:37 +0000 (10:46 +0100)
committerChristian Brauner <brauner@kernel.org>
Thu, 16 Jan 2025 10:48:10 +0000 (11:48 +0100)
lockref_put_not_zero is not used anywhere, and unless I'm missing
something didn't end up being used used at all.  Remove it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20250115094702.504610-2-hch@lst.de
Signed-off-by: Christian Brauner <brauner@kernel.org>
include/linux/lockref.h
lib/lockref.c

index c3a1f78bc884d26282238ac6e590e6894458af25..e5aa0347f274b59ddf23f8c292cf23141877895f 100644 (file)
@@ -37,7 +37,6 @@ struct lockref {
 extern void lockref_get(struct lockref *);
 extern int lockref_put_return(struct lockref *);
 extern int lockref_get_not_zero(struct lockref *);
-extern int lockref_put_not_zero(struct lockref *);
 extern int lockref_put_or_lock(struct lockref *);
 
 extern void lockref_mark_dead(struct lockref *);
index 2afe4c5d8919102b99f2931dd51ed457a9aa89ca..a68192c979b3200763d5e3bb145fed3a96ee3c3f 100644 (file)
@@ -81,34 +81,6 @@ int lockref_get_not_zero(struct lockref *lockref)
 }
 EXPORT_SYMBOL(lockref_get_not_zero);
 
-/**
- * lockref_put_not_zero - Decrements count unless count <= 1 before decrement
- * @lockref: pointer to lockref structure
- * Return: 1 if count updated successfully or 0 if count would become zero
- */
-int lockref_put_not_zero(struct lockref *lockref)
-{
-       int retval;
-
-       CMPXCHG_LOOP(
-               new.count--;
-               if (old.count <= 1)
-                       return 0;
-       ,
-               return 1;
-       );
-
-       spin_lock(&lockref->lock);
-       retval = 0;
-       if (lockref->count > 1) {
-               lockref->count--;
-               retval = 1;
-       }
-       spin_unlock(&lockref->lock);
-       return retval;
-}
-EXPORT_SYMBOL(lockref_put_not_zero);
-
 /**
  * lockref_put_return - Decrement reference count if possible
  * @lockref: pointer to lockref structure