summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2025-01-30 18:04:42 +0300
committerChristian Brauner <brauner@kernel.org>2025-02-07 12:27:25 +0300
commitb06ddfeedcbe3c493215c85e43ac48dbb8769038 (patch)
tree5e25bfc902fc92efa01e566105e1c9aaa3ffc7cb /include/linux
parente52e97f09fb66fd868260d05bd6b74a9a3db39ee (diff)
parentbb504b4d64266fa0d7460c218c85afed371db03a (diff)
downloadlinux-b06ddfeedcbe3c493215c85e43ac48dbb8769038.tar.xz
Merge patch series "further lockref cleanups"
Andreas Gruenbacher <agruenba@redhat.com> says: Here's an updated version with an additional comment saying that lockref_init() initializes count to 1. * patches from https://lore.kernel.org/r/20250130135624.1899988-1-agruenba@redhat.com: lockref: remove count argument of lockref_init gfs2: switch to lockref_init(..., 1) gfs2: use lockref_init for gl_lockref Link: https://lore.kernel.org/r/20250130135624.1899988-1-agruenba@redhat.com Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/lockref.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/lockref.h b/include/linux/lockref.h
index c39f119659ba..676721ee878d 100644
--- a/include/linux/lockref.h
+++ b/include/linux/lockref.h
@@ -37,12 +37,13 @@ struct lockref {
/**
* lockref_init - Initialize a lockref
* @lockref: pointer to lockref structure
- * @count: initial count
+ *
+ * Initializes @lockref->count to 1.
*/
-static inline void lockref_init(struct lockref *lockref, unsigned int count)
+static inline void lockref_init(struct lockref *lockref)
{
spin_lock_init(&lockref->lock);
- lockref->count = count;
+ lockref->count = 1;
}
void lockref_get(struct lockref *lockref);