source: gpfs_3.1_ker2.6.20/lpp/mmfs/src/ibm-kxi/LockNames.h @ 73

Last change on this file since 73 was 16, checked in by rock, 17 years ago
File size: 10.6 KB
Line 
1/***************************************************************************
2 *
3 * Copyright (C) 2001 International Business Machines
4 * All rights reserved.
5 *
6 * This file is part of the GPFS mmfslinux kernel module.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 *  1. Redistributions of source code must retain the above copyright notice,
13 *     this list of conditions and the following disclaimer.
14 *  2. Redistributions in binary form must reproduce the above copyright
15 *     notice, this list of conditions and the following disclaimer in the
16 *     documentation and/or other materials provided with the distribution.
17 *  3. The name of the author may not be used to endorse or promote products
18 *     derived from this software without specific prior written
19 *     permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
30 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 *************************************************************************** */
33/* @(#)02       1.4.1.1  src/avs/fs/mmfs/ts/kernext/ibm-kxi/LockNames.h, mmfs, avs_rgpfs24, rgpfs24s005a 7/13/06 18:22:26 */
34
35/*
36 * Lock classes for simple locks.  Many of these are defined in
37 * /usr/include/sys/lockname.h on AIX, but are defined here in case the
38 * latest version isn't installed.
39 *
40 * $Id: LockNames.h,v 1.6.4.1 2006/07/13 23:07:31 mcnabb Exp $
41 *
42 * $Log: LockNames.h,v $
43 * Revision 1.6.4.1  2006/07/13 23:07:31  mcnabb
44 * Fcntl fairness (Montrada DCR 2): fcntlMutex lockname.
45 *
46 * Revision 1.6  2006/03/10 06:30:22  schmuck
47 * Prune check-in history.  No code change.
48 *
49 * [ 14 log messages deleted ]
50 *
51 * Revision 1.1  2000/10/25  16:52:27  wyllie
52 * Trace include reorganization: split old tasking/Trace.h into five new
53 * files, and move most of them into directories that will be shipped with
54 * GPFS on Linux.  Also change the code in trcid.h files generated by
55 * mktrace to not include AIX specific stuff like direct use of AIX trace
56 * macros.  Change names of all macros in generated code to have a leading
57 * underscore.  As a result of these changes, all trcid.h files had to
58 * be rebuilt.
59 *
60 */
61
62#ifndef _h_LockNames
63#define _h_LockNames
64
65#ifdef GPFS_AIX
66#include <sys/lockname.h>
67#endif
68
69/* The AIX names for these locks need to be the discontiguous numbers
70   assigned in sys/lockname.h.  To keep statistics for each lock class,
71   each lock class must have an index that is a small integer from a
72   contiguous range.  Thus, there are two defines for each lock class:
73   the AIX lock name (GPFS_LOCK_xxx) and the table index
74   (GPFS_LOCK_xxx_IDX).  To add a new lock class, add both defines and
75   add the string name of the lock to the KernelLockNamePP table below. */
76
77//#ifndef GPFS_LOCK_BRL
78//#define GPFS_LOCK_BRL             607     /* GPFS */
79//#endif
80
81//#ifndef GPFS_LOCK_LKOBJWAIT
82//#define GPFS_LOCK_LKOBJWAIT       608     /* GPFS */
83//#endif
84
85#ifndef GPFS_LOCK_PUD
86#define GPFS_LOCK_PUD               609     /* GPFS */
87#endif
88#define GPFS_LOCK_PUD_IDX             0
89
90#ifndef GPFS_LOCK_RL
91#define GPFS_LOCK_RL                610     /* GPFS */
92#endif
93#define GPFS_LOCK_RL_IDX              1
94
95#ifndef GPFS_LOCK_RLSLEEPER
96#define GPFS_LOCK_RLSLEEPER         611     /* GPFS */
97#endif
98#define GPFS_LOCK_RLSLEEPER_IDX       2
99
100#ifndef GPFS_LOCK_PINTABLE
101#define GPFS_LOCK_PINTABLE          612     /* GPFS */
102#endif
103#define GPFS_LOCK_PINTABLE_IDX        3
104
105//#ifndef GPFS_LOCK_MB
106//#define GPFS_LOCK_MB              613     /* GPFS */
107//#endif
108
109#ifndef GPFS_LOCK_VINFOACC
110#define GPFS_LOCK_VINFOACC          614     /* GPFS */
111#endif
112#define GPFS_LOCK_VINFOACC_IDX        4
113
114//#ifndef GPFS_LOCK_VINFOINT
115//#define GPFS_LOCK_VINFOINT        615     /* GPFS */
116//#endif
117
118//#ifndef GPFS_LOCK_MMFSNODE
119//#define GPFS_LOCK_MMFSNODE        616     /* GPFS */
120//#endif
121
122#ifndef GPFS_LOCK_GPFSNODE
123#define GPFS_LOCK_GPFSNODE          616     /* GPFS */
124#endif
125#define GPFS_LOCK_GPFSNODE_IDX        5
126
127//#ifndef GPFS_LOCK_COMMONRL
128//#define GPFS_LOCK_COMMONRL        617     /* GPFS */
129//#endif
130
131#ifndef GPFS_LOCK_TSBUF
132#define GPFS_LOCK_TSBUF             618     /* GPFS */
133#endif
134#define GPFS_LOCK_TSBUF_IDX           6
135
136//#ifndef GPFS_LOCK_LOOKUP
137//#define GPFS_LOCK_LOOKUP          619     /* GPFS */
138//#endif
139
140#ifndef GPFS_LOCK_NFS
141#define GPFS_LOCK_NFS               620     /* GPFS */
142#endif
143#define GPFS_LOCK_NFS_IDX             7
144
145#ifndef GPFS_LOCK_MOUNTS
146#define GPFS_LOCK_MOUNTS            621     /* GPFS */
147#endif
148#define GPFS_LOCK_MOUNTS_IDX          8
149
150//#ifndef GPFS_LOCK_NEEDRESV
151//#define GPFS_LOCK_NEEDRESV        622     /* GPFS */
152//#endif
153
154#ifndef GPFS_LOCK_SHSEG
155#define GPFS_LOCK_SHSEG             623     /* GPFS */
156#endif
157#define GPFS_LOCK_SHSEG_IDX           9
158
159#ifndef GPFS_LOCK_KSYNCH
160#define GPFS_LOCK_KSYNCH            624     /* GPFS */
161#endif
162#define GPFS_LOCK_KSYNCH_IDX         10
163
164
165/* These haven't yet been added to /usr/include/sys/lockname.h */
166
167#ifndef GPFS_LOCK_PAGER
168#define GPFS_LOCK_PAGER            1019    /* GPFS */
169#endif
170#define GPFS_LOCK_PAGER_IDX          11
171
172#ifndef GPFS_LOCK_SHMEM
173#define GPFS_LOCK_SHMEM            1020    /* GPFS */
174#endif
175#define GPFS_LOCK_SHMEM_IDX          12
176
177#ifndef GPFS_LOCK_GPFSNODEHASH
178#define GPFS_LOCK_GPFSNODEHASH     1021    /* GPFS */
179#endif
180#define GPFS_LOCK_GPFSNODEHASH_IDX   13
181
182#ifndef GPFS_LOCK_MMAP
183#define GPFS_LOCK_MMAP             1022    /* GPFS */
184#endif
185#define GPFS_LOCK_MMAP_IDX           14
186
187#ifndef GPFS_LOCK_DIO
188#define GPFS_LOCK_DIO              1023    /* GPFS */
189#endif
190#define GPFS_LOCK_DIO_IDX            15
191
192#ifndef GPFS_LOCK_STRATIO
193#define GPFS_LOCK_STRATIO          1024    /* GPFS */
194#endif
195#define GPFS_LOCK_STRATIO_IDX        16
196
197#ifndef GPFS_LOCK_KPROC
198#define GPFS_LOCK_KPROC            1025    /* GPFS */
199#endif
200#define GPFS_LOCK_KPROC_IDX          17
201
202#ifndef GPFS_LOCK_MEMPOOL
203#define GPFS_LOCK_MEMPOOL          1026    /* GPFS */
204#endif
205#define GPFS_LOCK_MEMPOOL_IDX        18
206
207//#ifndef GPFS_LOCK_DFS_INTEROP
208//#define GPFS_LOCK_DFS_INTEROP    1027    /* GPFS */
209//#endif
210
211#ifndef GPFS_LOCK_RL_SLEEP
212#define GPFS_LOCK_RL_SLEEP         1028    /* GPFS */
213#endif
214#define GPFS_LOCK_RL_SLEEP_IDX       19
215
216#ifndef GPFS_LOCK_VINFO
217#define GPFS_LOCK_VINFO            1029    /* GPFS */
218#endif
219#define GPFS_LOCK_VINFO_IDX          20
220
221#ifndef GPFS_LOCK_MMAP_FLUSH
222#define GPFS_LOCK_MMAP_FLUSH       1030    /* GPFS */
223#endif
224#define GPFS_LOCK_MMAP_FLUSH_IDX     21
225
226//#ifndef GPFS_LOCK_SMBINTEROP
227//#define GPFS_LOCK_SMBINTEROP     1031    /* GPFS */
228//#endif
229
230#ifndef GPFS_LOCK_NFSKPROC_DONE
231#define GPFS_LOCK_NFSKPROC_DONE    1032    /* GPFS */
232#endif
233#define GPFS_LOCK_NFSKPROC_DONE_IDX  22
234
235#ifndef GPFS_LOCK_SWAPD
236#define GPFS_LOCK_SWAPD            1033    /* GPFS */
237#endif
238#define GPFS_LOCK_SWAPD_IDX          23
239
240#ifndef GPFS_LOCK_MMAP_FREEQ
241#define GPFS_LOCK_MMAP_FREEQ       1034    /* GPFS */
242#endif
243#define GPFS_LOCK_MMAP_FREEQ_IDX     24
244
245#ifndef GPFS_LOCK_FCNTL_OPS
246#define GPFS_LOCK_FCNTL_OPS        1035    /* GPFS */
247#endif
248#define GPFS_LOCK_FCNTL_OPS_IDX      25
249
250/* Update MAX_GPFS_LOCK_NAMES if add too many more locks */
251
252
253#ifdef GPFS_AIX
254#ifdef _KERNEL
255/* Array that maps lock name indeces to AIX lock names */
256EXTERNC int LockIndexToAIXName[];
257
258#ifdef DEFINE_LOCK_INDEX_TO_AIX_NAME_TABLE
259int LockIndexToAIXName[] =
260{
261  GPFS_LOCK_PUD,
262  GPFS_LOCK_RL,
263  GPFS_LOCK_RLSLEEPER,
264  GPFS_LOCK_PINTABLE,
265  GPFS_LOCK_VINFOACC,
266  GPFS_LOCK_GPFSNODE,
267  GPFS_LOCK_TSBUF,
268  GPFS_LOCK_NFS,
269  GPFS_LOCK_MOUNTS,
270  GPFS_LOCK_SHSEG,
271  GPFS_LOCK_KSYNCH,
272  GPFS_LOCK_PAGER,
273  GPFS_LOCK_SHMEM,
274  GPFS_LOCK_GPFSNODEHASH,
275  GPFS_LOCK_MMAP,
276  GPFS_LOCK_DIO,
277  GPFS_LOCK_STRATIO,
278  GPFS_LOCK_KPROC,
279  GPFS_LOCK_MEMPOOL,
280  GPFS_LOCK_RL_SLEEP,
281  GPFS_LOCK_VINFO,
282  GPFS_LOCK_MMAP_FLUSH,
283  GPFS_LOCK_NFSKPROC_DONE,
284  GPFS_LOCK_SWAPD,
285  GPFS_LOCK_MMAP_FREEQ,
286  GPFS_LOCK_FCNTL_OPS
287};
288#endif  /* DEFINE_LOCK_INDEX_TO_NAME_TABLE */
289#endif  /* _KERNEL */
290#endif  /* GPFS_AIX */
291
292
293#ifdef INSTRUMENT_LOCKS
294#ifdef DEFINE_KERNEL_LOCK_NAMES
295/* Lock name table.  Must be kept in synch with the lock name indices above. */
296char* KernelLockNamePP[] =
297{
298  "Page usage decl",                    // GPFS_LOCK_PUD_IDX             0
299  "Rec lock",                           // GPFS_LOCK_RL_IDX              1
300  "Rec lock sleeper",                   // GPFS_LOCK_RLSLEEPER_IDX       2
301  "Pin table",                          // GPFS_LOCK_PINTABLE_IDX        3
302  "Vinfo access",                       // GPFS_LOCK_VINFOACC_IDX        4
303  "gpfsNode",                           // GPFS_LOCK_GPFSNODE_IDX        5
304  "tsBufLock",                          // GPFS_LOCK_TSBUF_IDX           6
305  "NFS",                                // GPFS_LOCK_NFS_IDX             7
306  "Mount list",                         // GPFS_LOCK_MOUNTS_IDX          8
307  "Shared segment",                     // GPFS_LOCK_SHSEG_IDX           9
308  "Kernel synch state",                 // GPFS_LOCK_KSYNCH_IDX         10
309  "pagerLock",                          // GPFS_LOCK_PAGER_IDX          11
310  "Shared Memory Alloc/Delete",         // GPFS_LOCK_SHMEM_IDX          12
311  "gpfsNode hash",                      // GPFS_LOCK_GPFSNODEHASH_IDX   13
312  "MMAP",                               // GPFS_LOCK_MMAP_IDX           14
313  "Direct I/O",                         // GPFS_LOCK_DIO_IDX            15
314  "I/O",                                // GPFS_LOCK_STRATIO_IDX        16
315  "MMAP kproc",                         // GPFS_LOCK_KPROC_IDX          17
316  "MemPool",                            // GPFS_LOCK_MEMPOOL_IDX        18
317  "Rec lock sleep",                     // GPFS_LOCK_RL_SLEEP_IDX       19
318  "Vinfo list",                         // GPFS_LOCK_VINFO_IDX          20
319  "MMAP flush",                         // GPFS_LOCK_MMAP_FLUSH_IDX     21
320  "NFS kproc done",                     // GPFS_LOCK_NFSKPROC_DONE_IDX  22
321  "Swapd",                              // GPFS_LOCK_SWAPD_IDX          23
322  "MMAP free queue",                    // GPFS_LOCK_MMAP_FREEQ_IDX     24
323  "fcntl operation",                    // GPFS_LOCK_FCNTL_OPS_IDX      25
324  ""
325};
326#endif  /* DEFINE_KERNEL_LOCK_NAMES */
327#endif  /* INSTRUMENT_LOCKS */
328
329#endif  /* h_LockNames */
Note: See TracBrowser for help on using the repository browser.