linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] fuse: optimize struct fuse_conn fields
@ 2025-04-18 21:06 Joanne Koong
  2025-04-18 21:06 ` [PATCH 2/2] fuse: clean up struct fuse_conn bitfields Joanne Koong
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Joanne Koong @ 2025-04-18 21:06 UTC (permalink / raw)
  To: miklos; +Cc: linux-fsdevel, bernd.schubert, kernel-team

Use a bitfield for tracking initialized, blocked, aborted, and io_uring
state of the fuse connection. Track connected state using a bool instead
of an unsigned.

On a 64-bit system, this shaves off 16 bytes from the size of struct
fuse_conn.

No functional changes.

Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
---
 fs/fuse/fuse_i.h | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
index b54f4f57789f..6aecada8aadd 100644
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -690,24 +690,24 @@ struct fuse_conn {
 	 * active_background, bg_queue, blocked */
 	spinlock_t bg_lock;
 
-	/** Flag indicating that INIT reply has been received. Allocating
-	 * any fuse request will be suspended until the flag is set */
-	int initialized;
-
-	/** Flag indicating if connection is blocked.  This will be
-	    the case before the INIT reply is received, and if there
-	    are too many outstading backgrounds requests */
-	int blocked;
-
 	/** waitq for blocked connection */
 	wait_queue_head_t blocked_waitq;
 
 	/** Connection established, cleared on umount, connection
 	    abort and device release */
-	unsigned connected;
+	bool connected;
+
+	/** Flag indicating that INIT reply has been received. Allocating
+	 * any fuse request will be suspended until the flag is set */
+	int initialized:1;
+
+	/** Flag indicating if connection is blocked.  This will be
+	    the case before the INIT reply is received, and if there
+	    are too many outstanding backgrounds requests */
+	int blocked:1;
 
 	/** Connection aborted via sysfs */
-	bool aborted;
+	bool aborted:1;
 
 	/** Connection failed (version mismatch).  Cannot race with
 	    setting other bitfields since it is only set once in INIT
@@ -896,7 +896,7 @@ struct fuse_conn {
 	unsigned int no_link:1;
 
 	/* Use io_uring for communication */
-	unsigned int io_uring;
+	unsigned int io_uring:1;
 
 	/** Maximum stack depth for passthrough backing files */
 	int max_stack_depth;
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-05-12 17:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-18 21:06 [PATCH 1/2] fuse: optimize struct fuse_conn fields Joanne Koong
2025-04-18 21:06 ` [PATCH 2/2] fuse: clean up struct fuse_conn bitfields Joanne Koong
2025-04-21 11:36   ` Bernd Schubert
2025-04-21 11:33 ` [PATCH 1/2] fuse: optimize struct fuse_conn fields Bernd Schubert
2025-04-22  2:07 ` Jingbo Xu
2025-04-22 16:25   ` Joanne Koong
2025-04-23  5:50     ` Jingbo Xu
2025-05-06 11:09 ` Miklos Szeredi
2025-05-12 17:36   ` Joanne Koong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).