2
* Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
2
* Copyright (c) 2000, 2002 Silicon Graphics, Inc. All Rights Reserved.
4
4
* This program is free software; you can redistribute it and/or modify it
5
5
* under the terms of version 2 of the GNU General Public License as
6
6
* published by the Free Software Foundation.
8
8
* This program is distributed in the hope that it would be useful, but
9
9
* WITHOUT ANY WARRANTY; without even the implied warranty of
10
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
12
* Further, this software is distributed without any warranty that it is
13
13
* free of the rightful claim of any third person regarding infringement
14
14
* or the like. Any license provided herein, whether implied or
15
15
* otherwise, applies only to this software file. Patent licenses, if
16
16
* any, provided herein do not apply to combinations of this program with
17
17
* other software, or any other product whatsoever.
19
19
* You should have received a copy of the GNU General Public License along
20
20
* with this program; if not, write the Free Software Foundation, Inc., 59
21
21
* Temple Place - Suite 330, Boston MA 02111-1307, USA.
23
23
* Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24
24
* Mountain View, CA 94043, or:
28
* For further information regarding this notice, see:
28
* For further information regarding this notice, see:
30
30
* http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
32
32
#ifndef __XFS_DINODE_H__
72
72
__uint32_t di_gid; /* owner's group id */
73
73
__uint32_t di_nlink; /* number of links to file */
74
74
__uint16_t di_projid; /* owner's project id */
75
__uint8_t di_pad[10]; /* unused, zeroed space */
75
__uint8_t di_pad[8]; /* unused, zeroed space */
76
__uint16_t di_flushiter; /* incremented on flush */
76
77
xfs_timestamp_t di_atime; /* time last accessed */
77
78
xfs_timestamp_t di_mtime; /* time last modified */
78
79
xfs_timestamp_t di_ctime; /* time created/inode modified */
104
107
xfs_dir_shortform_t di_dirsf; /* shortform directory */
105
108
xfs_dir2_sf_t di_dir2sf; /* shortform directory v2 */
106
109
char di_c[1]; /* local contents */
107
xfs_dev_t di_dev; /* device for IFCHR/IFBLK */
110
xfs_dev_t di_dev; /* device for S_IFCHR/S_IFBLK */
108
111
uuid_t di_muuid; /* mount point value */
109
112
char di_symlink[1]; /* local symbolic link */
167
170
/* LNK: di_symlink */
168
171
XFS_DINODE_FMT_EXTENTS, /* DIR, REG, LNK: di_bmx */
169
172
XFS_DINODE_FMT_BTREE, /* DIR, REG, LNK: di_bmbt */
170
XFS_DINODE_FMT_UUID /* MNT: di_uuid */
173
XFS_DINODE_FMT_UUID /* MNT: di_uuid */
171
174
} xfs_dinode_fmt_t;
206
209
#define XFS_CFORK_Q_ARCH(dcp,arch) xfs_cfork_q_arch(dcp,arch)
207
210
#define XFS_CFORK_Q(dcp) xfs_cfork_q(dcp)
209
#define XFS_CFORK_Q_ARCH(dcp,arch) (INT_GET((dcp)->di_forkoff, arch) != 0)
212
#define XFS_CFORK_Q_ARCH(dcp,arch) (!INT_ISZERO((dcp)->di_forkoff, arch))
210
213
#define XFS_CFORK_Q(dcp) ((dcp)->di_forkoff != 0)
236
239
int xfs_cfork_asize_arch(xfs_dinode_core_t *dcp, struct xfs_mount *mp, xfs_arch_t arch);
237
240
int xfs_cfork_asize(xfs_dinode_core_t *dcp, struct xfs_mount *mp);
238
241
#define XFS_CFORK_ASIZE_ARCH(dcp,mp,arch) xfs_cfork_asize_arch(dcp,mp,arch)
239
#define XFS_CFORK_ASIZE(dcp,mp) xfs_cfork_asize(dcp,mp)
242
#define XFS_CFORK_ASIZE(dcp,mp) xfs_cfork_asize(dcp,mp)
241
244
#define XFS_CFORK_ASIZE_ARCH(dcp,mp,arch) \
242
245
(XFS_CFORK_Q_ARCH(dcp, arch) ? XFS_LITINO(mp) - XFS_CFORK_BOFF_ARCH(dcp, arch) : 0)
283
286
int xfs_dfork_size_arch(xfs_dinode_t *dip, struct xfs_mount *mp, int w, xfs_arch_t arch);
284
287
int xfs_dfork_size(xfs_dinode_t *dip, struct xfs_mount *mp, int w);
285
288
#define XFS_DFORK_SIZE_ARCH(dip,mp,w,arch) xfs_dfork_size_arch(dip,mp,w,arch)
286
#define XFS_DFORK_SIZE(dip,mp,w) xfs_dfork_size(dip,mp,w)
289
#define XFS_DFORK_SIZE(dip,mp,w) xfs_dfork_size(dip,mp,w)
288
291
#define XFS_DFORK_SIZE_ARCH(dip,mp,w,arch) XFS_CFORK_SIZE_ARCH(&(dip)->di_core, mp, w, arch)
289
292
#define XFS_DFORK_SIZE(dip,mp,w) XFS_DFORK_SIZE_ARCH(dip,mp,w,ARCH_NOCONVERT)
327
330
char *xfs_dfork_aptr_arch(xfs_dinode_t *dip, xfs_arch_t arch);
328
331
char *xfs_dfork_aptr(xfs_dinode_t *dip);
329
332
#define XFS_DFORK_APTR_ARCH(dip,arch) xfs_dfork_aptr_arch(dip,arch)
330
#define XFS_DFORK_APTR(dip) xfs_dfork_aptr(dip)
333
#define XFS_DFORK_APTR(dip) xfs_dfork_aptr(dip)
332
335
#define XFS_DFORK_APTR_ARCH(dip,arch) ((dip)->di_u.di_c + XFS_DFORK_BOFF_ARCH(dip, arch))
333
336
#define XFS_DFORK_APTR(dip) XFS_DFORK_APTR_ARCH(dip,ARCH_NOCONVERT)
377
380
#define XFS_CFORK_NEXTENTS_ARCH(dcp,w,arch) \
378
381
((w) == XFS_DATA_FORK ? INT_GET((dcp)->di_nextents, arch) : INT_GET((dcp)->di_anextents, arch))
379
#define XFS_CFORK_NEXTENTS(dcp,w) XFS_CFORK_NEXTENTS_ARCH(dcp,w,ARCH_NOCONVERT)
382
#define XFS_CFORK_NEXTENTS(dcp,w) XFS_CFORK_NEXTENTS_ARCH(dcp,w,ARCH_NOCONVERT)
382
385
#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_CFORK_NEXT_SET)
437
* File types (mode field)
439
#define IFMT 0170000 /* type of file */
440
#define IFIFO 0010000 /* named pipe (fifo) */
441
#define IFCHR 0020000 /* character special */
442
#define IFDIR 0040000 /* directory */
443
#define IFBLK 0060000 /* block special */
444
#define IFREG 0100000 /* regular */
445
#define IFLNK 0120000 /* symbolic link */
446
#define IFSOCK 0140000 /* socket */
447
#define IFMNT 0160000 /* mount point */
450
* File execution and access modes.
452
#define ISUID 04000 /* set user id on execution */
453
#define ISGID 02000 /* set group id on execution */
454
#define ISVTX 01000 /* sticky directory */
455
#define IREAD 0400 /* read, write, execute permissions */
459
439
#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_BUF_TO_DINODE)
460
440
xfs_dinode_t *xfs_buf_to_dinode(struct xfs_buf *bp);
461
441
#define XFS_BUF_TO_DINODE(bp) xfs_buf_to_dinode(bp)
468
448
* There should be a one-to-one correspondence between these flags and the
471
#define XFS_DIFLAG_REALTIME_BIT 0 /* file's blocks come from rt area */
472
#define XFS_DIFLAG_PREALLOC_BIT 1 /* file space has been preallocated */
473
#define XFS_DIFLAG_NEWRTBM_BIT 2 /* for rtbitmap inode, new format */
474
#define XFS_DIFLAG_REALTIME (1 << XFS_DIFLAG_REALTIME_BIT)
475
#define XFS_DIFLAG_PREALLOC (1 << XFS_DIFLAG_PREALLOC_BIT)
476
#define XFS_DIFLAG_NEWRTBM (1 << XFS_DIFLAG_NEWRTBM_BIT)
477
#define XFS_DIFLAG_ALL \
478
(XFS_DIFLAG_REALTIME|XFS_DIFLAG_PREALLOC|XFS_DIFLAG_NEWRTBM)
451
#define XFS_DIFLAG_REALTIME_BIT 0 /* file's blocks come from rt area */
452
#define XFS_DIFLAG_PREALLOC_BIT 1 /* file space has been preallocated */
453
#define XFS_DIFLAG_NEWRTBM_BIT 2 /* for rtbitmap inode, new format */
454
#define XFS_DIFLAG_IMMUTABLE_BIT 3 /* inode is immutable */
455
#define XFS_DIFLAG_APPEND_BIT 4 /* inode is append-only */
456
#define XFS_DIFLAG_SYNC_BIT 5 /* inode is written synchronously */
457
#define XFS_DIFLAG_NOATIME_BIT 6 /* do not update atime */
458
#define XFS_DIFLAG_NODUMP_BIT 7 /* do not dump */
459
#define XFS_DIFLAG_REALTIME (1 << XFS_DIFLAG_REALTIME_BIT)
460
#define XFS_DIFLAG_PREALLOC (1 << XFS_DIFLAG_PREALLOC_BIT)
461
#define XFS_DIFLAG_NEWRTBM (1 << XFS_DIFLAG_NEWRTBM_BIT)
462
#define XFS_DIFLAG_IMMUTABLE (1 << XFS_DIFLAG_IMMUTABLE_BIT)
463
#define XFS_DIFLAG_APPEND (1 << XFS_DIFLAG_APPEND_BIT)
464
#define XFS_DIFLAG_SYNC (1 << XFS_DIFLAG_SYNC_BIT)
465
#define XFS_DIFLAG_NOATIME (1 << XFS_DIFLAG_NOATIME_BIT)
466
#define XFS_DIFLAG_NODUMP (1 << XFS_DIFLAG_NODUMP_BIT)
480
468
#endif /* __XFS_DINODE_H__ */