~ubuntu-branches/ubuntu/karmic/openafs/karmic-updates

« back to all changes in this revision

Viewing changes to src/afs/afs_callback.c

  • Committer: Bazaar Package Importer
  • Author(s): Russ Allbery
  • Date: 2008-09-22 19:07:02 UTC
  • mfrom: (12.1.14 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080922190702-59m13d7kn6gkw32d
Tags: 1.4.7.dfsg1-6
* Apply upstream patch to free /proc entries in the correct order.
  Thanks, Marc Dionne.  (Closes: #493914)
* Apply upstream deltas to support 2.6.27 kernels and to stop using
  COMMON_KERN_CFLAGS for all 2.6 kernels uniformly, which fixes
  problems on amd64 with newer kernels.  Thanks, Björn Torkelsson.
  (LP: #267504)
* Translation updates:
  - Swedish, thanks Martin Bagge.  (Closes: #493120)

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
#include "afs/param.h"
18
18
 
19
19
RCSID
20
 
    ("$Header: /cvs/openafs/src/afs/afs_callback.c,v 1.27.2.6 2006/03/02 06:44:05 shadow Exp $");
 
20
    ("$Header: /cvs/openafs/src/afs/afs_callback.c,v 1.27.2.10 2008/03/10 22:35:33 shadow Exp $");
21
21
 
22
22
#include "afs/sysincludes.h"    /*Standard vendor system headers */
23
23
#include "afsincludes.h"        /*AFS-based standard headers */
61
61
    {
62
62
      "afs_xsrvAddr", (char *)&afs_xsrvAddr},
63
63
    {
64
 
    "afs_xvreclaim", (char *)&afs_xvreclaim}
 
64
      "afs_xvreclaim", (char *)&afs_xvreclaim},
 
65
#ifdef AFS_AFSDB_ENV
 
66
    { "afsdb_client_lock", (char *)&afsdb_client_lock},
 
67
    { "afsdb_req_lock", (char *)&afsdb_req_lock},
 
68
#endif
65
69
};
66
70
unsigned long lastCallBack_vnode;
67
71
unsigned int lastCallBack_dv;
136
140
    a_result->lock.readersReading = tvc->lock.readers_reading;
137
141
    a_result->lock.numWaiting = tvc->lock.num_waiting;
138
142
#if defined(INSTRUMENT_LOCKS)
139
 
    a_result->lock.pid_last_reader = tvc->lock.pid_last_reader;
140
 
    a_result->lock.pid_writer = tvc->lock.pid_writer;
 
143
    a_result->lock.pid_last_reader = MyPidxx2Pid(tvc->lock.pid_last_reader);
 
144
    a_result->lock.pid_writer = MyPidxx2Pid(tvc->lock.pid_writer);
141
145
    a_result->lock.src_indicator = tvc->lock.src_indicator;
142
146
#else
143
147
    /* On osf20 , the vcache does not maintain these three fields */
222
226
    a_result->lock.readersReading = tvc->lock.readers_reading;
223
227
    a_result->lock.numWaiting = tvc->lock.num_waiting;
224
228
#if defined(INSTRUMENT_LOCKS)
225
 
    a_result->lock.pid_last_reader = tvc->lock.pid_last_reader;
226
 
    a_result->lock.pid_writer = tvc->lock.pid_writer;
 
229
    a_result->lock.pid_last_reader = MyPidxx2Pid(tvc->lock.pid_last_reader);
 
230
    a_result->lock.pid_writer = MyPidxx2Pid(tvc->lock.pid_writer);
227
231
    a_result->lock.src_indicator = tvc->lock.src_indicator;
228
232
#else
229
233
    /* On osf20 , the vcache does not maintain these three fields */
307
311
 
308
312
    AFS_STATCNT(SRXAFSCB_GetLock);
309
313
    nentries = sizeof(ltable) / sizeof(struct ltable);
310
 
    if (a_index < 0 || a_index >= nentries) {
 
314
    if (a_index < 0 || a_index >= nentries+afs_cellindex) {
311
315
        /*
312
316
         * Past EOF
313
317
         */
314
318
        code = 1;
 
319
    } else if (a_index >= nentries) {
 
320
        struct cell *tc = afs_GetCellByIndex(a_index-nentries, 0);
 
321
        strcpy(a_result->name, tc->cellName);
 
322
        a_result->lock.waitStates =
 
323
            ((struct afs_lock *)&(tc->lock))->wait_states;
 
324
        a_result->lock.exclLocked =
 
325
            ((struct afs_lock *)&(tc->lock))->excl_locked;
 
326
        a_result->lock.readersReading =
 
327
            ((struct afs_lock *)&(tc->lock))->readers_reading;
 
328
        a_result->lock.numWaiting =
 
329
            ((struct afs_lock *)&(tc->lock))->num_waiting;
 
330
#ifdef INSTRUMENT_LOCKS
 
331
        a_result->lock.pid_last_reader =
 
332
            MyPidxx2Pid(((struct afs_lock *)&(tc->lock))->pid_last_reader);
 
333
        a_result->lock.pid_writer =
 
334
            MyPidxx2Pid(((struct afs_lock *)&(tc->lock))->pid_writer);
 
335
        a_result->lock.src_indicator =
 
336
            ((struct afs_lock *)&(tc->lock))->src_indicator;
 
337
#else
 
338
        a_result->lock.pid_last_reader = 0;
 
339
        a_result->lock.pid_writer = 0;
 
340
        a_result->lock.src_indicator = 0;
 
341
#endif
 
342
        code = 0;
315
343
    } else {
316
344
        /*
317
345
         * Found it - copy out its contents.
328
356
            ((struct afs_lock *)(tl->addr))->num_waiting;
329
357
#ifdef INSTRUMENT_LOCKS
330
358
        a_result->lock.pid_last_reader =
331
 
            ((struct afs_lock *)(tl->addr))->pid_last_reader;
 
359
            MyPidxx2Pid(((struct afs_lock *)(tl->addr))->pid_last_reader);
332
360
        a_result->lock.pid_writer =
333
 
            ((struct afs_lock *)(tl->addr))->pid_writer;
 
361
            MyPidxx2Pid(((struct afs_lock *)(tl->addr))->pid_writer);
334
362
        a_result->lock.src_indicator =
335
363
            ((struct afs_lock *)(tl->addr))->src_indicator;
336
364
#else
981
1009
    /*
982
1010
     * Donate this process to Rx.
983
1011
     */
984
 
    rx_ServerProc();
 
1012
    rx_ServerProc(NULL);
985
1013
    return (0);
986
1014
 
987
1015
}                               /*afs_RXCallBackServer */