FEATURES: add notes about compilation env changes
[unleashed.git] / include / sys / lockfs.h
blobc5b9728cdba56298b4b1765e63668a1303e286fa
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
23 * Copyright 1998 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _SYS_LOCKFS_H
28 #define _SYS_LOCKFS_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
36 #ifdef _SYSCALL32
38 * ILP32 version of lockfs, used in ufs_ioctl() to support 32-bit app in
39 * LP64 kernel
41 struct lockfs32 {
42 uint32_t lf_lock; /* desired lock */
43 uint32_t lf_flags; /* misc flags */
44 uint32_t lf_key; /* lock key */
45 uint32_t lf_comlen; /* length of comment */
46 uint32_t lf_comment; /* address of comment */
48 #endif /* _SYSCALL32 */
50 struct lockfs {
51 ulong_t lf_lock; /* desired lock */
52 ulong_t lf_flags; /* misc flags */
53 ulong_t lf_key; /* lock key */
54 ulong_t lf_comlen; /* length of comment */
55 caddr_t lf_comment; /* address of comment */
59 * lf_lock and lf_locking
61 #define LOCKFS_ULOCK 0 /* unlock */
62 #define LOCKFS_WLOCK 1 /* write lock */
63 #define LOCKFS_NLOCK 2 /* name lock */
64 #define LOCKFS_DLOCK 3 /* delete lock */
65 #define LOCKFS_HLOCK 4 /* hard lock */
66 #define LOCKFS_ELOCK 5 /* error lock */
67 #define LOCKFS_ROELOCK 6 /* error lock (read-only) - unimplemented */
68 #define LOCKFS_MAXLOCK 6 /* maximum lock number */
71 * lf_flags
73 #define LOCKFS_BUSY 0x00000001 /* lock is being set */
74 #define LOCKFS_MOD 0x00000002 /* file system modified */
76 #define LOCKFS_MAXCOMMENTLEN 1024 /* maximum comment length */
79 * some nice checking macros
82 #define LOCKFS_IS_BUSY(LF) ((LF)->lf_flags & LOCKFS_BUSY)
83 #define LOCKFS_IS_MOD(LF) ((LF)->lf_flags & LOCKFS_MOD)
85 #define LOCKFS_CLR_BUSY(LF) ((LF)->lf_flags &= ~LOCKFS_BUSY)
86 #define LOCKFS_CLR_MOD(LF) ((LF)->lf_flags &= ~LOCKFS_MOD)
88 #define LOCKFS_SET_MOD(LF) ((LF)->lf_flags |= LOCKFS_MOD)
89 #define LOCKFS_SET_BUSY(LF) ((LF)->lf_flags |= LOCKFS_BUSY)
91 #define LOCKFS_IS_WLOCK(LF) ((LF)->lf_lock == LOCKFS_WLOCK)
92 #define LOCKFS_IS_HLOCK(LF) ((LF)->lf_lock == LOCKFS_HLOCK)
93 #define LOCKFS_IS_ROELOCK(LF) ((LF)->lf_lock == LOCKFS_ROELOCK)
94 #define LOCKFS_IS_ELOCK(LF) ((LF)->lf_lock == LOCKFS_ELOCK)
95 #define LOCKFS_IS_ULOCK(LF) ((LF)->lf_lock == LOCKFS_ULOCK)
96 #define LOCKFS_IS_NLOCK(LF) ((LF)->lf_lock == LOCKFS_NLOCK)
97 #define LOCKFS_IS_DLOCK(LF) ((LF)->lf_lock == LOCKFS_DLOCK)
99 #ifdef __cplusplus
101 #endif
103 #endif /* _SYS_LOCKFS_H */