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
17 #include <afsconfig.h>
18 #include "afs/param.h"
21 #include "afs/sysincludes.h" /* Standard vendor system headers */
22 #include "afsincludes.h" /* Afs-based standard headers */
23 #include <sys/namei.h>
26 /* serious cheating */
28 #define curproc curthread
32 osi_lookupname(char *aname, enum uio_seg seg, int followlink,
36 int flags, error, glocked;
39 glocked = ISAFS_GLOCK();
51 flags |= MPSAFE; /* namei must take GIANT if needed */
53 NDINIT(&n, LOOKUP, flags, seg, aname, curproc);
54 if ((error = namei(&n)) != 0) {
62 /* XXX should we do this? Usually NOT (matt) */
63 #if defined(AFS_FBSD80_ENV)
64 /*VOP_UNLOCK(n.ni_vp, 0);*/
65 #elif defined(AFS_FBSD50_ENV)
66 VOP_UNLOCK(n.ni_vp, 0, curthread);
68 VOP_UNLOCK(n.ni_vp, 0, curproc);
70 NDFREE(&n, NDF_ONLY_PNBUF);
79 * does not implement security features of kern_time.c:settime()
82 afs_osi_SetTime(osi_timeval_t * atv)
85 printf("afs attempted to set clock; use \"afsd -nosettime\"\n");
88 struct timeval tv, delta;
95 timevalsub(&delta, &tv);
96 ts.tv_sec = atv->tv_sec;
97 ts.tv_nsec = atv->tv_usec * 1000;
100 lease_updatetime(delta.tv_sec);
108 * Replace all of the bogus special-purpose memory allocators...
111 osi_fbsd_alloc(size_t size, int dropglobal)
114 #ifdef AFS_FBSD50_ENV
118 glocked = ISAFS_GLOCK();
121 rv = malloc(size, M_AFS, M_WAITOK);
126 rv = malloc(size, M_AFS, M_NOWAIT);
132 osi_fbsd_free(void *p)