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
14 * afs_StoreOnLastReference
19 #include <afsconfig.h>
20 #include "afs/param.h"
23 #include "afs/sysincludes.h" /* Standard vendor system headers */
24 #include "afsincludes.h" /* Afs-based standard headers */
25 #include "afs/afs_stats.h" /* statistics */
26 #include "afs/afs_cbqueue.h"
27 #include "afs/nfsclient.h"
28 #include "afs/afs_osidnlc.h"
31 extern unsigned char *afs_indexFlags;
33 /* Called by all write-on-close routines: regular afs_close,
34 * store via background daemon and store via the
35 * afs_FlushActiveVCaches routine (when CCORE is on).
36 * avc->lock must be write-locked.
39 afs_StoreOnLastReference(struct vcache *avc,
40 struct vrequest *treq)
44 AFS_STATCNT(afs_StoreOnLastReference);
45 /* if CCore flag is set, we clear it and do the extra decrement
46 * ourselves now. If we're called by the CCore clearer, the CCore
47 * flag will already be clear, so we don't have to worry about
48 * clearing it twice. */
49 if (avc->f.states & CCore) {
52 avc->f.states &= ~CCore;
53 #if defined(AFS_SGI_ENV)
54 osi_Assert(avc->opens > 0 && avc->execsOrWriters > 0);
56 /* WARNING: Our linux cm code treats the execsOrWriters counter differently
57 * depending on the flags the file was opened with. So, if you make any
58 * changes to the way the execsOrWriters flag is handled check with the
61 avc->execsOrWriters--;
62 AFS_RELE(AFSTOV(avc)); /* VN_HOLD at set CCore(afs_FakeClose) */
63 cred = (afs_ucred_t *)avc->linkData; /* "crheld" in afs_FakeClose */
68 if (!AFS_IS_DISCONNECTED) {
71 /* Now, send the file back. Used to require 0 writers left, but now do
72 * it on every close for write, since two closes in a row are harmless
73 * since first will clean all chunks, and second will be noop. Note that
74 * this will also save confusion when someone keeps a file open
75 * inadvertently, since with old system, writes to the server would never
78 code = afs_StoreAllSegments(avc, treq, AFS_LASTSTORE /*!sync-to-disk */ );
80 * We have to do these after the above store in done: in some systems
81 * like aix they'll need to flush all the vm dirty pages to the disk via
82 * the strategy routine. During that all procedure (done under no avc
83 * locks) opens, refcounts would be zero, since it didn't reach the
84 * afs_{rd,wr} routines which means the vcache is a perfect candidate
87 } else if (AFS_IS_DISCON_RW) {
88 afs_DisconAddDirty(avc, VDisconWriteClose, 0);
89 } /* if not disconnected */
91 #if defined(AFS_SGI_ENV)
92 osi_Assert(avc->opens > 0 && avc->execsOrWriters > 0);
96 avc->execsOrWriters--;
101 afs_UFSWriteUIO(struct vcache *avc, afs_dcache_id_t *inode, struct uio *tuiop)
103 struct osi_file *tfile;
106 tfile = (struct osi_file *)osi_UFSOpen(inode);
110 #if defined(AFS_AIX41_ENV)
112 code = VNOP_RDWR(tfile->vnode, UIO_WRITE, FWRITE, tuiop, NULL, NULL,
113 NULL, afs_osi_credp);
115 #elif defined(AFS_AIX32_ENV)
116 code = VNOP_RDWR(tfile->vnode, UIO_WRITE, FWRITE, tuiop, NULL, NULL);
117 #elif defined(AFS_AIX_ENV)
118 code = VNOP_RDWR(tfile->vnode, UIO_WRITE, FWRITE, (off_t) &offset,
119 tuiop, NULL, NULL, -1);
120 #elif defined(AFS_SUN5_ENV)
122 # ifdef AFS_SUN510_ENV
126 VOP_RWLOCK(tfile->vnode, 1, &ct);
127 code = VOP_WRITE(tfile->vnode, tuiop, 0, afs_osi_credp, &ct);
128 VOP_RWUNLOCK(tfile->vnode, 1, &ct);
131 VOP_RWLOCK(tfile->vnode, 1);
132 code = VOP_WRITE(tfile->vnode, tuiop, 0, afs_osi_credp);
133 VOP_RWUNLOCK(tfile->vnode, 1);
138 ("\n\n\n*** Cache partition is full - decrease cachesize!!! ***\n\n\n");
139 #elif defined(AFS_SGI_ENV)
141 avc->f.states |= CWritingUFS;
142 AFS_VOP_RWLOCK(tfile->vnode, VRWLOCK_WRITE);
143 AFS_VOP_WRITE(tfile->vnode, tuiop, IO_ISLOCKED, afs_osi_credp, code);
144 AFS_VOP_RWUNLOCK(tfile->vnode, VRWLOCK_WRITE);
145 avc->f.states &= ~CWritingUFS;
147 #elif defined(AFS_HPUX100_ENV)
150 code = VOP_RDWR(tfile->vnode, tuiop, UIO_WRITE, 0, afs_osi_credp);
153 #elif defined(AFS_LINUX20_ENV)
155 code = osi_rdwr(tfile, tuiop, UIO_WRITE);
157 #elif defined(AFS_DARWIN80_ENV)
159 code = VNOP_WRITE(tfile->vnode, tuiop, 0, afs_osi_ctxtp);
161 #elif defined(AFS_DARWIN_ENV)
163 VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, current_proc());
164 code = VOP_WRITE(tfile->vnode, tuiop, 0, afs_osi_credp);
165 VOP_UNLOCK(tfile->vnode, 0, current_proc());
167 #elif defined(AFS_FBSD80_ENV)
169 VOP_LOCK(tfile->vnode, LK_EXCLUSIVE);
170 code = VOP_WRITE(tfile->vnode, tuiop, 0, afs_osi_credp);
171 VOP_UNLOCK(tfile->vnode, 0);
173 #elif defined(AFS_FBSD_ENV)
175 VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, curthread);
176 code = VOP_WRITE(tfile->vnode, tuiop, 0, afs_osi_credp);
177 VOP_UNLOCK(tfile->vnode, 0, curthread);
179 #elif defined(AFS_NBSD_ENV)
181 VOP_LOCK(tfile->vnode, LK_EXCLUSIVE);
182 code = VOP_WRITE(tfile->vnode, tuiop, 0, afs_osi_credp);
183 #if defined(AFS_NBSD60_ENV)
184 VOP_UNLOCK(tfile->vnode);
186 VOP_UNLOCK(tfile->vnode, 0);
189 #elif defined(AFS_XBSD_ENV)
191 VOP_LOCK(tfile->vnode, LK_EXCLUSIVE, curproc);
192 code = VOP_WRITE(tfile->vnode, tuiop, 0, afs_osi_credp);
193 VOP_UNLOCK(tfile->vnode, 0, curproc);
197 tuio.uio_fpflags &= ~FSYNCIO; /* don't do sync io */
199 code = VOP_RDWR(tfile->vnode, tuiop, UIO_WRITE, 0, afs_osi_credp);
206 /* called on writes */
208 afs_write(struct vcache *avc, struct uio *auio, int aio,
209 afs_ucred_t *acred, int noLock)
211 afs_size_t totalLength;
212 afs_size_t transferLength;
214 afs_size_t offset, len;
224 #if defined(AFS_FBSD_ENV) || defined(AFS_DFBSD_ENV)
225 struct vnode *vp = AFSTOV(avc);
227 struct uio *tuiop = NULL;
229 struct vrequest *treq = NULL;
231 AFS_STATCNT(afs_write);
234 return avc->vc_error;
236 if (AFS_IS_DISCONNECTED && !AFS_IS_DISCON_RW)
239 startDate = osi_Time();
240 if ((code = afs_CreateReq(&treq, acred)))
242 /* otherwise we read */
243 totalLength = AFS_UIO_RESID(auio);
244 filePos = AFS_UIO_OFFSET(auio);
247 afs_Trace4(afs_iclSetp, CM_TRACE_WRITE, ICL_TYPE_POINTER, avc,
248 ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(filePos), ICL_TYPE_OFFSET,
249 ICL_HANDLE_OFFSET(totalLength), ICL_TYPE_OFFSET,
250 ICL_HANDLE_OFFSET(avc->f.m.Length));
252 afs_MaybeWakeupTruncateDaemon();
253 ObtainWriteLock(&avc->lock, 556);
255 #if defined(AFS_SGI_ENV)
259 * afs_xwrite handles setting m.Length
260 * and handles APPEND mode.
261 * Since we are called via strategy, we need to trim the write to
262 * the actual size of the file
264 osi_Assert(filePos <= avc->f.m.Length);
265 diff = avc->f.m.Length - filePos;
266 AFS_UIO_SETRESID(auio, MIN(totalLength, diff));
267 totalLength = AFS_UIO_RESID(auio);
270 if (aio & IO_APPEND) {
271 /* append mode, start it at the right spot */
272 #if defined(AFS_SUN5_ENV)
273 auio->uio_loffset = 0;
275 filePos = avc->f.m.Length;
276 AFS_UIO_SETOFFSET(auio, avc->f.m.Length);
280 * Note that we use startDate rather than calling osi_Time() here.
281 * This is to avoid counting lock-waiting time in file date (for ranlib).
283 avc->f.m.Date = startDate;
285 #if defined(AFS_HPUX_ENV)
286 #if defined(AFS_HPUX101_ENV)
287 if ((totalLength + filePos) >> 9 >
288 p_rlimit(u.u_procp)[RLIMIT_FSIZE].rlim_cur) {
290 if ((totalLength + filePos) >> 9 > u.u_rlimit[RLIMIT_FSIZE].rlim_cur) {
293 ReleaseWriteLock(&avc->lock);
294 afs_DestroyReq(treq);
298 #if defined(AFS_VM_RDWR_ENV) && !defined(AFS_FAKEOPEN_ENV)
300 * If write is implemented via VM, afs_FakeOpen() is called from the
301 * high-level write op.
303 if (avc->execsOrWriters <= 0) {
304 afs_warn("WARNING: afs_ufswr vcp=%lx, exOrW=%d\n", (unsigned long)avc,
305 avc->execsOrWriters);
310 avc->f.states |= CDirty;
312 while (totalLength > 0) {
313 tdc = afs_ObtainDCacheForWriting(avc, filePos, totalLength, treq,
319 len = totalLength; /* write this amount by default */
320 offset = filePos - AFS_CHUNKTOBASE(tdc->f.chunk);
321 max = AFS_CHUNKTOSIZE(tdc->f.chunk); /* max size of this chunk */
322 if (max <= len + offset) { /*if we'd go past the end of this chunk */
323 /* it won't all fit in this chunk, so write as much
331 tuiop = afsio_partialcopy(auio, trimlen);
332 AFS_UIO_SETOFFSET(tuiop, offset);
334 code = (*(afs_cacheType->vwriteUIO))(avc, &tdc->f.inode, tuiop);
340 ZapDCE(tdc); /* bad data */
341 cfile = afs_CFileOpen(&tdc->f.inode);
342 afs_CFileTruncate(cfile, 0);
343 afs_CFileClose(cfile);
344 afs_AdjustSize(tdc, 0); /* sets f.chunkSize to 0 */
346 afs_stats_cmperf.cacheCurrDirtyChunks--;
347 afs_indexFlags[tdc->index] &= ~IFDataMod; /* so it does disappear */
348 ReleaseWriteLock(&tdc->lock);
352 /* otherwise we've written some, fixup length, etc and continue with next seg */
353 len = len - AFS_UIO_RESID(tuiop); /* compute amount really transferred */
355 afsio_skip(auio, tlen); /* advance auio over data written */
356 /* compute new file size */
357 if (offset + len > tdc->f.chunkBytes) {
358 afs_int32 tlength = offset + len;
359 afs_AdjustSize(tdc, tlength);
360 if (tdc->validPos < filePos + len)
361 tdc->validPos = filePos + len;
364 transferLength += len;
366 #if defined(AFS_SGI_ENV)
367 /* afs_xwrite handles setting m.Length */
368 osi_Assert(filePos <= avc->f.m.Length);
370 if (filePos > avc->f.m.Length) {
371 if (AFS_IS_DISCON_RW)
372 afs_PopulateDCache(avc, filePos, treq);
373 afs_Trace4(afs_iclSetp, CM_TRACE_SETLENGTH, ICL_TYPE_STRING,
374 __FILE__, ICL_TYPE_LONG, __LINE__, ICL_TYPE_OFFSET,
375 ICL_HANDLE_OFFSET(avc->f.m.Length), ICL_TYPE_OFFSET,
376 ICL_HANDLE_OFFSET(filePos));
377 avc->f.m.Length = filePos;
378 #if defined(AFS_FBSD_ENV) || defined(AFS_DFBSD_ENV)
379 vnode_pager_setsize(vp, filePos);
383 ReleaseWriteLock(&tdc->lock);
385 #if !defined(AFS_VM_RDWR_ENV)
387 * If write is implemented via VM, afs_DoPartialWrite() is called from
388 * the high-level write op.
391 code = afs_DoPartialWrite(avc, treq);
399 #if !defined(AFS_VM_RDWR_ENV) || defined(AFS_FAKEOPEN_ENV)
400 afs_FakeClose(avc, acred);
402 error = afs_CheckCode(error, treq, 7);
403 /* This set is here so we get the CheckCode. */
404 if (error && !avc->vc_error)
405 avc->vc_error = error;
407 ReleaseWriteLock(&avc->lock);
411 #ifndef AFS_VM_RDWR_ENV
413 * If write is implemented via VM, afs_fsync() is called from the high-level
416 #if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
417 if (noLock && (aio & IO_SYNC)) {
420 /* On hpux on synchronous writes syncio will be set to IO_SYNC. If
421 * we're doing them because the file was opened with O_SYNCIO specified,
422 * we have to look in the u area. No single mechanism here!!
424 if (noLock && ((aio & IO_SYNC) | (auio->uio_fpflags & FSYNCIO))) {
426 if (noLock && (aio & FSYNC)) {
429 if (!AFS_NFSXLATORREQ(acred))
430 afs_fsync(avc, acred);
433 afs_DestroyReq(treq);
437 /* do partial write if we're low on unmodified chunks */
439 afs_DoPartialWrite(struct vcache *avc, struct vrequest *areq)
443 if (afs_stats_cmperf.cacheCurrDirtyChunks <=
444 afs_stats_cmperf.cacheMaxDirtyChunks
445 || AFS_IS_DISCONNECTED)
446 return 0; /* nothing to do */
447 /* otherwise, call afs_StoreDCache (later try to do this async, if possible) */
448 afs_Trace2(afs_iclSetp, CM_TRACE_PARTIALWRITE, ICL_TYPE_POINTER, avc,
449 ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->f.m.Length));
451 #if defined(AFS_SUN5_ENV)
452 code = afs_StoreAllSegments(avc, areq, AFS_ASYNC | AFS_VMSYNC_INVAL);
454 code = afs_StoreAllSegments(avc, areq, AFS_ASYNC);
459 /* handle any closing cleanup stuff */
461 #if defined(AFS_SGI65_ENV)
462 afs_close(OSI_VC_DECL(avc), afs_int32 aflags, lastclose_t lastclose,
464 #elif defined(AFS_SGI64_ENV)
465 afs_close(OSI_VC_DECL(avc), afs_int32 aflags, lastclose_t lastclose,
466 off_t offset, afs_ucred_t *acred, struct flid *flp)
467 #elif defined(AFS_SGI_ENV)
468 afs_close(OSI_VC_DECL(avc), afs_int32 aflags, lastclose_t lastclose
469 off_t offset, afs_ucred_t *acred)
470 #elif defined(AFS_SUN5_ENV)
471 afs_close(OSI_VC_DECL(avc), afs_int32 aflags, int count, offset_t offset,
474 afs_close(OSI_VC_DECL(avc), afs_int32 aflags, afs_ucred_t *acred)
478 afs_int32 code_checkcode = 0;
480 struct vrequest *treq = NULL;
484 struct afs_fakestat_state fakestat;
487 AFS_STATCNT(afs_close);
488 afs_Trace2(afs_iclSetp, CM_TRACE_CLOSE, ICL_TYPE_POINTER, avc,
489 ICL_TYPE_INT32, aflags);
490 code = afs_CreateReq(&treq, acred);
493 afs_InitFakeStat(&fakestat);
494 code = afs_EvalFakeStat(&avc, &fakestat, treq);
496 afs_PutFakeStat(&fakestat);
497 afs_DestroyReq(treq);
502 if (avc->flockCount) {
503 HandleFlock(avc, LOCK_UN, treq, 0, 1 /*onlymine */ );
506 #if defined(AFS_SGI_ENV)
508 afs_PutFakeStat(&fakestat);
510 afs_DestroyReq(treq);
513 /* unlock any locks for pid - could be wrong for child .. */
514 AFS_RWLOCK((vnode_t *) avc, VRWLOCK_WRITE);
515 # ifdef AFS_SGI65_ENV
516 get_current_flid(&flid);
517 cleanlocks((vnode_t *) avc, flid.fl_pid, flid.fl_sysid);
518 HandleFlock(avc, LOCK_UN, treq, flid.fl_pid, 1 /*onlymine */ );
520 # ifdef AFS_SGI64_ENV
521 cleanlocks((vnode_t *) avc, flp);
522 # else /* AFS_SGI64_ENV */
523 cleanlocks((vnode_t *) avc, u.u_procp->p_epid, u.u_procp->p_sysid);
524 # endif /* AFS_SGI64_ENV */
525 HandleFlock(avc, LOCK_UN, treq, OSI_GET_CURRENT_PID(), 1 /*onlymine */ );
526 # endif /* AFS_SGI65_ENV */
527 /* afs_chkpgoob will drop and re-acquire the global lock. */
528 afs_chkpgoob(&avc->v, btoc(avc->f.m.Length));
529 #elif defined(AFS_SUN5_ENV)
531 /* The vfs layer may call this repeatedly with higher "count"; only
532 * on the last close (i.e. count = 1) we should actually proceed
534 afs_PutFakeStat(&fakestat);
536 afs_DestroyReq(treq);
540 if (avc->flockCount) { /* Release Lock */
541 HandleFlock(avc, LOCK_UN, treq, 0, 1 /*onlymine */ );
544 if (aflags & (FWRITE | FTRUNC)) {
545 if (afs_BBusy() || (AFS_NFSXLATORREQ(acred)) || AFS_IS_DISCONNECTED) {
546 /* do it yourself if daemons are all busy */
547 ObtainWriteLock(&avc->lock, 124);
548 code = afs_StoreOnLastReference(avc, treq);
549 ReleaseWriteLock(&avc->lock);
550 #if defined(AFS_SGI_ENV)
551 AFS_RWUNLOCK((vnode_t *) avc, VRWLOCK_WRITE);
554 #if defined(AFS_SGI_ENV)
555 AFS_RWUNLOCK((vnode_t *) avc, VRWLOCK_WRITE);
557 /* at least one daemon is idle, so ask it to do the store.
558 * Also, note that we don't lock it any more... */
559 tb = afs_BQueue(BOP_STORE, avc, 0, 1, acred,
560 (afs_size_t) afs_cr_uid(acred), (afs_size_t) 0,
561 (void *)0, (void *)0, (void *)0);
562 /* sleep waiting for the store to start, then retrieve error code */
563 while ((tb->flags & BUVALID) == 0) {
568 code_checkcode = tb->code_checkcode;
572 /* VNOVNODE is "acceptable" error code from close, since
573 * may happen when deleting a file on another machine while
574 * it is open here. We do the same for ENOENT since in afs_CheckCode we map VNOVNODE -> ENOENT */
575 if (code == VNOVNODE || code == ENOENT)
578 /* Ensure last closer gets the error. If another thread caused
579 * DoPartialWrite and this thread does not actually store the data,
580 * it may not see the quota error.
582 ObtainWriteLock(&avc->lock, 406);
585 osi_ReleaseVM(avc, acred);
587 /* We don't know what the original raw error code was, so set
588 * 'code' to 0. But we have the afs_CheckCode-translated error
589 * code, so put that in code_checkcode. We cannot just set code
590 * to avc->vc_error, since vc_error is a checkcode-translated
591 * error code, and 'code' is supposed to be a raw error code. */
593 code_checkcode = avc->vc_error;
596 ReleaseWriteLock(&avc->lock);
598 /* some codes merit specific complaint */
600 afs_warnuser("afs: failed to store file (network problems)\n");
603 else if (code == ENOSPC || code_checkcode == ENOSPC) {
605 ("afs: failed to store file (over quota or partition full)\n");
608 else if (code == ENOSPC || code_checkcode == ENOSPC) {
609 afs_warnuser("afs: failed to store file (partition full)\n");
610 } else if (code == EDQUOT || code_checkcode == EDQUOT) {
611 afs_warnuser("afs: failed to store file (over quota)\n");
614 else if (code || code_checkcode)
615 afs_warnuser("afs: failed to store file (%d/%d)\n", code, code_checkcode);
617 /* finally, we flush any text pages lying around here */
621 #if defined(AFS_SGI_ENV)
622 AFS_RWUNLOCK((vnode_t *) avc, VRWLOCK_WRITE);
623 osi_Assert(avc->opens > 0);
625 /* file open for read */
626 ObtainWriteLock(&avc->lock, 411);
629 osi_ReleaseVM(avc, acred);
632 code_checkcode = avc->vc_error;
635 #if defined(AFS_FBSD80_ENV)
638 afs_int32 opens, is_free, is_gone, is_doomed, iflag;
639 struct vnode *vp = AFSTOV(avc);
641 is_doomed = vp->v_iflag & VI_DOOMED;
642 is_free = vp->v_iflag & VI_FREE;
643 is_gone = vp->v_iflag & VI_DOINGINACT;
647 afs_warn("afs_close avc %p vp %p opens %d free %d doinginact %d doomed %d iflag %d\n",
648 avc, vp, opens, is_free, is_gone, is_doomed, iflag);
652 ReleaseWriteLock(&avc->lock);
655 afs_PutFakeStat(&fakestat);
657 if (code_checkcode) {
658 code = code_checkcode;
660 code = afs_CheckCode(code, treq, 5);
662 afs_DestroyReq(treq);
668 #if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)
669 afs_fsync(OSI_VC_DECL(avc), int flag, afs_ucred_t *acred
670 # ifdef AFS_SGI65_ENV
671 , off_t start, off_t stop
672 # endif /* AFS_SGI65_ENV */
674 #else /* !SUN5 && !SGI */
675 afs_fsync(OSI_VC_DECL(avc), afs_ucred_t *acred)
679 struct vrequest *treq = NULL;
683 return avc->vc_error;
685 #if defined(AFS_SUN5_ENV)
686 /* back out if called from NFS server */
687 if (curthread->t_flag & T_DONTPEND)
691 AFS_STATCNT(afs_fsync);
692 afs_Trace1(afs_iclSetp, CM_TRACE_FSYNC, ICL_TYPE_POINTER, avc);
693 if ((code = afs_CreateReq(&treq, acred)))
696 #if defined(AFS_SGI_ENV)
697 AFS_RWLOCK((vnode_t *) avc, VRWLOCK_WRITE);
698 if (flag & FSYNC_INVAL)
699 osi_VM_FSyncInval(avc);
700 #endif /* AFS_SGI_ENV */
702 ObtainSharedLock(&avc->lock, 18);
704 if (avc->execsOrWriters > 0) {
705 if (!AFS_IS_DISCONNECTED && !AFS_IS_DISCON_RW) {
706 /* Your average flush. */
708 /* put the file back */
709 UpgradeSToWLock(&avc->lock, 41);
710 code = afs_StoreAllSegments(avc, treq, AFS_SYNC);
711 ConvertWToSLock(&avc->lock);
713 UpgradeSToWLock(&avc->lock, 711);
714 afs_DisconAddDirty(avc, VDisconWriteFlush, 1);
715 ConvertWToSLock(&avc->lock);
716 } /* if not disconnected */
717 } /* if (avc->execsOrWriters > 0) */
719 #if defined(AFS_SGI_ENV)
720 AFS_RWUNLOCK((vnode_t *) avc, VRWLOCK_WRITE);
721 if (code == VNOVNODE) {
722 /* syncing an unlinked file! - non-informative to pass an errno
723 * 102 (== VNOVNODE) to user
729 code = afs_CheckCode(code, treq, 33);
730 afs_DestroyReq(treq);
731 ReleaseSharedLock(&avc->lock);