Skip to content

Commit 71d28e6

Browse files
Bob Wilsonczankel
authored andcommitted
[XTENSA] Clean up stat structs.
Avoid using typedefs for stat fields. Make stat64.st_blocks an unsigned long long to avoid endian-specific padding with 32-bit values. Clean up signed vs. unsigned and int vs. long types to be consistent with other uses of these values. Signed-off-by: Bob Wilson <[email protected]> Signed-off-by: Chris Zankel <[email protected]>
1 parent 36dffad commit 71d28e6

File tree

1 file changed

+13
-23
lines changed

1 file changed

+13
-23
lines changed

include/asm-xtensa/stat.h

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,23 @@
55
* License. See the file "COPYING" in the main directory of this archive
66
* for more details.
77
*
8-
* Copyright (C) 2001 - 2005 Tensilica Inc.
8+
* Copyright (C) 2001 - 2007 Tensilica Inc.
99
*/
1010

1111
#ifndef _XTENSA_STAT_H
1212
#define _XTENSA_STAT_H
1313

14-
#include <linux/types.h>
15-
1614
#define STAT_HAVE_NSEC 1
1715

1816
struct stat {
1917
unsigned long st_dev;
20-
ino_t st_ino;
21-
mode_t st_mode;
22-
nlink_t st_nlink;
23-
uid_t st_uid;
24-
gid_t st_gid;
25-
unsigned int st_rdev;
26-
off_t st_size;
18+
unsigned long st_ino;
19+
unsigned int st_mode;
20+
unsigned int st_nlink;
21+
unsigned int st_uid;
22+
unsigned int st_gid;
23+
unsigned long st_rdev;
24+
long st_size;
2725
unsigned long st_blksize;
2826
unsigned long st_blocks;
2927
unsigned long st_atime;
@@ -36,8 +34,6 @@ struct stat {
3634
unsigned long __unused5;
3735
};
3836

39-
/* This matches struct stat64 in glibc-2.3 */
40-
4137
struct stat64 {
4238
unsigned long long st_dev; /* Device */
4339
unsigned long long st_ino; /* File serial number */
@@ -47,20 +43,14 @@ struct stat64 {
4743
unsigned int st_gid; /* Group ID of the file's group. */
4844
unsigned long long st_rdev; /* Device number, if device. */
4945
long long st_size; /* Size of file, in bytes. */
50-
long st_blksize; /* Optimal block size for I/O. */
46+
unsigned long st_blksize; /* Optimal block size for I/O. */
5147
unsigned long __unused2;
52-
#ifdef __XTENSA_EB__
53-
unsigned long __unused3;
54-
long st_blocks; /* Number 512-byte blocks allocated. */
55-
#else
56-
long st_blocks; /* Number 512-byte blocks allocated. */
57-
unsigned long __unused3;
58-
#endif
59-
long st_atime; /* Time of last access. */
48+
unsigned long long st_blocks; /* Number 512-byte blocks allocated. */
49+
unsigned long st_atime; /* Time of last access. */
6050
unsigned long st_atime_nsec;
61-
long st_mtime; /* Time of last modification. */
51+
unsigned long st_mtime; /* Time of last modification. */
6252
unsigned long st_mtime_nsec;
63-
long st_ctime; /* Time of last status change. */
53+
unsigned long st_ctime; /* Time of last status change. */
6454
unsigned long st_ctime_nsec;
6555
unsigned long __unused4;
6656
unsigned long __unused5;

0 commit comments

Comments
 (0)