Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fs/netfs: reorder struct fields to eliminate holes

This shrinks `struct netfs_io_stream` from 104 to 96 bytes and `struct
netfs_io_request` from 600 to 576 bytes.

[DH: Modified as the patch to turn netfs_io_request::error into a short
was removed from the set]

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://lore.kernel.org/20250519134813.2975312-7-dhowells@redhat.com
cc: Paulo Alcantara <pc@manguebit.com>
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Max Kellermann and committed by
Christian Brauner
314ee703 d46a7b21

+10 -10
+10 -10
include/linux/netfs.h
··· 144 144 struct netfs_io_subrequest *front; /* Op being collected */ 145 145 unsigned long long collected_to; /* Position we've collected results to */ 146 146 size_t transferred; /* The amount transferred from this stream */ 147 - enum netfs_io_source source; /* Where to read from/write to */ 148 147 unsigned short error; /* Aggregate error for the stream */ 148 + enum netfs_io_source source; /* Where to read from/write to */ 149 149 unsigned char stream_nr; /* Index of stream in parent table */ 150 150 bool avail; /* T if stream is available */ 151 151 bool active; /* T if stream is active */ ··· 240 240 void *netfs_priv; /* Private data for the netfs */ 241 241 void *netfs_priv2; /* Private data for the netfs */ 242 242 struct bio_vec *direct_bv; /* DIO buffer list (when handling iovec-iter) */ 243 - unsigned int direct_bv_count; /* Number of elements in direct_bv[] */ 244 - unsigned int debug_id; 245 - unsigned int rsize; /* Maximum read size (0 for none) */ 246 - unsigned int wsize; /* Maximum write size (0 for none) */ 247 - atomic_t subreq_counter; /* Next subreq->debug_index */ 248 - unsigned int nr_group_rel; /* Number of refs to release on ->group */ 249 - spinlock_t lock; /* Lock for queuing subreqs */ 250 243 unsigned long long submitted; /* Amount submitted for I/O so far */ 251 244 unsigned long long len; /* Length of the request */ 252 245 size_t transferred; /* Amount to be indicated as transferred */ 253 246 long error; /* 0 or error that occurred */ 254 - enum netfs_io_origin origin; /* Origin of the request */ 255 - bool direct_bv_unpin; /* T if direct_bv[] must be unpinned */ 256 247 unsigned long long i_size; /* Size of the file */ 257 248 unsigned long long start; /* Start position */ 258 249 atomic64_t issued_to; /* Write issuer folio cursor */ ··· 251 260 unsigned long long cleaned_to; /* Position we've cleaned folios to */ 252 261 unsigned long long abandon_to; /* Position to abandon folios to */ 253 262 pgoff_t no_unlock_folio; /* Don't unlock this folio after read */ 263 + unsigned int direct_bv_count; /* Number of elements in direct_bv[] */ 264 + unsigned int debug_id; 265 + unsigned int rsize; /* Maximum read size (0 for none) */ 266 + unsigned int wsize; /* Maximum write size (0 for none) */ 267 + atomic_t subreq_counter; /* Next subreq->debug_index */ 268 + unsigned int nr_group_rel; /* Number of refs to release on ->group */ 269 + spinlock_t lock; /* Lock for queuing subreqs */ 254 270 unsigned char front_folio_order; /* Order (size) of front folio */ 271 + enum netfs_io_origin origin; /* Origin of the request */ 272 + bool direct_bv_unpin; /* T if direct_bv[] must be unpinned */ 255 273 refcount_t ref; 256 274 unsigned long flags; 257 275 #define NETFS_RREQ_OFFLOAD_COLLECTION 0 /* Offload collection to workqueue */