ulfs_dinode.h revision 1.9
1/*	$NetBSD: ulfs_dinode.h,v 1.9 2013/06/08 02:13:33 dholland Exp $	*/
2/*  from NetBSD: dinode.h,v 1.22 2013/01/22 09:39:18 dholland Exp  */
3
4/*
5 * Copyright (c) 2002 Networks Associates Technology, Inc.
6 * All rights reserved.
7 *
8 * This software was developed for the FreeBSD Project by Marshall
9 * Kirk McKusick and Network Associates Laboratories, the Security
10 * Research Division of Network Associates, Inc. under DARPA/SPAWAR
11 * contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA CHATS
12 * research program
13 *
14 * Copyright (c) 1982, 1989, 1993
15 *	The Regents of the University of California.  All rights reserved.
16 * (c) UNIX System Laboratories, Inc.
17 * All or some portions of this file are derived from material licensed
18 * to the University of California by American Telephone and Telegraph
19 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
20 * the permission of UNIX System Laboratories, Inc.
21 *
22 * Redistribution and use in source and binary forms, with or without
23 * modification, are permitted provided that the following conditions
24 * are met:
25 * 1. Redistributions of source code must retain the above copyright
26 *    notice, this list of conditions and the following disclaimer.
27 * 2. Redistributions in binary form must reproduce the above copyright
28 *    notice, this list of conditions and the following disclaimer in the
29 *    documentation and/or other materials provided with the distribution.
30 * 3. Neither the name of the University nor the names of its contributors
31 *    may be used to endorse or promote products derived from this software
32 *    without specific prior written permission.
33 *
34 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
35 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
36 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
37 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
38 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
39 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
40 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
41 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
42 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
43 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
44 * SUCH DAMAGE.
45 *
46 *	@(#)dinode.h	8.9 (Berkeley) 3/29/95
47 */
48
49/*
50 * NOTE: COORDINATE ON-DISK FORMAT CHANGES WITH THE FREEBSD PROJECT.
51 */
52
53#ifndef	_UFS_LFS_ULFS_DINODE_H_
54#define	_UFS_LFS_ULFS_DINODE_H_
55
56#include <ufs/lfs/lfs.h>
57
58/*
59 * Maximum length of a symlink that can be stored within the inode.
60 */
61#define ULFS1_MAXSYMLINKLEN	((ULFS_NDADDR + ULFS_NIADDR) * sizeof(int32_t))
62#define ULFS2_MAXSYMLINKLEN	((ULFS_NDADDR + ULFS_NIADDR) * sizeof(int64_t))
63
64#define ULFS_MAXSYMLINKLEN(ip) \
65	((ip)->i_ump->um_fstype == ULFS1) ? \
66	ULFS1_MAXSYMLINKLEN : ULFS2_MAXSYMLINKLEN
67
68/* File permissions. */
69#define	IEXEC		0000100		/* Executable. */
70#define	IWRITE		0000200		/* Writable. */
71#define	IREAD		0000400		/* Readable. */
72#define	ISVTX		0001000		/* Sticky bit. */
73#define	ISGID		0002000		/* Set-gid. */
74#define	ISUID		0004000		/* Set-uid. */
75
76#endif /* !_UFS_LFS_ULFS_DINODE_H_ */
77