xref: /openbmc/linux/arch/powerpc/include/uapi/asm/stat.h (revision d39e0615)
1e2be04c7SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2c3617f72SDavid Howells #ifndef _ASM_POWERPC_STAT_H
3c3617f72SDavid Howells #define _ASM_POWERPC_STAT_H
4c3617f72SDavid Howells /*
5c3617f72SDavid Howells  * This program is free software; you can redistribute it and/or
6c3617f72SDavid Howells  * modify it under the terms of the GNU General Public License
7c3617f72SDavid Howells  * as published by the Free Software Foundation; either version
8c3617f72SDavid Howells  * 2 of the License, or (at your option) any later version.
9c3617f72SDavid Howells  */
10c3617f72SDavid Howells #include <linux/types.h>
11c3617f72SDavid Howells 
12c3617f72SDavid Howells #define STAT_HAVE_NSEC 1
13c3617f72SDavid Howells 
14c3617f72SDavid Howells #ifndef __powerpc64__
15c3617f72SDavid Howells struct __old_kernel_stat {
16c3617f72SDavid Howells 	unsigned short st_dev;
17c3617f72SDavid Howells 	unsigned short st_ino;
18c3617f72SDavid Howells 	unsigned short st_mode;
19c3617f72SDavid Howells 	unsigned short st_nlink;
20c3617f72SDavid Howells 	unsigned short st_uid;
21c3617f72SDavid Howells 	unsigned short st_gid;
22c3617f72SDavid Howells 	unsigned short st_rdev;
23c3617f72SDavid Howells 	unsigned long  st_size;
24c3617f72SDavid Howells 	unsigned long  st_atime;
25c3617f72SDavid Howells 	unsigned long  st_mtime;
26c3617f72SDavid Howells 	unsigned long  st_ctime;
27c3617f72SDavid Howells };
28c3617f72SDavid Howells #endif /* !__powerpc64__ */
29c3617f72SDavid Howells 
30c3617f72SDavid Howells struct stat {
31c3617f72SDavid Howells 	unsigned long	st_dev;
32c01013a2SMasahiro Yamada 	__kernel_ino_t	st_ino;
33c3617f72SDavid Howells #ifdef __powerpc64__
34c3617f72SDavid Howells 	unsigned long	st_nlink;
35c01013a2SMasahiro Yamada 	__kernel_mode_t	st_mode;
36c3617f72SDavid Howells #else
37c01013a2SMasahiro Yamada 	__kernel_mode_t	st_mode;
38c3617f72SDavid Howells 	unsigned short	st_nlink;
39c3617f72SDavid Howells #endif
40*d39e0615SMasahiro Yamada 	__kernel_uid32_t st_uid;
41*d39e0615SMasahiro Yamada 	__kernel_gid32_t st_gid;
42c3617f72SDavid Howells 	unsigned long	st_rdev;
431bf883c1SArnd Bergmann 	long		st_size;
44c3617f72SDavid Howells 	unsigned long	st_blksize;
45c3617f72SDavid Howells 	unsigned long	st_blocks;
46c3617f72SDavid Howells 	unsigned long	st_atime;
47c3617f72SDavid Howells 	unsigned long	st_atime_nsec;
48c3617f72SDavid Howells 	unsigned long	st_mtime;
49c3617f72SDavid Howells 	unsigned long	st_mtime_nsec;
50c3617f72SDavid Howells 	unsigned long	st_ctime;
51c3617f72SDavid Howells 	unsigned long	st_ctime_nsec;
52c3617f72SDavid Howells 	unsigned long	__unused4;
53c3617f72SDavid Howells 	unsigned long	__unused5;
54c3617f72SDavid Howells #ifdef __powerpc64__
55c3617f72SDavid Howells 	unsigned long	__unused6;
56c3617f72SDavid Howells #endif
57c3617f72SDavid Howells };
58c3617f72SDavid Howells 
59c3617f72SDavid Howells /* This matches struct stat64 in glibc2.1. Only used for 32 bit. */
60c3617f72SDavid Howells struct stat64 {
61c3617f72SDavid Howells 	unsigned long long st_dev;		/* Device.  */
62c3617f72SDavid Howells 	unsigned long long st_ino;		/* File serial number.  */
63c3617f72SDavid Howells 	unsigned int	st_mode;	/* File mode.  */
64c3617f72SDavid Howells 	unsigned int	st_nlink;	/* Link count.  */
65c3617f72SDavid Howells 	unsigned int	st_uid;		/* User ID of the file's owner.  */
66c3617f72SDavid Howells 	unsigned int	st_gid;		/* Group ID of the file's group. */
67c3617f72SDavid Howells 	unsigned long long st_rdev;	/* Device number, if device.  */
68c3617f72SDavid Howells 	unsigned short	__pad2;
69c3617f72SDavid Howells 	long long	st_size;	/* Size of file, in bytes.  */
70c3617f72SDavid Howells 	int		st_blksize;	/* Optimal block size for I/O.  */
71c3617f72SDavid Howells 	long long	st_blocks;	/* Number 512-byte blocks allocated. */
72c3617f72SDavid Howells 	int		st_atime;	/* Time of last access.  */
73c3617f72SDavid Howells 	unsigned int	st_atime_nsec;
74c3617f72SDavid Howells 	int		st_mtime;	/* Time of last modification.  */
75c3617f72SDavid Howells 	unsigned int	st_mtime_nsec;
76c3617f72SDavid Howells 	int		st_ctime;	/* Time of last status change.  */
77c3617f72SDavid Howells 	unsigned int	st_ctime_nsec;
78c3617f72SDavid Howells 	unsigned int	__unused4;
79c3617f72SDavid Howells 	unsigned int	__unused5;
80c3617f72SDavid Howells };
81c3617f72SDavid Howells 
82c3617f72SDavid Howells #endif /* _ASM_POWERPC_STAT_H */
83