aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_vnode.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_vnode.h')
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.h26
1 files changed, 7 insertions, 19 deletions
diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h
index 6cb0a01df25d..bc9ed722ba1e 100644
--- a/fs/xfs/linux-2.6/xfs_vnode.h
+++ b/fs/xfs/linux-2.6/xfs_vnode.h
@@ -65,10 +65,6 @@ struct vattr;
65struct xfs_iomap; 65struct xfs_iomap;
66struct attrlist_cursor_kern; 66struct attrlist_cursor_kern;
67 67
68/*
69 * Vnode types. VNON means no type.
70 */
71enum vtype { VNON, VREG, VDIR, VBLK, VCHR, VLNK, VFIFO, VBAD, VSOCK };
72 68
73typedef xfs_ino_t vnumber_t; 69typedef xfs_ino_t vnumber_t;
74typedef struct dentry vname_t; 70typedef struct dentry vname_t;
@@ -77,11 +73,9 @@ typedef bhv_head_t vn_bhv_head_t;
77/* 73/*
78 * MP locking protocols: 74 * MP locking protocols:
79 * v_flag, v_vfsp VN_LOCK/VN_UNLOCK 75 * v_flag, v_vfsp VN_LOCK/VN_UNLOCK
80 * v_type read-only or fs-dependent
81 */ 76 */
82typedef struct vnode { 77typedef struct vnode {
83 __u32 v_flag; /* vnode flags (see below) */ 78 __u32 v_flag; /* vnode flags (see below) */
84 enum vtype v_type; /* vnode type */
85 struct vfs *v_vfsp; /* ptr to containing VFS */ 79 struct vfs *v_vfsp; /* ptr to containing VFS */
86 vnumber_t v_number; /* in-core vnode number */ 80 vnumber_t v_number; /* in-core vnode number */
87 vn_bhv_head_t v_bh; /* behavior head */ 81 vn_bhv_head_t v_bh; /* behavior head */
@@ -93,6 +87,12 @@ typedef struct vnode {
93 /* inode MUST be last */ 87 /* inode MUST be last */
94} vnode_t; 88} vnode_t;
95 89
90#define VN_ISLNK(vp) S_ISLNK((vp)->v_inode.i_mode)
91#define VN_ISREG(vp) S_ISREG((vp)->v_inode.i_mode)
92#define VN_ISDIR(vp) S_ISDIR((vp)->v_inode.i_mode)
93#define VN_ISCHR(vp) S_ISCHR((vp)->v_inode.i_mode)
94#define VN_ISBLK(vp) S_ISBLK((vp)->v_inode.i_mode)
95
96#define v_fbhv v_bh.bh_first /* first behavior */ 96#define v_fbhv v_bh.bh_first /* first behavior */
97#define v_fops v_bh.bh_first->bd_ops /* first behavior ops */ 97#define v_fops v_bh.bh_first->bd_ops /* first behavior ops */
98 98
@@ -133,17 +133,6 @@ typedef enum {
133#define LINVFS_GET_IP(vp) (&(vp)->v_inode) 133#define LINVFS_GET_IP(vp) (&(vp)->v_inode)
134 134
135/* 135/*
136 * Convert between vnode types and inode formats (since POSIX.1
137 * defines mode word of stat structure in terms of inode formats).
138 */
139extern enum vtype iftovt_tab[];
140extern u_short vttoif_tab[];
141#define IFTOVT(mode) (iftovt_tab[((mode) & S_IFMT) >> 12])
142#define VTTOIF(indx) (vttoif_tab[(int)(indx)])
143#define MAKEIMODE(indx, mode) (int)(VTTOIF(indx) | (mode))
144
145
146/*
147 * Vnode flags. 136 * Vnode flags.
148 */ 137 */
149#define VINACT 0x1 /* vnode is being inactivated */ 138#define VINACT 0x1 /* vnode is being inactivated */
@@ -408,7 +397,6 @@ typedef struct vnodeops {
408 */ 397 */
409typedef struct vattr { 398typedef struct vattr {
410 int va_mask; /* bit-mask of attributes present */ 399 int va_mask; /* bit-mask of attributes present */
411 enum vtype va_type; /* vnode type (for create) */
412 mode_t va_mode; /* file access mode and type */ 400 mode_t va_mode; /* file access mode and type */
413 xfs_nlink_t va_nlink; /* number of references to file */ 401 xfs_nlink_t va_nlink; /* number of references to file */
414 uid_t va_uid; /* owner user id */ 402 uid_t va_uid; /* owner user id */
@@ -498,7 +486,7 @@ typedef struct vattr {
498 * Check whether mandatory file locking is enabled. 486 * Check whether mandatory file locking is enabled.
499 */ 487 */
500#define MANDLOCK(vp, mode) \ 488#define MANDLOCK(vp, mode) \
501 ((vp)->v_type == VREG && ((mode) & (VSGID|(VEXEC>>3))) == VSGID) 489 (VN_ISREG(vp) && ((mode) & (VSGID|(VEXEC>>3))) == VSGID)
502 490
503extern void vn_init(void); 491extern void vn_init(void);
504extern int vn_wait(struct vnode *); 492extern int vn_wait(struct vnode *);