diff options
author | Andreas Gruenbacher <agruenba@redhat.com> | 2022-12-02 20:00:15 +0300 |
---|---|---|
committer | Andreas Gruenbacher <agruenba@redhat.com> | 2022-12-06 18:06:31 +0300 |
commit | 4ad02083a092b497f35804de03eaa62cf81fada6 (patch) | |
tree | 3bbd9abb90556a65a8b23cdca1d1946af202a4f9 /fs/gfs2/glock.c | |
parent | 70376c7ff31221f1d21db5611d8209e677781d3a (diff) | |
download | linux-4ad02083a092b497f35804de03eaa62cf81fada6.tar.xz |
gfs2: Make gfs2_glock_hold return its glock argument
This allows code like 'gl = gfs2_glock_hold(...)'.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2/glock.c')
-rw-r--r-- | fs/gfs2/glock.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index df335c258eb0..1a6c1eb7bd6b 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -186,10 +186,11 @@ void gfs2_glock_free(struct gfs2_glock *gl) * */ -void gfs2_glock_hold(struct gfs2_glock *gl) +struct gfs2_glock *gfs2_glock_hold(struct gfs2_glock *gl) { GLOCK_BUG_ON(gl, __lockref_is_dead(&gl->gl_lockref)); lockref_get(&gl->gl_lockref); + return gl; } /** @@ -1256,13 +1257,12 @@ void __gfs2_holder_init(struct gfs2_glock *gl, unsigned int state, u16 flags, struct gfs2_holder *gh, unsigned long ip) { INIT_LIST_HEAD(&gh->gh_list); - gh->gh_gl = gl; + gh->gh_gl = gfs2_glock_hold(gl); gh->gh_ip = ip; gh->gh_owner_pid = get_pid(task_pid(current)); gh->gh_state = state; gh->gh_flags = flags; gh->gh_iflags = 0; - gfs2_glock_hold(gl); } /** |