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
10 #ifndef AFS_AFSSYSCALLS_H
11 #define AFS_AFSSYSCALLS_H
15 /* Declare Inode type. */
16 #include <afs/param.h>
18 #include <sys/types.h>
20 typedef afs_uint64 Inode;
22 typedef u_int64_t Inode;
24 #else /* AFS_NAMEI_ENV */
25 #ifdef AFS_64BIT_IOPS_ENV
27 typedef uint64_t Inode;
29 error Need 64 bit Inode defined.
30 #endif /* AFS_SGI62_ENV */
31 #else /* AFS_64BIT_IOPS_ENV */
32 typedef unsigned int Inode;
36 extern FILE *inode_debug_log;
37 #define AFS_DEBUG_IOPS_LOG(F) (inode_debug_log = (F))
39 #define AFS_DEBUG_IOPS_LOG(F)
42 /* Declarations for inode system calls. */
43 #ifdef AFS_SGI_XFS_IOPS_ENV
44 extern uint64_t icreatename64(int dev, char *partname, int p0, int p1, int p2,
46 extern int iopen64(int dev, uint64_t inode, int usrmod);
47 extern int iinc64(int dev, uint64_t inode, int inode_p1);
48 extern int idec64(int dev, uint64_t inode, int inode_p1);
49 extern int ilistinode64(int dev, uint64_t inode, void *data, int *datalen);
52 extern uint64_t debug_icreatename64(int dev, char *partname, int p0, int p1,
53 int p2, int p3, char *file, int line);
54 extern int debug_iopen64(int dev, uint64_t inode, int usrmod, char *file,
56 extern int debug_iinc64(int dev, uint64_t inode, int inode_p1, char *file,
58 extern int debug_idec64(int dev, uint64_t inode, int inode_p1, char *file,
61 #endif /* AFS_DEBUG_IOPS */
62 #endif /* AFS_SGI_XFS_IOPS_ENV */
64 #ifdef AFS_64BIT_IOPS_ENV
65 extern int inode_read(int dev, Inode inode, int inode_p1, uint32_t offset,
66 char *cbuf, uint32_t count);
67 extern int inode_write(int dev, Inode inode, int inode_p1, uint32_t offset,
68 char *cbuf, uint32_t count);
70 extern int inode_read();
71 extern int inode_write();
74 #ifdef AFS_SGI_VNODE_GLUE
75 /* flag: 1 = has NUMA, 0 = no NUMA, -1 = kernel decides. */
76 extern int afs_init_kernel_config(int flag);
77 #endif /* AFS_SGI_VNODE_GLUE */
79 #endif /* AFS_NAMEI_ENV */
82 /* minimum size of string to hand to PrintInode */
83 #define AFS_INO_STR_LENGTH 32
84 typedef char afs_ino_str_t[AFS_INO_STR_LENGTH];
86 /* Print either 32 or 64 bit inode numbers. char * may be NULL. In which case
87 * a local statis is returned.
89 #ifdef AFS_64BIT_IOPS_ENV
90 extern char *PrintInode(afs_ino_str_t, Inode);
92 extern char *PrintInode();
95 /* Some places in the code assume icreate can return 0 when there's
98 #define VALID_INO(I) ((I) != (Inode)-1 && (I) != (Inode)0)
100 #ifndef AFS_NAMEI_ENV
102 /* Definitions of inode macros. */
103 #ifdef AFS_SGI_XFS_IOPS_ENV
104 #ifdef AFS_DEBUG_IOPS
105 #define ICREATE(DEV, NAME, NI, P0, P1, P2, P3) \
106 debug_icreatename64(DEV, NAME, P0, P1, P2, P3, __FILE__, __LINE__)
107 #define IDEC(DEV, INO, VID) debug_idec64(DEV, INO, VID, __FILE__, __LINE__)
108 #define IINC(DEV, INO, VID) debug_iinc64(DEV, INO, VID, __FILE__, __LINE__)
109 #define IOPEN(DEV, INO, MODE) debug_iopen64(DEV, INO, MODE, __FILE__, __LINE__)
111 #define ICREATE(DEV, NAME, NI, P0, P1, P2, P3) \
112 icreatename64(DEV, NAME, P0, P1, P2, P3)
113 #define IDEC(DEV, INO, VID) idec64(DEV, INO, VID)
114 #define IINC(DEV, INO, VID) iinc64(DEV, INO, VID)
115 #define IOPEN(DEV, INO, MODE) iopen64(DEV, INO, MODE)
117 #define AFS_IOPS_DEFINED 1
118 #endif /* AFS_SGI_IOPS_ENV */
121 #ifndef AFS_IOPS_DEFINED
122 #ifdef AFS_DEBUG_IOPS
124 #define ICREATE(DEV, NAME, NI, P0, P1, P2, P3) \
125 icreate(DEV, NI, P0, P1, P2, P3)
126 #define IDEC(DEV, INO, VID) idec(DEV, INO, VID)
127 #define IINC(DEV, INO, VID) iinc(DEV, INO, VID)
128 #define IOPEN(DEV, INO, MODE) iopen(DEV, INO, MODE)
130 #endif /* AFS_IOPS_DEFINED */
133 #endif /* AFS_NAMEI_ENV */
135 #endif /* AFS_NT40_ENV */
137 #endif /* AFS_AFSSYSCALLS_H */