| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: dinode.h,v 1.24 2013/06/09 17:55:46 dholland Exp $ */ | | 1 | /* $NetBSD: dinode.h,v 1.25 2016/01/22 23:06:10 dholland Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2002 Networks Associates Technology, Inc. | | 4 | * Copyright (c) 2002 Networks Associates Technology, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This software was developed for the FreeBSD Project by Marshall | | 7 | * This software was developed for the FreeBSD Project by Marshall |
8 | * Kirk McKusick and Network Associates Laboratories, the Security | | 8 | * Kirk McKusick and Network Associates Laboratories, the Security |
9 | * Research Division of Network Associates, Inc. under DARPA/SPAWAR | | 9 | * Research Division of Network Associates, Inc. under DARPA/SPAWAR |
10 | * contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA CHATS | | 10 | * contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA CHATS |
11 | * research program | | 11 | * research program |
12 | * | | 12 | * |
13 | * Copyright (c) 1982, 1989, 1993 | | 13 | * Copyright (c) 1982, 1989, 1993 |
14 | * The Regents of the University of California. All rights reserved. | | 14 | * The Regents of the University of California. All rights reserved. |
| @@ -70,70 +70,70 @@ | | | @@ -70,70 +70,70 @@ |
70 | | | 70 | |
71 | /* | | 71 | /* |
72 | * A dinode contains all the meta-data associated with a UFS file. | | 72 | * A dinode contains all the meta-data associated with a UFS file. |
73 | * This structure defines the on-disk format of a dinode. Since | | 73 | * This structure defines the on-disk format of a dinode. Since |
74 | * this structure describes an on-disk structure, all its fields | | 74 | * this structure describes an on-disk structure, all its fields |
75 | * are defined by types with precise widths. | | 75 | * are defined by types with precise widths. |
76 | */ | | 76 | */ |
77 | | | 77 | |
78 | #define UFS_NXADDR 2 | | 78 | #define UFS_NXADDR 2 |
79 | #define UFS_NDADDR 12 /* Direct addresses in inode. */ | | 79 | #define UFS_NDADDR 12 /* Direct addresses in inode. */ |
80 | #define UFS_NIADDR 3 /* Indirect addresses in inode. */ | | 80 | #define UFS_NIADDR 3 /* Indirect addresses in inode. */ |
81 | | | 81 | |
82 | struct ufs1_dinode { | | 82 | struct ufs1_dinode { |
83 | u_int16_t di_mode; /* 0: IFMT, permissions; see below. */ | | 83 | uint16_t di_mode; /* 0: IFMT, permissions; see below. */ |
84 | int16_t di_nlink; /* 2: File link count. */ | | 84 | int16_t di_nlink; /* 2: File link count. */ |
85 | u_int16_t di_oldids[2]; /* 4: Ffs: old user and group ids. */ | | 85 | uint16_t di_oldids[2]; /* 4: Ffs: old user and group ids. */ |
86 | u_int64_t di_size; /* 8: File byte count. */ | | 86 | uint64_t di_size; /* 8: File byte count. */ |
87 | int32_t di_atime; /* 16: Last access time. */ | | 87 | int32_t di_atime; /* 16: Last access time. */ |
88 | int32_t di_atimensec; /* 20: Last access time. */ | | 88 | int32_t di_atimensec; /* 20: Last access time. */ |
89 | int32_t di_mtime; /* 24: Last modified time. */ | | 89 | int32_t di_mtime; /* 24: Last modified time. */ |
90 | int32_t di_mtimensec; /* 28: Last modified time. */ | | 90 | int32_t di_mtimensec; /* 28: Last modified time. */ |
91 | int32_t di_ctime; /* 32: Last inode change time. */ | | 91 | int32_t di_ctime; /* 32: Last inode change time. */ |
92 | int32_t di_ctimensec; /* 36: Last inode change time. */ | | 92 | int32_t di_ctimensec; /* 36: Last inode change time. */ |
93 | int32_t di_db[UFS_NDADDR]; /* 40: Direct disk blocks. */ | | 93 | int32_t di_db[UFS_NDADDR]; /* 40: Direct disk blocks. */ |
94 | int32_t di_ib[UFS_NIADDR]; /* 88: Indirect disk blocks. */ | | 94 | int32_t di_ib[UFS_NIADDR]; /* 88: Indirect disk blocks. */ |
95 | u_int32_t di_flags; /* 100: Status flags (chflags). */ | | 95 | uint32_t di_flags; /* 100: Status flags (chflags). */ |
96 | u_int32_t di_blocks; /* 104: Blocks actually held. */ | | 96 | uint32_t di_blocks; /* 104: Blocks actually held. */ |
97 | int32_t di_gen; /* 108: Generation number. */ | | 97 | int32_t di_gen; /* 108: Generation number. */ |
98 | u_int32_t di_uid; /* 112: File owner. */ | | 98 | uint32_t di_uid; /* 112: File owner. */ |
99 | u_int32_t di_gid; /* 116: File group. */ | | 99 | uint32_t di_gid; /* 116: File group. */ |
100 | u_int64_t di_modrev; /* 120: i_modrev for NFSv4 */ | | 100 | uint64_t di_modrev; /* 120: i_modrev for NFSv4 */ |
101 | }; | | 101 | }; |
102 | | | 102 | |
103 | struct ufs2_dinode { | | 103 | struct ufs2_dinode { |
104 | u_int16_t di_mode; /* 0: IFMT, permissions; see below. */ | | 104 | uint16_t di_mode; /* 0: IFMT, permissions; see below. */ |
105 | int16_t di_nlink; /* 2: File link count. */ | | 105 | int16_t di_nlink; /* 2: File link count. */ |
106 | u_int32_t di_uid; /* 4: File owner. */ | | 106 | uint32_t di_uid; /* 4: File owner. */ |
107 | u_int32_t di_gid; /* 8: File group. */ | | 107 | uint32_t di_gid; /* 8: File group. */ |
108 | u_int32_t di_blksize; /* 12: Inode blocksize. */ | | 108 | uint32_t di_blksize; /* 12: Inode blocksize. */ |
109 | u_int64_t di_size; /* 16: File byte count. */ | | 109 | uint64_t di_size; /* 16: File byte count. */ |
110 | u_int64_t di_blocks; /* 24: Bytes actually held. */ | | 110 | uint64_t di_blocks; /* 24: Bytes actually held. */ |
111 | int64_t di_atime; /* 32: Last access time. */ | | 111 | int64_t di_atime; /* 32: Last access time. */ |
112 | int64_t di_mtime; /* 40: Last modified time. */ | | 112 | int64_t di_mtime; /* 40: Last modified time. */ |
113 | int64_t di_ctime; /* 48: Last inode change time. */ | | 113 | int64_t di_ctime; /* 48: Last inode change time. */ |
114 | int64_t di_birthtime; /* 56: Inode creation time. */ | | 114 | int64_t di_birthtime; /* 56: Inode creation time. */ |
115 | int32_t di_mtimensec; /* 64: Last modified time. */ | | 115 | int32_t di_mtimensec; /* 64: Last modified time. */ |
116 | int32_t di_atimensec; /* 68: Last access time. */ | | 116 | int32_t di_atimensec; /* 68: Last access time. */ |
117 | int32_t di_ctimensec; /* 72: Last inode change time. */ | | 117 | int32_t di_ctimensec; /* 72: Last inode change time. */ |
118 | int32_t di_birthnsec; /* 76: Inode creation time. */ | | 118 | int32_t di_birthnsec; /* 76: Inode creation time. */ |
119 | int32_t di_gen; /* 80: Generation number. */ | | 119 | int32_t di_gen; /* 80: Generation number. */ |
120 | u_int32_t di_kernflags; /* 84: Kernel flags. */ | | 120 | uint32_t di_kernflags; /* 84: Kernel flags. */ |
121 | u_int32_t di_flags; /* 88: Status flags (chflags). */ | | 121 | uint32_t di_flags; /* 88: Status flags (chflags). */ |
122 | int32_t di_extsize; /* 92: External attributes block. */ | | 122 | int32_t di_extsize; /* 92: External attributes block. */ |
123 | int64_t di_extb[UFS_NXADDR];/* 96: External attributes block. */ | | 123 | int64_t di_extb[UFS_NXADDR];/* 96: External attributes block. */ |
124 | int64_t di_db[UFS_NDADDR]; /* 112: Direct disk blocks. */ | | 124 | int64_t di_db[UFS_NDADDR]; /* 112: Direct disk blocks. */ |
125 | int64_t di_ib[UFS_NIADDR]; /* 208: Indirect disk blocks. */ | | 125 | int64_t di_ib[UFS_NIADDR]; /* 208: Indirect disk blocks. */ |
126 | u_int64_t di_modrev; /* 232: i_modrev for NFSv4 */ | | 126 | uint64_t di_modrev; /* 232: i_modrev for NFSv4 */ |
127 | int64_t di_spare[2]; /* 240: Reserved; currently unused */ | | 127 | int64_t di_spare[2]; /* 240: Reserved; currently unused */ |
128 | }; | | 128 | }; |
129 | | | 129 | |
130 | /* | | 130 | /* |
131 | * The di_db fields may be overlaid with other information for | | 131 | * The di_db fields may be overlaid with other information for |
132 | * file types that do not have associated disk storage. Block | | 132 | * file types that do not have associated disk storage. Block |
133 | * and character devices overlay the first data block with their | | 133 | * and character devices overlay the first data block with their |
134 | * dev_t value. Short symbolic links place their path in the | | 134 | * dev_t value. Short symbolic links place their path in the |
135 | * di_db area. | | 135 | * di_db area. |
136 | */ | | 136 | */ |
137 | #define di_ogid di_oldids[1] | | 137 | #define di_ogid di_oldids[1] |
138 | #define di_ouid di_oldids[0] | | 138 | #define di_ouid di_oldids[0] |
139 | #define di_rdev di_db[0] | | 139 | #define di_rdev di_db[0] |