From: Alexander Aring <aahringo@redhat.com>
To: teigland@redhat.com
Cc: aahringo@redhat.com, gfs2@lists.linux.dev
Subject: [PATCH vv6.19-rc6 4/7] dlm: Constify struct configfs_item_operations and configfs_group_operations
Date: Tue, 20 Jan 2026 10:35:08 -0500 [thread overview]
Message-ID: <20260120153511.2201392-4-aahringo@redhat.com> (raw)
In-Reply-To: <20260120153511.2201392-1-aahringo@redhat.com>
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
'struct configfs_item_operations' and 'configfs_group_operations' are not
modified in this driver.
Constifying these structures moves some data to a read-only section, so
increases overall security, especially when the structure holds some
function pointers.
On a x86_64, with allmodconfig, as an example:
Before:
======
text data bss dec hex filename
29436 12952 384 42772 a714 fs/dlm/config.o
After:
=====
text data bss dec hex filename
30076 12312 384 42772 a714 fs/dlm/config.o
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Alexander Aring <aahringo@redhat.com>
---
fs/dlm/config.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/fs/dlm/config.c b/fs/dlm/config.c
index a0d75b5c83c63..82cc3215663f6 100644
--- a/fs/dlm/config.c
+++ b/fs/dlm/config.c
@@ -324,39 +324,39 @@ struct dlm_member_gone {
struct list_head list; /* space->members_gone */
};
-static struct configfs_group_operations clusters_ops = {
+static const struct configfs_group_operations clusters_ops = {
.make_group = make_cluster,
.drop_item = drop_cluster,
};
-static struct configfs_item_operations cluster_ops = {
+static const struct configfs_item_operations cluster_ops = {
.release = release_cluster,
};
-static struct configfs_group_operations spaces_ops = {
+static const struct configfs_group_operations spaces_ops = {
.make_group = make_space,
.drop_item = drop_space,
};
-static struct configfs_item_operations space_ops = {
+static const struct configfs_item_operations space_ops = {
.release = release_space,
};
-static struct configfs_group_operations comms_ops = {
+static const struct configfs_group_operations comms_ops = {
.make_item = make_comm,
.drop_item = drop_comm,
};
-static struct configfs_item_operations comm_ops = {
+static const struct configfs_item_operations comm_ops = {
.release = release_comm,
};
-static struct configfs_group_operations nodes_ops = {
+static const struct configfs_group_operations nodes_ops = {
.make_item = make_node,
.drop_item = drop_node,
};
-static struct configfs_item_operations node_ops = {
+static const struct configfs_item_operations node_ops = {
.release = release_node,
};
--
2.43.0
next prev parent reply other threads:[~2026-01-20 15:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-20 15:35 [PATCH vv6.19-rc6 1/7] dlm: fix recovery pending middle conversion Alexander Aring
2026-01-20 15:35 ` [PATCH vv6.19-rc6 2/7] dlm: validate length in dlm_search_rsb_tree Alexander Aring
2026-01-20 15:35 ` [PATCH vv6.19-rc6 3/7] fs/dlm: use list_add_tail() instead of open-coding list insertion Alexander Aring
2026-01-20 15:35 ` Alexander Aring [this message]
2026-01-20 15:35 ` [PATCH vv6.19-rc6 5/7] fs/dlm/dir: remove unuse variable count_match Alexander Aring
2026-01-20 15:35 ` [PATCH vv6.19-rc6 6/7] dlm: use bool for coniditonal expressions Alexander Aring
2026-01-20 15:35 ` [PATCH vv6.19-rc6 7/7] dlm: use coniditon expression instead return scalars Alexander Aring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260120153511.2201392-4-aahringo@redhat.com \
--to=aahringo@redhat.com \
--cc=gfs2@lists.linux.dev \
--cc=teigland@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox