]> git.ipfire.org Git - thirdparty/linux.git/commit
gfs2: Introduce glock_{type,number,sbd} helpers
authorAndreas Gruenbacher <agruenba@redhat.com>
Fri, 23 Jan 2026 13:45:46 +0000 (14:45 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Mon, 26 Jan 2026 13:28:18 +0000 (14:28 +0100)
commit0ec49e7ea6e02e7ff146e031b0fe2243c2bad43a
tree5fa52c159e0673fdb5b70291f10e5c5e9a55a394
parentd3b39fcb39574780fffec4357412ce0460339e9f
gfs2: Introduce glock_{type,number,sbd} helpers

Introduce glock_type(), glock_number(), and glock_sbd() helpers for
accessing a glock's type, number, and super block pointer more easily.

Created with Coccinelle using the following semantic patch:

@@ struct gfs2_glock *gl; @@
- gl->gl_name.ln_type
+ glock_type(gl)

@@ struct gfs2_glock *gl; @@
- gl->gl_name.ln_number
+ glock_number(gl)

@@ struct gfs2_glock *gl; @@
- gl->gl_name.ln_sbd
+ glock_sbd(gl)

glock_sbd() is a macro because it is used with const as well as
non-const struct gfs2_glock * arguments.

Instances in macro definitions, particularly in tracepoint definitions,
replaced by hand.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
12 files changed:
fs/gfs2/glock.c
fs/gfs2/glock.h
fs/gfs2/glops.c
fs/gfs2/incore.h
fs/gfs2/lock_dlm.c
fs/gfs2/lops.c
fs/gfs2/meta_io.c
fs/gfs2/meta_io.h
fs/gfs2/quota.c
fs/gfs2/rgrp.c
fs/gfs2/trace_gfs2.h
fs/gfs2/trans.c