OpenAFS
OpenAFS distributed network file system
/cygdrive/c/src/openafs/openafs.git/repo/src/afs/LINUX24/osi_vfs.h
00001 /*
00002  * Copyright 2000, International Business Machines Corporation and others.
00003  * All Rights Reserved.
00004  *
00005  * This software has been released under the terms of the IBM Public
00006  * License.  For details, see the LICENSE file in the top-level source
00007  * directory or online at http://www.openafs.org/dl/license10.html
00008  */
00009 
00010 /*
00011  * Linux interpretations of vnode and vfs structs.
00012  */
00013 
00014 #ifndef OSI_VFS_H_
00015 #define OSI_VFS_H_
00016 
00017 typedef struct inode vnode_t;
00018 #define vnode inode
00019 
00020 /* Map vnode fields to inode fields */
00021 #define i_number        i_ino
00022 #define v_count         i_count
00023 #define v_op            i_op
00024 #define v_fop           i_fop
00025 #define v_type          i_mode
00026 #define v_vfsp          i_sb
00027 #define v_data          u.generic_ip
00028 
00029 /* v_type bits map to mode bits */
00030 #define VNON 0
00031 #define VREG S_IFREG
00032 #define VDIR S_IFDIR
00033 #define VBLK S_IFBLK
00034 #define VCHR S_IFCHR
00035 #define VLNK S_IFLNK
00036 #define VSOCK S_IFSOCK
00037 #define VFIFO S_IFIFO
00038 
00039 /* vcexcl - used only by afs_create */
00040 enum vcexcl { EXCL, NONEXCL } ;
00041 
00042 /* afs_open and afs_close needs to distinguish these cases */
00043 #define FWRITE  O_WRONLY|O_RDWR|O_APPEND
00044 #define FTRUNC  O_TRUNC
00045 
00046 #define IO_APPEND O_APPEND
00047 #define FSYNC O_SYNC
00048 
00049 #define VTOI(V) (V)
00050 #define VFS_STATFS(V, S) ((V)->s_op->statfs)((V), (S), sizeof(*(S)))
00051 
00052 /* Various mode bits */
00053 #define VWRITE  S_IWUSR
00054 #define VREAD   S_IRUSR
00055 #define VEXEC   S_IXUSR
00056 #define VSUID   S_ISUID
00057 #define VSGID   S_ISGID
00058 
00059 #define vfs super_block
00060 
00061 typedef struct vattr {
00062     int         va_type;        /* One of v_types above. */
00063     afs_size_t  va_size;
00064     unsigned long va_blocks;
00065     unsigned long va_blocksize;
00066     int         va_mask;        /* AT_xxx operation to perform. */
00067     umode_t     va_mode;        /* mode bits. */
00068     uid_t       va_uid;
00069     gid_t       va_gid;
00070     int         va_fsid;        /* Not used? */
00071     dev_t       va_rdev;
00072     ino_t       va_nodeid;      /* Inode number */
00073     nlink_t     va_nlink;       /* link count for file. */
00074     struct timeval va_atime;
00075     struct timeval va_mtime;
00076     struct timeval va_ctime;
00077 } vattr_t;
00078 
00079 #define VATTR_NULL(A) memset(A, 0, sizeof(struct vattr))
00080 
00081 #ifndef HAVE_LINUX_I_SIZE_READ
00082 #define i_size_read(X) ((X)->i_size)
00083 #define i_size_write(X,Y) (X)->i_size = Y
00084 #endif
00085 
00086 #endif /* OSI_VFS_H_ */
 All Data Structures Files Functions Variables