[PATCH 1/2] fuse: optimize struct fuse_conn fields

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux