From: Max Kellermann <max.kellermann@ionos.com>
To: dhowells@redhat.com, netfs@lists.linux.dev, linux-kernel@vger.kernel.org
Cc: Max Kellermann <max.kellermann@ionos.com>
Subject: [PATCH 1/4] fs/netfs: convert `netfs_io_request.error` to a `short
Date: Mon, 28 Apr 2025 17:48:56 +0200 [thread overview]
Message-ID: <20250428154859.3228933-1-max.kellermann@ionos.com> (raw)
The `error` field only needs to be able to hold an errno integer, and
a `short` is enough for that - just like in `struct
netfs_io_subrequest`.
This shrinks the struct from 608 to 600 bytes.
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
---
fs/netfs/main.c | 2 +-
fs/netfs/write_collect.c | 2 +-
include/linux/netfs.h | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/netfs/main.c b/fs/netfs/main.c
index 70ecc8f5f210..fbb605ee0b28 100644
--- a/fs/netfs/main.c
+++ b/fs/netfs/main.c
@@ -65,7 +65,7 @@ static int netfs_requests_seq_show(struct seq_file *m, void *v)
rreq = list_entry(v, struct netfs_io_request, proc_link);
seq_printf(m,
- "%08x %s %3d %2lx %4ld %3d @%04llx %llx/%llx",
+ "%08x %s %3d %2lx %4d %3d @%04llx %llx/%llx",
rreq->debug_id,
netfs_origins[rreq->origin],
refcount_read(&rreq->ref),
diff --git a/fs/netfs/write_collect.c b/fs/netfs/write_collect.c
index 3fca59e6475d..b405229de787 100644
--- a/fs/netfs/write_collect.c
+++ b/fs/netfs/write_collect.c
@@ -23,7 +23,7 @@
static void netfs_dump_request(const struct netfs_io_request *rreq)
{
- pr_err("Request R=%08x r=%d fl=%lx or=%x e=%ld\n",
+ pr_err("Request R=%08x r=%d fl=%lx or=%x e=%d\n",
rreq->debug_id, refcount_read(&rreq->ref), rreq->flags,
rreq->origin, rreq->error);
pr_err(" st=%llx tsl=%zx/%llx/%llx\n",
diff --git a/include/linux/netfs.h b/include/linux/netfs.h
index c86a11cfc4a3..da0d36615bef 100644
--- a/include/linux/netfs.h
+++ b/include/linux/netfs.h
@@ -253,7 +253,7 @@ struct netfs_io_request {
unsigned long long submitted; /* Amount submitted for I/O so far */
unsigned long long len; /* Length of the request */
size_t transferred; /* Amount to be indicated as transferred */
- long error; /* 0 or error that occurred */
+ short error; /* 0 or error that occurred */
enum netfs_io_origin origin; /* Origin of the request */
bool direct_bv_unpin; /* T if direct_bv[] must be unpinned */
unsigned long long i_size; /* Size of the file */
--
2.47.2
next reply other threads:[~2025-04-28 15:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-28 15:48 Max Kellermann [this message]
2025-04-28 15:48 ` [PATCH 2/4] fs/netfs: reorderd struct fields to eliminate holes Max Kellermann
2025-04-28 15:48 ` [PATCH 3/4] fs/netfs: remove `netfs_io_request.ractl` Max Kellermann
2025-04-28 15:48 ` [PATCH 4/4] fs/netfs: declare field `proc_link` only if CONFIG_PROC_FS=y Max Kellermann
2025-05-07 9:01 ` [PATCH 1/4] fs/netfs: convert `netfs_io_request.error` to a `short kernel test robot
2025-05-07 15:48 ` Max Kellermann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250428154859.3228933-1-max.kellermann@ionos.com \
--to=max.kellermann@ionos.com \
--cc=dhowells@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netfs@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).