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.2 1994/08/02 07:54:49 davidg 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#define ITIMES(ip, t1, t2) { \
145 if ((ip)->i_flag & (IN_ACCESS | IN_CHANGE | IN_UPDATE)) { \
146 (ip)->i_flag |= IN_MODIFIED; \
147 if ((ip)->i_flag & IN_ACCESS) \
148 (ip)->i_atime.ts_sec = (t1)->tv_sec; \
149 if ((ip)->i_flag & IN_UPDATE) { \
150 (ip)->i_mtime.ts_sec = (t2)->tv_sec; \
151 (ip)->i_modrev++; \
152 } \
153 if ((ip)->i_flag & IN_CHANGE) \
154 (ip)->i_ctime.ts_sec = time.tv_sec; \
155 (ip)->i_flag &= ~(IN_ACCESS | IN_CHANGE | IN_UPDATE); \
156 } \
157}
158
159/* This overlays the fid structure (see mount.h). */
160struct ufid {
161 u_short ufid_len; /* Length of structure. */
162 u_short ufid_pad; /* Force long alignment. */
163 ino_t ufid_ino; /* File number (ino). */
164 long ufid_gen; /* Generation number. */
165};
166
167#endif
168#endif /* KERNEL */
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.2 1994/08/02 07:54:49 davidg 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#define ITIMES(ip, t1, t2) { \
145 if ((ip)->i_flag & (IN_ACCESS | IN_CHANGE | IN_UPDATE)) { \
146 (ip)->i_flag |= IN_MODIFIED; \
147 if ((ip)->i_flag & IN_ACCESS) \
148 (ip)->i_atime.ts_sec = (t1)->tv_sec; \
149 if ((ip)->i_flag & IN_UPDATE) { \
150 (ip)->i_mtime.ts_sec = (t2)->tv_sec; \
151 (ip)->i_modrev++; \
152 } \
153 if ((ip)->i_flag & IN_CHANGE) \
154 (ip)->i_ctime.ts_sec = time.tv_sec; \
155 (ip)->i_flag &= ~(IN_ACCESS | IN_CHANGE | IN_UPDATE); \
156 } \
157}
158
159/* This overlays the fid structure (see mount.h). */
160struct ufid {
161 u_short ufid_len; /* Length of structure. */
162 u_short ufid_pad; /* Force long alignment. */
163 ino_t ufid_ino; /* File number (ino). */
164 long ufid_gen; /* Generation number. */
165};
166
167#endif
168#endif /* KERNEL */