[PATCH v2 15/18] fs/ceph/super: move `ceph_cap.caps_item` into the union

Max Kellermann <[email protected]>
Newsgroups org.kernel.vger.ceph-devel,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
The `caps_item` field is only used if the `ceph_cap` object is
"reserved", i.e. when it is in the `ceph_mds_client.caps_list` list
(but is otherwise uninitialized).

This reduces the size of the struct by 16 bytes.

Signed-off-by: Max Kellermann <[email protected]>
---
 fs/ceph/super.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/fs/ceph/super.h b/fs/ceph/super.h
index abe403eff0bb..afe681a47f71 100644
--- a/fs/ceph/super.h
+++ b/fs/ceph/super.h
@@ -208,6 +208,14 @@ struct ceph_cap {
 	struct list_head session_caps;   /* per-session caplist */
 	u64 cap_id;       /* unique cap id (mds provided) */
 	union {
+		/* reserved caps */
+		struct {
+			/**
+			 * For the `ceph_mds_client.caps_list` list.
+			 * Protected by `caps_list_lock`.
+			 */
+			struct list_head caps_item;
+		};
 		/* in-use caps */
 		struct {
 			int issued;       /* latest, from the mds */
@@ -224,7 +232,6 @@ struct ceph_cap {
 	};
 	u32 seq, issue_seq, mseq;
 	u32 cap_gen;      /* active/stale cycle */
-	struct list_head caps_item;
 };
 
 #define CHECK_CAPS_AUTHONLY     1  /* only check auth cap */
-- 
2.47.3
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.