mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] fs: remove unused members of struct stat
@ 2023-02-02 14:25 Ahmad Fatoum
  2023-02-03  7:56 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2023-02-02 14:25 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] fs: remove unused members of struct stat
  2023-02-02 14:25 [PATCH] fs: remove unused members of struct stat Ahmad Fatoum
@ 2023-02-03  7:56 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2023-02-03  7:56 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Thu, Feb 02, 2023 at 03:25:12PM +0100, Ahmad Fatoum wrote:
> 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(-)

Applied, thanks

Sascha

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

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-03  7:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-02 14:25 [PATCH] fs: remove unused members of struct stat Ahmad Fatoum
2023-02-03  7:56 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox