Skip to content

Commit 4b193fa

Browse files
Christoph Hellwigbrauner
authored andcommitted
lockref: remove lockref_put_not_zero
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent 4f3b63e commit 4b193fa

File tree

2 files changed

+0
-29
lines changed

2 files changed

+0
-29
lines changed

include/linux/lockref.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ struct lockref {
3737
extern void lockref_get(struct lockref *);
3838
extern int lockref_put_return(struct lockref *);
3939
extern int lockref_get_not_zero(struct lockref *);
40-
extern int lockref_put_not_zero(struct lockref *);
4140
extern int lockref_put_or_lock(struct lockref *);
4241

4342
extern void lockref_mark_dead(struct lockref *);

lib/lockref.c

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -81,34 +81,6 @@ int lockref_get_not_zero(struct lockref *lockref)
8181
}
8282
EXPORT_SYMBOL(lockref_get_not_zero);
8383

84-
/**
85-
* lockref_put_not_zero - Decrements count unless count <= 1 before decrement
86-
* @lockref: pointer to lockref structure
87-
* Return: 1 if count updated successfully or 0 if count would become zero
88-
*/
89-
int lockref_put_not_zero(struct lockref *lockref)
90-
{
91-
int retval;
92-
93-
CMPXCHG_LOOP(
94-
new.count--;
95-
if (old.count <= 1)
96-
return 0;
97-
,
98-
return 1;
99-
);
100-
101-
spin_lock(&lockref->lock);
102-
retval = 0;
103-
if (lockref->count > 1) {
104-
lockref->count--;
105-
retval = 1;
106-
}
107-
spin_unlock(&lockref->lock);
108-
return retval;
109-
}
110-
EXPORT_SYMBOL(lockref_put_not_zero);
111-
11284
/**
11385
* lockref_put_return - Decrement reference count if possible
11486
* @lockref: pointer to lockref structure

0 commit comments

Comments
 (0)