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
15 #include <afsconfig.h>
16 #include "afs/param.h"
19 #include "afs/sysincludes.h" /* Standard vendor system headers */
20 #include "afsincludes.h" /* Afs-based standard headers */
21 #include <sys/namei.h>
24 /* serious cheating */
26 #define curproc curthread
30 osi_lookupname(char *aname, enum uio_seg seg, int followlink,
34 int flags, error, glocked;
37 glocked = ISAFS_GLOCK();
49 flags |= MPSAFE; /* namei must take GIANT if needed */
51 NDINIT(&n, LOOKUP, flags, seg, aname, curproc);
52 if ((error = namei(&n)) != 0) {
60 /* XXX should we do this? Usually NOT (matt) */
61 #if defined(AFS_FBSD80_ENV)
62 /*VOP_UNLOCK(n.ni_vp, 0);*/
63 #elif defined(AFS_FBSD50_ENV)
64 VOP_UNLOCK(n.ni_vp, 0, curthread);
66 VOP_UNLOCK(n.ni_vp, 0, curproc);
68 NDFREE(&n, NDF_ONLY_PNBUF);
77 * does not implement security features of kern_time.c:settime()
80 afs_osi_SetTime(osi_timeval_t * atv)
83 printf("afs attempted to set clock; use \"afsd -nosettime\"\n");
86 struct timeval tv, delta;
93 timevalsub(&delta, &tv);
94 ts.tv_sec = atv->tv_sec;
95 ts.tv_nsec = atv->tv_usec * 1000;
98 lease_updatetime(delta.tv_sec);
106 * Replace all of the bogus special-purpose memory allocators...
109 osi_fbsd_alloc(size_t size, int dropglobal)
112 #ifdef AFS_FBSD50_ENV
116 glocked = ISAFS_GLOCK();
119 rv = malloc(size, M_AFS, M_WAITOK);
124 rv = malloc(size, M_AFS, M_NOWAIT);
130 osi_fbsd_free(void *p)