2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
11 * Linux interpretations of vnode and vfs structs.
17 typedef struct inode vnode_t;
20 /* Map vnode fields to inode fields */
21 #define i_number i_ino
22 #define v_count i_count
27 #define v_data u.generic_ip
29 /* v_type bits map to mode bits */
36 #define VSOCK S_IFSOCK
39 /* vcexcl - used only by afs_create */
40 enum vcexcl { EXCL, NONEXCL } ;
42 /* afs_open and afs_close needs to distinguish these cases */
43 #define FWRITE O_WRONLY|O_RDWR|O_APPEND
44 #define FTRUNC O_TRUNC
46 #define IO_APPEND O_APPEND
50 #define VFS_STATFS(V, S) ((V)->s_op->statfs)((V), (S), sizeof(*(S)))
52 /* Various mode bits */
53 #define VWRITE S_IWUSR
59 #define vfs super_block
61 typedef struct vattr {
62 int va_type; /* One of v_types above. */
64 unsigned long va_blocks;
65 unsigned long va_blocksize;
66 int va_mask; /* AT_xxx operation to perform. */
67 umode_t va_mode; /* mode bits. */
70 int va_fsid; /* Not used? */
72 ino_t va_nodeid; /* Inode number */
73 nlink_t va_nlink; /* link count for file. */
74 struct timeval va_atime;
75 struct timeval va_mtime;
76 struct timeval va_ctime;
79 #define VATTR_NULL(A) memset(A, 0, sizeof(struct vattr))
81 #ifndef HAVE_LINUX_I_SIZE_READ
82 #define i_size_read(X) ((X)->i_size)
83 #define i_size_write(X,Y) (X)->i_size = Y
86 #endif /* OSI_VFS_H_ */