OpenAFS
OpenAFS distributed network file system
/cygdrive/c/src/openafs/openafs.git/repo/src/afs/LINUX/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 
00051 /* Various mode bits */
00052 #define VWRITE  S_IWUSR
00053 #define VREAD   S_IRUSR
00054 #define VEXEC   S_IXUSR
00055 #define VSUID   S_ISUID
00056 #define VSGID   S_ISGID
00057 
00058 #define vfs super_block
00059 
00060 typedef struct vattr {
00061     int         va_type;        /* One of v_types above. */
00062     afs_size_t  va_size;
00063     unsigned long va_blocks;
00064     unsigned long va_blocksize;
00065     int         va_mask;        /* AT_xxx operation to perform. */
00066     umode_t     va_mode;        /* mode bits. */
00067     uid_t       va_uid;
00068     gid_t       va_gid;
00069     int         va_fsid;        /* Not used? */
00070     dev_t       va_rdev;
00071     ino_t       va_nodeid;      /* Inode number */
00072     nlink_t     va_nlink;       /* link count for file. */
00073     struct timeval va_atime;
00074     struct timeval va_mtime;
00075     struct timeval va_ctime;
00076 } vattr_t;
00077 
00078 #define VATTR_NULL(A) memset(A, 0, sizeof(struct vattr))
00079 
00080 #ifndef HAVE_LINUX_I_SIZE_READ
00081 #define i_size_read(X) ((X)->i_size)
00082 #define i_size_write(X,Y) (X)->i_size = Y
00083 #endif
00084 
00085 #endif /* OSI_VFS_H_ */
 All Data Structures Files Functions Variables