Skip to content

Commit 314ee70

Browse files
MaxKellermannbrauner
authored andcommitted
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 <[email protected]> Signed-off-by: David Howells <[email protected]> Link: https://lore.kernel.org/[email protected] cc: Paulo Alcantara <[email protected]> cc: [email protected] cc: [email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent d46a7b2 commit 314ee70

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

include/linux/netfs.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ struct netfs_io_stream {
144144
struct netfs_io_subrequest *front; /* Op being collected */
145145
unsigned long long collected_to; /* Position we've collected results to */
146146
size_t transferred; /* The amount transferred from this stream */
147-
enum netfs_io_source source; /* Where to read from/write to */
148147
unsigned short error; /* Aggregate error for the stream */
148+
enum netfs_io_source source; /* Where to read from/write to */
149149
unsigned char stream_nr; /* Index of stream in parent table */
150150
bool avail; /* T if stream is available */
151151
bool active; /* T if stream is active */
@@ -240,27 +240,27 @@ struct netfs_io_request {
240240
void *netfs_priv; /* Private data for the netfs */
241241
void *netfs_priv2; /* Private data for the netfs */
242242
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 */
250243
unsigned long long submitted; /* Amount submitted for I/O so far */
251244
unsigned long long len; /* Length of the request */
252245
size_t transferred; /* Amount to be indicated as transferred */
253246
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 */
256247
unsigned long long i_size; /* Size of the file */
257248
unsigned long long start; /* Start position */
258249
atomic64_t issued_to; /* Write issuer folio cursor */
259250
unsigned long long collected_to; /* Point we've collected to */
260251
unsigned long long cleaned_to; /* Position we've cleaned folios to */
261252
unsigned long long abandon_to; /* Position to abandon folios to */
262253
pgoff_t no_unlock_folio; /* Don't unlock this folio after read */
254+
unsigned int direct_bv_count; /* Number of elements in direct_bv[] */
255+
unsigned int debug_id;
256+
unsigned int rsize; /* Maximum read size (0 for none) */
257+
unsigned int wsize; /* Maximum write size (0 for none) */
258+
atomic_t subreq_counter; /* Next subreq->debug_index */
259+
unsigned int nr_group_rel; /* Number of refs to release on ->group */
260+
spinlock_t lock; /* Lock for queuing subreqs */
263261
unsigned char front_folio_order; /* Order (size) of front folio */
262+
enum netfs_io_origin origin; /* Origin of the request */
263+
bool direct_bv_unpin; /* T if direct_bv[] must be unpinned */
264264
refcount_t ref;
265265
unsigned long flags;
266266
#define NETFS_RREQ_OFFLOAD_COLLECTION 0 /* Offload collection to workqueue */

0 commit comments

Comments
 (0)