1/*
2 * Copyright (c) 1982, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.
--- 22 unchanged lines hidden (view full) ---
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)inode.h 8.4 (Berkeley) 1/21/94
39 * $Id: inode.h,v 1.3 1994/08/21 07:16:15 paul Exp $
40 */
41
42#ifndef _UFS_UFS_INODE_H_
43#define _UFS_UFS_INODE_H_
44
45#include <ufs/ufs/dinode.h>
46
47/*
48 * Theoretically, directories can be more than 2Gb in length, however, in
49 * practice this seems unlikely. So, we define the type doff_t as a long
50 * to keep down the cost of doing lookup on a 32-bit machine. If you are
51 * porting to a 64-bit architecture, you should make doff_t the same as off_t.
--- 84 unchanged lines hidden (view full) ---
136 int in_off; /* Offset in buffer. */
137 int in_exists; /* Flag if the block exists. */
138};
139
140/* Convert between inode pointers and vnode pointers. */
141#define VTOI(vp) ((struct inode *)(vp)->v_data)
142#define ITOV(ip) ((ip)->i_vnode)
143
144/*
145 * XXX this is too long to be a macro, and isn't used in any time-critical
146 * place; in fact it is only used in ufs_vnops.c so it shouldn't be in a
147 * header file.
148 */
149#define ITIMES(ip, t1, t2) { \
150 long tv_sec = time.tv_sec; \
151 if ((ip)->i_flag & (IN_ACCESS | IN_CHANGE | IN_UPDATE)) { \
152 (ip)->i_flag |= IN_MODIFIED; \
153 if ((ip)->i_flag & IN_ACCESS) \
154 (ip)->i_atime.ts_sec \
155 = ((t1) == &time ? tv_sec : (t1)->tv_sec); \
156 if ((ip)->i_flag & IN_UPDATE) { \
157 (ip)->i_mtime.ts_sec \
158 = ((t2) == &time ? tv_sec : (t2)->tv_sec); \
159 (ip)->i_modrev++; \
160 } \
161 if ((ip)->i_flag & IN_CHANGE) \
162 (ip)->i_ctime.ts_sec = tv_sec; \
163 (ip)->i_flag &= ~(IN_ACCESS | IN_CHANGE | IN_UPDATE); \
164 } \
165}
166
167/* This overlays the fid structure (see mount.h). */
168struct ufid {
169 u_short ufid_len; /* Length of structure. */
170 u_short ufid_pad; /* Force long alignment. */
171 ino_t ufid_ino; /* File number (ino). */
172 long ufid_gen; /* Generation number. */
173};
174#endif /* KERNEL */
175
176#endif /* !_UFS_UFS_INODE_H_ */
2 * Copyright (c) 1982, 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.
--- 22 unchanged lines hidden (view full) ---
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)inode.h 8.4 (Berkeley) 1/21/94
39 * $Id: inode.h,v 1.3 1994/08/21 07:16:15 paul Exp $
40 */
41
42#ifndef _UFS_UFS_INODE_H_
43#define _UFS_UFS_INODE_H_
44
45#include <ufs/ufs/dinode.h>
46
47/*
48 * Theoretically, directories can be more than 2Gb in length, however, in
49 * practice this seems unlikely. So, we define the type doff_t as a long
50 * to keep down the cost of doing lookup on a 32-bit machine. If you are
51 * porting to a 64-bit architecture, you should make doff_t the same as off_t.
--- 84 unchanged lines hidden (view full) ---
136 int in_off; /* Offset in buffer. */
137 int in_exists; /* Flag if the block exists. */
138};
139
140/* Convert between inode pointers and vnode pointers. */
141#define VTOI(vp) ((struct inode *)(vp)->v_data)
142#define ITOV(ip) ((ip)->i_vnode)
143
144/*
145 * XXX this is too long to be a macro, and isn't used in any time-critical
146 * place; in fact it is only used in ufs_vnops.c so it shouldn't be in a
147 * header file.
148 */
149#define ITIMES(ip, t1, t2) { \
150 long tv_sec = time.tv_sec; \
151 if ((ip)->i_flag & (IN_ACCESS | IN_CHANGE | IN_UPDATE)) { \
152 (ip)->i_flag |= IN_MODIFIED; \
153 if ((ip)->i_flag & IN_ACCESS) \
154 (ip)->i_atime.ts_sec \
155 = ((t1) == &time ? tv_sec : (t1)->tv_sec); \
156 if ((ip)->i_flag & IN_UPDATE) { \
157 (ip)->i_mtime.ts_sec \
158 = ((t2) == &time ? tv_sec : (t2)->tv_sec); \
159 (ip)->i_modrev++; \
160 } \
161 if ((ip)->i_flag & IN_CHANGE) \
162 (ip)->i_ctime.ts_sec = tv_sec; \
163 (ip)->i_flag &= ~(IN_ACCESS | IN_CHANGE | IN_UPDATE); \
164 } \
165}
166
167/* This overlays the fid structure (see mount.h). */
168struct ufid {
169 u_short ufid_len; /* Length of structure. */
170 u_short ufid_pad; /* Force long alignment. */
171 ino_t ufid_ino; /* File number (ino). */
172 long ufid_gen; /* Generation number. */
173};
174#endif /* KERNEL */
175
176#endif /* !_UFS_UFS_INODE_H_ */