mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <ahmad@a3f.at>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <ahmad@a3f.at>
Subject: [PATCH] fs: remove unused members of struct stat
Date: Thu,  2 Feb 2023 15:25:12 +0100	[thread overview]
Message-ID: <20230202142512.3551195-1-ahmad@a3f.at> (raw)

Some members in struct stat are never written, so drop them.

Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
 fs/fs.c              | 4 ++--
 include/linux/stat.h | 3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/fs/fs.c b/fs/fs.c
index c463466e1be0..4837c4b701bc 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -160,9 +160,9 @@ void stat_print(const char *filename, const struct stat *st)
 
 	fdev = get_fsdevice_by_path(filename);
 
-	printf("\nDevice: %s\tInode: %lu\tLinks: %u\n",
+	printf("\nDevice: %s\tInode: %lu\n",
 	       fdev ? dev_name(&fdev->dev) : "<unknown>",
-	       st->st_ino, st->st_nlink);
+	       st->st_ino);
 	printf("Access: (%04o/%s)\tUid: (%u)\tGid: (%u)\n",
 	       st->st_mode & 07777, modestr, st->st_uid, st->st_gid);
 
diff --git a/include/linux/stat.h b/include/linux/stat.h
index 2bdf3ec9c96c..fc3dd222a673 100644
--- a/include/linux/stat.h
+++ b/include/linux/stat.h
@@ -49,11 +49,8 @@ extern "C" {
 struct stat {
 	unsigned long st_ino;
 	unsigned short st_mode;
-	unsigned short st_nlink;
 	unsigned short st_uid;
 	unsigned short st_gid;
-	unsigned short st_rdev;
-	unsigned short __pad2;
 	loff_t  st_size;
 };
 
-- 
2.38.1




             reply	other threads:[~2023-02-02 14:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-02 14:25 Ahmad Fatoum [this message]
2023-02-03  7:56 ` Sascha Hauer

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=20230202142512.3551195-1-ahmad@a3f.at \
    --to=ahmad@a3f.at \
    --cc=barebox@lists.infradead.org \
    /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