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.
13 * The Linux "inode" has been abstracted to the fs independent part to avoid
14 * wasting 100+bytes per vnode.
20 /* The vnode should match the current implementation of the fs independent
21 * part of the Linux inode.
23 /* The first cut is to continue to use a separate vnode pool. */
24 /* LINUX VNODE INCLUDED BELOW -- DO NOT MODIFY */
26 typedef struct vnode vnode_t;
28 /* Map vnode fields to inode fields. */
29 #define i_number i_ino
30 #define v_count i_count
32 #if defined(AFS_LINUX24_ENV)
37 #define vfs_vnodecovered s_covered
39 /* v_type bits map to mode bits: */
46 #define VSOCK S_IFSOCK
48 /* vcexcl - used only by afs_create */
49 enum vcexcl { EXCL, NONEXCL } ;
51 /* afs_open and afs_close needs to distinguish these cases */
52 #define FWRITE O_WRONLY|O_RDWR|O_APPEND
53 #define FTRUNC O_TRUNC
56 #define IO_APPEND O_APPEND
59 #define VTOI(V) ((struct inode*)V)
60 #ifdef AFS_LINUX24_ENV
61 #define VN_HOLD(V) atomic_inc(&((vnode_t*)V)->i_count)
63 #define VN_HOLD(V) ((vnode_t*)V)->i_count++;
65 #define VN_RELE(V) osi_iput((struct inode *)V);
66 #define VFS_STATFS(V, S) ((V)->s_op->statfs)((V), (S), sizeof(*(S)))
70 /* Various mode bits */
71 #define VWRITE S_IWUSR
78 #define vfs super_block
80 typedef struct vattr {
81 int va_type; /* One of v_types above. */
83 unsigned long va_blocks;
84 unsigned long va_blocksize;
85 int va_mask; /* AT_xxx operation to perform. */
86 umode_t va_mode; /* mode bits. */
89 int va_fsid; /* Not used? */
91 ino_t va_nodeid; /* Inode number */
92 nlink_t va_nlink; /* link count for file. */
93 struct timeval va_atime;
94 struct timeval va_mtime;
95 struct timeval va_ctime;
98 #define VATTR_NULL(A) memset(A, 0, sizeof(struct vattr))
101 /* va_masks - these should match their respective ATTR_xxx #defines in fs.h.
102 * afs_notify_change has to use the attr bits in both the Linux and AFS
103 * meanings. The glue layer code uses the ATTR_xxx style names.
105 #define AT_SIZE ATTR_SIZE
106 #define AT_MODE ATTR_MODE
107 #define AT_UID ATTR_UID
108 #define AT_GID ATTR_GID
109 #define AT_MTIME ATTR_MTIME
112 #define vnodeops inode_operations
114 #endif /* OSI_VFS_H_ */