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
10 #include <afsconfig.h>
11 #include "afs/param.h"
15 * SOLARIS/osi_vnodeops.c
19 * Functions: AFS_TRYUP, _init, _info, _fini, afs_addmap, afs_delmap,
20 * afs_vmread, afs_vmwrite, afs_getpage, afs_GetOnePage, afs_putpage,
21 * afs_putapage, afs_nfsrdwr, afs_map, afs_PageLeft, afs_pathconf/afs_cntl,
22 * afs_ioctl, afs_rwlock, afs_rwunlock, afs_seek, afs_space, afs_dump,
23 * afs_cmp, afs_realvp, afs_pageio, afs_dumpctl, afs_dispose, afs_setsecattr,
24 * afs_getsecattr, gafs_open, gafs_close, gafs_getattr, gafs_setattr,
25 * gafs_access, gafs_lookup, gafs_create, gafs_remove, gafs_link,
26 * gafs_rename, gafs_mkdir, gafs_rmdir, gafs_readdir, gafs_symlink,
27 * gafs_readlink, gafs_fsync, afs_inactive, gafs_inactive, gafs_fid
30 * Variables: Afs_vnodeops
33 #include "afs/sysincludes.h" /* Standard vendor system headers */
34 #include "afsincludes.h" /* Afs-based standard headers */
35 #include "afs/afs_stats.h" /* statistics */
36 #include "afs/nfsclient.h"
45 #include <vm/seg_map.h>
46 #include <vm/seg_vn.h>
48 #if defined(AFS_SUN511_ENV)
49 #include <sys/vfs_opreg.h>
51 #include <sys/modctl.h>
52 #include <sys/syscall.h>
53 #include <sys/debug.h>
54 #include <sys/fs_subr.h>
56 /* Translate a faultcode_t as returned by some of the vm routines
57 * into a suitable errno value.
60 afs_fc2errno(faultcode_t fc)
62 switch (FC_CODE(fc)) {
75 extern struct as kas; /* kernel addr space */
76 extern unsigned char *afs_indexFlags;
77 extern afs_lock_t afs_xdcache;
79 static int afs_nfsrdwr(struct vcache *avc, struct uio *auio, enum uio_rw arw,
80 int ioflag, afs_ucred_t *acred);
81 static int afs_GetOnePage(struct vnode *vp, u_offset_t off, u_int alen,
82 u_int *protp, struct page *pl[], u_int plsz,
83 struct seg *seg, caddr_t addr, enum seg_rw rw,
89 afs_addmap(struct vnode *avp, offset_t offset, struct as *asp,
90 caddr_t addr, int length, int prot, int maxprot, int flags,
93 /* XXX What should we do here?? XXX */
98 afs_delmap(struct vnode *avp, offset_t offset, struct as *asp,
99 caddr_t addr, int length, int prot, int maxprot, int flags,
102 /* XXX What should we do here?? XXX */
107 #ifdef AFS_SUN510_ENV
108 afs_vmread(struct vnode *avp, struct uio *auio, int ioflag,
109 afs_ucred_t *acred, caller_context_t *ct)
111 afs_vmread(struct vnode *avp, struct uio *auio, int ioflag,
117 if (!RW_READ_HELD(&(VTOAFS(avp))->rwlock))
118 osi_Panic("afs_vmread: !rwlock");
120 code = afs_nfsrdwr(VTOAFS(avp), auio, UIO_READ, ioflag, acred);
127 #ifdef AFS_SUN510_ENV
128 afs_vmwrite(struct vnode *avp, struct uio *auio, int ioflag,
129 afs_ucred_t *acred, caller_context_t *ct)
131 afs_vmwrite(struct vnode *avp, struct uio *auio, int ioflag,
137 if (!RW_WRITE_HELD(&(VTOAFS(avp))->rwlock))
138 osi_Panic("afs_vmwrite: !rwlock");
140 code = afs_nfsrdwr(VTOAFS(avp), auio, UIO_WRITE, ioflag, acred);
146 afs_getpage(struct vnode *vp, offset_t off, u_int len, u_int *protp,
147 struct page *pl[], u_int plsz, struct seg *seg, caddr_t addr,
148 enum seg_rw rw, afs_ucred_t *acred)
151 AFS_STATCNT(afs_getpage);
153 if (vp->v_flag & VNOMAP) /* File doesn't allow mapping */
160 afs_GetOnePage(vp, off, len, protp, pl, plsz, seg, addr, rw, acred);
162 struct multiPage_range range;
163 struct vcache *vcp = VTOAFS(vp);
165 /* We've been asked to get more than one page. We must return all
166 * requested pages at once, all of them locked, which means all of
167 * these dcache entries cannot be kicked out of the cache before we
168 * return (since their pages cannot be invalidated).
170 * afs_GetOnePage will be called multiple times by pvn_getpages in
171 * order to get all of the requested pages. One of the later
172 * afs_GetOnePage calls may need to evict some cache entries in order
173 * to perform its read. If we try to kick out one of the entries an
174 * earlier afs_GetOnePage call used, we will deadlock since we have
175 * the page locked. So, to tell afs_GetDownD that it should skip over
176 * any entries we've read in due to this afs_getpage call, record the
177 * offset and length in avc->multiPage.
179 * Ideally we would just set something in each dcache as we get it,
180 * but that is rather difficult, since pvn_getpages doesn't let us
181 * retain any information between calls to afs_GetOnePage. So instead
182 * just record the offset and length, and let afs_GetDownD calculate
183 * which dcache entries should be skipped. */
188 ObtainWriteLock(&vcp->vlock, 548);
189 QAdd(&vcp->multiPage, &range.q);
190 ReleaseWriteLock(&vcp->vlock);
192 pvn_getpages(afs_GetOnePage, vp, off, len, protp, pl, plsz, seg, addr, rw, acred);
193 ObtainWriteLock(&vcp->vlock, 549);
195 ReleaseWriteLock(&vcp->vlock);
201 /* Return all the pages from [off..off+len) in file */
203 afs_GetOnePage(struct vnode *vp, u_offset_t off, u_int alen, u_int *protp,
204 struct page *pl[], u_int plsz, struct seg *seg, caddr_t addr,
205 enum seg_rw rw, afs_ucred_t *acred)
216 afs_size_t offset, nlen = 0;
217 struct vrequest treq;
218 afs_int32 mapForRead = 0, Code = 0;
222 osi_Panic("GetOnePage: !acred");
224 avc = VTOAFS(vp); /* cast to afs vnode */
226 if (avc->credp /*&& AFS_NFSXLATORREQ(acred) */
227 && AFS_NFSXLATORREQ(avc->credp)) {
230 if (code = afs_InitReq(&treq, acred))
234 /* This is a read-ahead request, e.g. due to madvise. */
236 ObtainReadLock(&avc->lock);
238 while (plen > 0 && !afs_BBusy()) {
239 /* Obtain a dcache entry at off. 2 means don't fetch data. */
241 afs_GetDCache(avc, (afs_offs_t) off, &treq, &offset, &nlen,
246 /* Write-lock the dcache entry, if we don't succeed, just go on */
247 if (0 != NBObtainWriteLock(&tdc->lock, 642)) {
252 /* If we aren't already fetching this dcache entry, queue it */
253 if (!(tdc->mflags & DFFetchReq)) {
256 tdc->mflags |= DFFetchReq;
257 bp = afs_BQueue(BOP_FETCH, avc, B_DONTWAIT, 0, acred,
258 (afs_size_t) off, (afs_size_t) 1, tdc,
259 (void *)0, (void *)0);
261 /* Unable to start background fetch; might as well stop */
262 tdc->mflags &= ~DFFetchReq;
263 ReleaseWriteLock(&tdc->lock);
267 ReleaseWriteLock(&tdc->lock);
269 ReleaseWriteLock(&tdc->lock);
274 /* Adjust our offset and remaining length values */
278 /* If we aren't making progress for some reason, bail out */
283 ReleaseReadLock(&avc->lock);
288 pl[0] = NULL; /* Make sure it's empty */
290 /* first, obtain the proper lock for the VM system */
292 /* if this is a read request, map the page in read-only. This will
293 * allow us to swap out the dcache entry if there are only read-only
294 * pages created for the chunk, which helps a *lot* when dealing
295 * with small caches. Otherwise, we have to invalidate the vm
296 * pages for the range covered by a chunk when we swap out the
299 if (rw == S_READ || rw == S_EXEC)
306 if (rw == S_WRITE || rw == S_CREATE)
307 tdc = afs_GetDCache(avc, (afs_offs_t) off, &treq, &offset, &nlen, 5);
309 tdc = afs_GetDCache(avc, (afs_offs_t) off, &treq, &offset, &nlen, 1);
311 return afs_CheckCode(EINVAL, &treq, 62);
312 code = afs_VerifyVCache(avc, &treq);
315 return afs_CheckCode(code, &treq, 44); /* failed to get it */
318 ObtainReadLock(&avc->lock);
320 afs_Trace4(afs_iclSetp, CM_TRACE_PAGEIN, ICL_TYPE_POINTER, (afs_int32) vp,
321 ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(off), ICL_TYPE_LONG, len,
322 ICL_TYPE_LONG, (int)rw);
327 /* Check to see if we're in the middle of a VM purge, and if we are, release
328 * the locks and try again when the VM purge is done. */
329 ObtainWriteLock(&avc->vlock, 550);
331 ReleaseReadLock(&avc->lock);
332 ReleaseWriteLock(&avc->vlock);
334 /* Check activeV again, it may have been turned off
335 * while we were waiting for a lock in afs_PutDCache */
336 ObtainWriteLock(&avc->vlock, 574);
338 avc->vstates |= VRevokeWait;
339 ReleaseWriteLock(&avc->vlock);
340 afs_osi_Sleep(&avc->vstates);
342 ReleaseWriteLock(&avc->vlock);
346 ReleaseWriteLock(&avc->vlock);
348 /* We're about to do stuff with our dcache entry.. Lock it. */
349 ObtainReadLock(&tdc->lock);
351 /* Check to see whether the cache entry is still valid */
352 if (!(avc->f.states & CStatd)
353 || !afs_IsDCacheFresh(tdc, avc)) {
354 ReleaseReadLock(&tdc->lock);
355 ReleaseReadLock(&avc->lock);
361 while (1) { /* loop over all pages */
362 /* now, try to find the page in memory (it may already be intransit or laying
363 * around the free list */
365 page_lookup(vp, toffset, (rw == S_CREATE ? SE_EXCL : SE_SHARED));
369 /* if we make it here, we can't find the page in memory. Do a real disk read
370 * from the cache to get the data */
371 Code |= 0x200; /* XXX */
372 /* use PG_EXCL because we know the page does not exist already. If it
373 * actually does exist, we have somehow raced between lookup and create.
374 * As of 4/98, that shouldn't be possible, but we'll be defensive here
375 * in case someone tries to relax all the serialization of read and write
376 * operations with harmless things like stat. */
378 page_create_va(vp, toffset, PAGESIZE, PG_WAIT | PG_EXCL, seg,
384 pagezero(page, alen, PAGESIZE - alen);
386 if (rw == S_CREATE) {
387 /* XXX Don't read from AFS in write only cases XXX */
388 page_io_unlock(page);
391 /* now it is time to start I/O operation */
392 buf = pageio_setup(page, PAGESIZE, vp, B_READ); /* allocate a buf structure */
395 buf->b_lblkno = lbtodb(toffset);
396 bp_mapin(buf); /* map it in to our address space */
399 /* afs_ustrategy will want to lock the dcache entry */
400 ReleaseReadLock(&tdc->lock);
401 code = afs_ustrategy(buf, acred); /* do the I/O */
402 ObtainReadLock(&tdc->lock);
405 /* Before freeing unmap the buffer */
411 page_io_unlock(page);
414 /* come here when we have another page (already held) to enter */
416 /* put page in array and continue */
417 /* The p_selock must be downgraded to a shared lock after the page is read */
418 if ((rw != S_CREATE) && !(PAGE_SHARED(page))) {
419 page_downgrade(page);
422 code = page_iolock_assert(page);
428 break; /* done all the pages */
429 } /* while (1) ... */
433 ReleaseReadLock(&tdc->lock);
435 /* Prefetch next chunk if we're at a chunk boundary */
436 if (AFS_CHUNKOFFSET(off) == 0) {
437 if (!(tdc->mflags & DFNextStarted))
438 afs_PrefetchChunk(avc, tdc, acred, &treq);
441 ReleaseReadLock(&avc->lock);
442 ObtainWriteLock(&afs_xdcache, 246);
444 /* track that we have dirty (or dirty-able) pages for this chunk. */
445 afs_indexFlags[tdc->index] |= IFDirtyPages;
447 afs_indexFlags[tdc->index] |= IFAnyPages;
448 ReleaseWriteLock(&afs_xdcache);
450 afs_Trace3(afs_iclSetp, CM_TRACE_PAGEINDONE, ICL_TYPE_LONG, code,
451 ICL_TYPE_LONG, (int)page, ICL_TYPE_LONG, Code);
456 afs_Trace3(afs_iclSetp, CM_TRACE_PAGEINDONE, ICL_TYPE_LONG, code,
457 ICL_TYPE_LONG, (int)page, ICL_TYPE_LONG, Code);
458 /* release all pages, drop locks, return code */
460 pvn_read_done(page, B_ERROR);
461 ReleaseReadLock(&avc->lock);
462 ReleaseReadLock(&tdc->lock);
468 * Dummy pvn_vplist_dirty() handler for non-writable vnodes.
471 afs_never_putapage(struct vnode *vp, struct page *pages, u_offset_t * offp,
472 size_t * lenp, int flags, afs_ucred_t *credp)
474 struct vcache *avc = VTOAFS(vp);
475 osi_Assert((avc->f.states & CRO) != 0);
476 osi_Panic("Dirty pages while flushing a read-only volume vnode.");
477 AFS_UNREACHED(return EIO);
481 afs_putpage(struct vnode *vp, offset_t off, u_int len, int flags,
489 afs_int32 NPages = 0;
490 u_offset_t toff = off;
493 AFS_STATCNT(afs_putpage);
494 if (vp->v_flag & VNOMAP) /* file doesn't allow mapping */
498 * Putpage (ASYNC) is called every sec to flush out dirty vm pages
501 afs_Trace4(afs_iclSetp, CM_TRACE_PAGEOUT, ICL_TYPE_POINTER,
502 (afs_int32) vp, ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(off),
503 ICL_TYPE_INT32, (afs_int32) len, ICL_TYPE_LONG, (int)flags);
506 /* Get a list of modified (or whatever) pages */
508 ObtainSharedLock(&avc->lock, 247);
509 didLock = SHARED_LOCK;
510 endPos = (afs_offs_t) off + len; /* position we're supposed to write up to */
511 while ((afs_offs_t) toff < endPos
512 && (afs_offs_t) toff < avc->f.m.Length) {
513 /* If not invalidating pages use page_lookup_nowait to avoid reclaiming
514 * them from the free list
517 if (flags & (B_FREE | B_INVAL))
518 pages = page_lookup(vp, toff, SE_EXCL);
520 pages = page_lookup_nowait(vp, toff, SE_SHARED);
521 if (!pages || !pvn_getdirty(pages, flags))
524 if (didLock == SHARED_LOCK) {
526 didLock = WRITE_LOCK;
527 UpgradeSToWLock(&avc->lock, 671);
531 code = afs_putapage(vp, pages, &toff, &tlen, flags, cred);
542 * We normally arrive here due to a vm flush.
544 * If this vnode belongs to a writable volume, obtain a vcache lock
545 * then call pvn_vplist_dirty to free, invalidate, or to write out
546 * dirty pages with afs_putapage. The afs_putapage routine requires a
547 * vcache lock, so we obtain it here before any page locks are taken.
548 * This locking order is done to avoid deadlocking due to races with
549 * afs_getpage, which also takes vcache and page locks.
551 * If this vnode belongs to a non-writable volume, then it will not
552 * contain dirty pages, so we do not need to lock the vcache and since
553 * afs_putapage will not be called. Instead, forgo the vcache lock and
554 * call pvn_vplist_dirty to free, or invalidate pages. Pass a dummy
555 * page out handler to pvn_vplist_dirty which we do not expect to be
556 * called. Panic if the dummy handler is called, since something went
559 if ((avc->f.states & CRO) == 0) {
560 ObtainWriteLock(&avc->lock, 670);
561 didLock = WRITE_LOCK;
564 if ((avc->f.states & CRO) == 0)
565 code = pvn_vplist_dirty(vp, toff, afs_putapage, flags, cred);
567 code = pvn_vplist_dirty(vp, toff, afs_never_putapage, flags, cred);
571 if (code && !avc->vc_error) {
573 ObtainWriteLock(&avc->lock, 668);
574 didLock = WRITE_LOCK;
575 } else if (didLock == SHARED_LOCK) {
576 UpgradeSToWLock(&avc->lock, 669);
577 didLock = WRITE_LOCK;
579 avc->vc_error = code;
582 if (didLock == WRITE_LOCK)
583 ReleaseWriteLock(&avc->lock);
584 else if (didLock == SHARED_LOCK)
585 ReleaseSharedLock(&avc->lock);
586 afs_Trace2(afs_iclSetp, CM_TRACE_PAGEOUTDONE, ICL_TYPE_LONG, code,
587 ICL_TYPE_LONG, NPages);
593 afs_putapage(struct vnode *vp, struct page *pages, u_offset_t * offp,
594 size_t * lenp, int flags, afs_ucred_t *credp)
597 struct vcache *avc = VTOAFS(vp);
599 u_int tlen = PAGESIZE;
600 afs_offs_t off = (pages->p_offset / PAGESIZE) * PAGESIZE;
603 * Now we've got the modified pages. All pages are locked and held
604 * XXX Find a kluster that fits in one block (or page). We also
605 * adjust the i/o if the file space is less than a while page. XXX
607 if (off + tlen > avc->f.m.Length) {
608 tlen = avc->f.m.Length - off;
610 /* can't call mapout with 0 length buffers (rmfree panics) */
611 if (((tlen >> 24) & 0xff) == 0xff) {
616 * Can't call mapout with 0 length buffers since we'll get rmfree panics
618 tbuf = pageio_setup(pages, tlen, vp, B_WRITE | flags);
623 tbuf->b_lblkno = lbtodb(pages->p_offset);
626 afs_Trace4(afs_iclSetp, CM_TRACE_PAGEOUTONE, ICL_TYPE_LONG, avc,
627 ICL_TYPE_LONG, pages, ICL_TYPE_LONG, tlen, ICL_TYPE_OFFSET,
628 ICL_HANDLE_OFFSET(off));
629 code = afs_ustrategy(tbuf, credp); /* unlocks page */
633 pvn_write_done(pages, ((code) ? B_ERROR : 0) | B_WRITE | flags);
644 afs_nfsrdwr(struct vcache *avc, struct uio *auio, enum uio_rw arw,
645 int ioflag, afs_ucred_t *acred)
649 afs_int32 code_checkcode = 0;
651 afs_int32 mode, sflags;
653 struct dcache *dcp, *dcp_newpage;
654 afs_size_t fileBase, size;
657 afs_int32 pageOffset, extraResid = 0;
658 afs_size_t origLength; /* length when reading/writing started */
659 long appendLength; /* length when this call will finish */
660 int created; /* created pages instead of faulting them */
662 int didFakeOpen, eof;
663 struct vrequest treq;
667 AFS_STATCNT(afs_nfsrdwr);
669 /* can't read or write other things */
670 if (vType(avc) != VREG)
673 if (auio->uio_resid == 0)
676 afs_Trace4(afs_iclSetp, CM_TRACE_VMRW, ICL_TYPE_POINTER, (afs_int32) avc,
677 ICL_TYPE_LONG, (arw == UIO_WRITE ? 1 : 0), ICL_TYPE_OFFSET,
678 ICL_HANDLE_OFFSET(auio->uio_loffset), ICL_TYPE_OFFSET,
679 ICL_HANDLE_OFFSET(auio->uio_resid));
681 #ifndef AFS_64BIT_CLIENT
682 if (AfsLargeFileUio(auio)) /* file is larger than 2 GB */
687 osi_Panic("rdwr: !acred");
689 if (code = afs_InitReq(&treq, acred))
692 /* It's not really possible to know if a write cause a growth in the
693 * cache size, we we wait for a cache drain for any write.
695 afs_MaybeWakeupTruncateDaemon();
696 while ((arw == UIO_WRITE)
697 && (afs_blocksUsed > PERCENT(CM_WAITFORDRAINPCT, afs_cacheBlocks))) {
698 afs_MaybeWaitForCacheDrain();
699 afs_MaybeFreeDiscardedDCache();
700 afs_MaybeWakeupTruncateDaemon();
702 code = afs_VerifyVCache(avc, &treq);
704 return afs_CheckCode(code, &treq, 45);
706 osi_FlushPages(avc, acred);
708 ObtainWriteLock(&avc->lock, 250);
710 /* adjust parameters when appending files */
711 if ((ioflag & IO_APPEND) && arw == UIO_WRITE) {
712 auio->uio_loffset = avc->f.m.Length; /* write at EOF position */
714 if (auio->afsio_offset < 0 || (auio->afsio_offset + auio->uio_resid) < 0) {
715 ReleaseWriteLock(&avc->lock);
718 #ifndef AFS_64BIT_CLIENT
719 /* file is larger than 2GB */
720 if (AfsLargeFileSize(auio->uio_offset, auio->uio_resid)) {
721 ReleaseWriteLock(&avc->lock);
726 didFakeOpen = 0; /* keep track of open so we can do close */
727 if (arw == UIO_WRITE) {
728 /* do ulimit processing; shrink resid or fail */
729 if (auio->uio_loffset + auio->afsio_resid > auio->uio_llimit) {
730 if (auio->uio_loffset >= auio->uio_llimit) {
731 ReleaseWriteLock(&avc->lock);
734 /* track # of bytes we should write, but won't because of
735 * ulimit; we must add this into the final resid value
736 * so caller knows we punted some data.
738 extraResid = auio->uio_resid;
739 auio->uio_resid = auio->uio_llimit - auio->uio_loffset;
740 extraResid -= auio->uio_resid;
743 mode = S_WRITE; /* segment map-in mode */
744 afs_FakeOpen(avc); /* do this for writes, so data gets put back
745 * when we want it to be put back */
746 didFakeOpen = 1; /* we'll be doing a fake open */
747 /* before starting any I/O, we must ensure that the file is big enough
748 * to hold the results (since afs_putpage will be called to force the I/O */
749 size = auio->afsio_resid + auio->afsio_offset; /* new file size */
751 origLength = avc->f.m.Length;
752 if (size > avc->f.m.Length) {
753 afs_Trace4(afs_iclSetp, CM_TRACE_SETLENGTH, ICL_TYPE_STRING,
754 __FILE__, ICL_TYPE_LONG, __LINE__, ICL_TYPE_OFFSET,
755 ICL_HANDLE_OFFSET(avc->f.m.Length), ICL_TYPE_OFFSET,
756 ICL_HANDLE_OFFSET(size));
757 avc->f.m.Length = size; /* file grew */
759 avc->f.states |= CDirty; /* Set the dirty bit */
760 avc->f.m.Date = osi_Time(); /* Set file date (for ranlib) */
762 mode = S_READ; /* map-in read-only */
763 origLength = avc->f.m.Length;
766 if (acred && AFS_NFSXLATORREQ(acred)) {
767 if (arw == UIO_READ) {
769 (avc, PRSFS_READ, &treq,
770 CHECK_MODE_BITS | CMB_ALLOW_EXEC_AS_READ)) {
771 ReleaseWriteLock(&avc->lock);
781 counter = 0; /* don't call afs_DoPartialWrite first time through. */
783 /* compute the amount of data to move into this block,
784 * based on auio->afsio_resid. Note that we copy data in units of
785 * MAXBSIZE, not PAGESIZE. This is because segmap_getmap panics if you
786 * call it with an offset based on blocks smaller than MAXBSIZE
787 * (implying that it should be named BSIZE, since it is clearly both a
789 size = auio->afsio_resid; /* transfer size */
790 fileBase = ((arw == UIO_READ) && (origLength < auio->uio_offset)) ?
791 origLength : auio->afsio_offset; /* start file position for xfr */
792 pageBase = fileBase & ~(MAXBSIZE - 1); /* file position of the page */
793 pageOffset = fileBase & (MAXBSIZE - 1); /* xfr start's offset within page */
794 tsize = MAXBSIZE - pageOffset; /* how much more fits in this page */
795 /* we'll read tsize bytes, but first must make sure tsize isn't too big */
797 tsize = size; /* don't read past end of request */
798 eof = 0; /* flag telling us if we hit the EOF on the read */
799 if (arw == UIO_READ) { /* we're doing a read operation */
800 /* don't read past EOF */
801 if (fileBase + tsize > origLength) {
802 tsize = origLength - fileBase;
803 eof = 1; /* we did hit the EOF */
805 tsize = 0; /* better safe than sorry */
809 /* Purge dirty chunks of file if there are too many dirty
810 * chunks. Inside the write loop, we only do this at a chunk
811 * boundary. Clean up partial chunk if necessary at end of loop.
813 if (counter > 0 && code == 0 && AFS_CHUNKOFFSET(fileBase) == 0) {
814 code = afs_DoPartialWrite(avc, &treq);
818 /* write case, we ask segmap_release to call putpage. Really, we
819 * don't have to do this on every page mapin, but for now we're
820 * lazy, and don't modify the rest of AFS to scan for modified
821 * pages on a close or other "synchronize with file server"
822 * operation. This makes things a little cleaner, but probably
823 * hurts performance. */
828 break; /* nothing to transfer, we're done */
830 if (arw == UIO_WRITE)
831 avc->f.states |= CDirty; /* may have been cleared by DoPartialWrite */
833 /* Before dropping lock, hold the chunk (create it if necessary). This
834 * serves two purposes: (1) Ensure Cache Truncate Daemon doesn't try
835 * to purge the chunk's pages while we have them locked. This would
836 * cause deadlock because we might be waiting for the CTD to free up
837 * a chunk. (2) If we're writing past the original EOF, and we're
838 * at the base of the chunk, then make sure it exists online
839 * before we do the uiomove, since the segmap_release will
840 * write out to the chunk, causing it to get fetched if it hasn't
841 * been created yet. The code that would otherwise notice that
842 * we're fetching a chunk past EOF won't work, since we've
843 * already adjusted the file size above.
845 ObtainWriteLock(&avc->vlock, 551);
846 while (avc->vstates & VPageCleaning) {
847 ReleaseWriteLock(&avc->vlock);
848 ReleaseWriteLock(&avc->lock);
849 afs_osi_Sleep(&avc->vstates);
850 ObtainWriteLock(&avc->lock, 334);
851 ObtainWriteLock(&avc->vlock, 552);
853 ReleaseWriteLock(&avc->vlock);
855 afs_size_t toff, tlen;
856 dcp = afs_GetDCache(avc, fileBase, &treq, &toff, &tlen, 2);
862 ReleaseWriteLock(&avc->lock); /* uiomove may page fault */
864 data = segmap_getmap(segkmap, AFSTOV(avc), (u_offset_t) pageBase);
865 raddr = (caddr_t) (((uintptr_t) data + pageOffset) & PAGEMASK);
867 (((u_int) data + pageOffset + tsize + PAGEOFFSET) & PAGEMASK) -
870 /* if we're doing a write, and we're starting at the rounded
871 * down page base, and we're writing enough data to cover all
872 * created pages, then we must be writing all of the pages
873 * in this MAXBSIZE window that we're creating.
876 if (arw == UIO_WRITE && ((long)raddr == (long)data + pageOffset)
878 /* probably the dcache backing this guy is around, but if
879 * not, we can't do this optimization, since we're creating
880 * writable pages, which must be backed by a chunk.
883 dcp_newpage = afs_FindDCache(avc, pageBase);
885 && afs_IsDCacheFresh(dcp_newpage, avc)) {
886 ObtainWriteLock(&avc->lock, 251);
887 ObtainWriteLock(&avc->vlock, 576);
888 ObtainReadLock(&dcp_newpage->lock);
889 if ((avc->activeV == 0)
890 && afs_IsDCacheFresh(dcp_newpage, avc)
891 && !(dcp_newpage->dflags & (DFFetching))) {
893 segmap_pagecreate(segkmap, raddr, rsize, 1);
895 ObtainWriteLock(&afs_xdcache, 252);
896 /* Mark the pages as created and dirty */
897 afs_indexFlags[dcp_newpage->index]
898 |= (IFAnyPages | IFDirtyPages);
899 ReleaseWriteLock(&afs_xdcache);
902 ReleaseReadLock(&dcp_newpage->lock);
903 afs_PutDCache(dcp_newpage);
904 ReleaseWriteLock(&avc->vlock);
905 ReleaseWriteLock(&avc->lock);
906 } else if (dcp_newpage)
907 afs_PutDCache(dcp_newpage);
912 afs_fc2errno(segmap_fault
913 (kas.a_hat, segkmap, raddr, rsize,
917 AFS_UIOMOVE(data + pageOffset, tsize, arw, auio, code);
918 segmap_fault(kas.a_hat, segkmap, raddr, rsize, F_SOFTUNLOCK,
922 code = segmap_release(segkmap, data, sflags);
924 (void)segmap_release(segkmap, data, 0);
927 ObtainWriteLock(&avc->lock, 253);
935 afs_FakeClose(avc, acred);
937 if (arw == UIO_WRITE && (avc->f.states & CDirty)) {
938 code2 = afs_DoPartialWrite(avc, &treq);
943 if (!code && avc->vc_error) {
944 code = code_checkcode = avc->vc_error;
946 ReleaseWriteLock(&avc->lock);
948 if ((ioflag & FSYNC) && (arw == UIO_WRITE)
949 && !AFS_NFSXLATORREQ(acred))
950 code = afs_fsync(avc, 0, acred);
953 * If things worked, add in as remaining in request any bytes
954 * we didn't write due to file size ulimit.
956 if (code == 0 && extraResid > 0)
957 auio->uio_resid += extraResid;
958 if (code_checkcode) {
959 return code_checkcode;
961 return afs_CheckCode(code, &treq, 46);
966 afs_map(struct vnode *vp, offset_t off, struct as *as, caddr_t *addr, size_t len, u_char prot, u_char maxprot, u_int flags, afs_ucred_t *cred)
968 struct segvn_crargs crargs;
970 struct vrequest treq;
971 struct vcache *avc = VTOAFS(vp);
973 AFS_STATCNT(afs_map);
976 /* check for reasonableness on segment bounds; apparently len can be < 0 */
977 if (off < 0 || off + len < 0) {
980 #ifndef AFS_64BIT_CLIENT
981 if (AfsLargeFileSize(off, len)) { /* file is larger than 2 GB */
987 if (vp->v_flag & VNOMAP) /* File isn't allowed to be mapped */
990 if (vp->v_filocks) /* if locked, disallow mapping */
994 if (code = afs_InitReq(&treq, cred))
997 if (vp->v_type != VREG) {
1002 code = afs_VerifyVCache(avc, &treq);
1006 osi_FlushPages(avc, cred); /* ensure old pages are gone */
1007 avc->f.states |= CMAPPED; /* flag cleared at afs_inactive */
1011 if ((flags & MAP_FIXED) == 0) {
1012 #ifdef MAPADDR_LACKS_VACALIGN
1013 map_addr(addr, len, off, flags);
1015 map_addr(addr, len, off, 1, flags);
1017 if (*addr == NULL) {
1023 (void)as_unmap(as, *addr, len); /* unmap old address space use */
1024 /* setup the create parameter block for the call */
1025 crargs.vp = AFSTOV(avc);
1026 crargs.offset = (u_offset_t)off;
1028 crargs.type = flags & MAP_TYPE;
1030 crargs.maxprot = maxprot;
1031 crargs.amp = (struct anon_map *)0;
1032 crargs.flags = flags & ~MAP_TYPE;
1034 code = as_map(as, *addr, len, segvn_create, (char *)&crargs);
1038 code = afs_CheckCode(code, &treq, 47);
1042 code = afs_CheckCode(code, &treq, 48);
1049 * For Now We use standard local kernel params for AFS system values. Change this
1053 #ifdef AFS_SUN511_ENV
1054 afs_pathconf(struct vnode *vp, int cmd, u_long *outdatap,
1055 afs_ucred_t *credp, caller_context_t *ct)
1057 afs_pathconf(struct vnode *vp, int cmd, u_long *outdatap,
1059 #endif /* AFS_SUN511_ENV */
1061 AFS_STATCNT(afs_cntl);
1064 *outdatap = MAXLINK;
1067 *outdatap = MAXNAMLEN;
1070 *outdatap = MAXPATHLEN;
1072 case _PC_CHOWN_RESTRICTED:
1078 case _PC_FILESIZEBITS:
1079 #ifdef AFS_64BIT_CLIENT
1086 #ifdef AFS_SUN511_ENV
1087 return fs_pathconf(vp, cmd, outdatap, credp, ct);
1089 return fs_pathconf(vp, cmd, outdatap, credp);
1090 #endif /* AFS_SUN511_ENV */
1096 afs_ioctl(struct vnode *vnp, int com, int arg, int flag, cred_t *credp,
1103 afs_rwlock(struct vnode *vnp, int wlock)
1105 rw_enter(&(VTOAFS(vnp))->rwlock, (wlock ? RW_WRITER : RW_READER));
1110 afs_rwunlock(struct vnode *vnp, int wlock)
1112 rw_exit(&(VTOAFS(vnp))->rwlock);
1118 afs_seek(struct vnode *vnp, offset_t ooff, offset_t *noffp)
1122 #ifndef AFS_64BIT_CLIENT
1123 # define __MAXOFF_T MAXOFF_T
1125 # define __MAXOFF_T MAXOFFSET_T
1128 if ((*noffp < 0 || *noffp > __MAXOFF_T))
1134 #ifdef AFS_SUN59_ENV
1135 afs_frlock(struct vnode *vnp, int cmd, struct flock64 *ap, int flag,
1136 offset_t off, struct flk_callback *flkcb, afs_ucred_t *credp)
1138 afs_frlock(struct vnode *vnp, int cmd, struct flock64 *ap, int flag,
1139 offset_t off, afs_ucred_t *credp)
1144 * Implement based on afs_lockctl
1147 #ifdef AFS_SUN59_ENV
1149 afs_warn("Don't know how to deal with flk_callback's!\n");
1151 if ((cmd == F_GETLK) || (cmd == F_O_GETLK) || (cmd == F_SETLK)
1152 || (cmd == F_SETLKW)) {
1153 ap->l_pid = ttoproc(curthread)->p_pid;
1157 code = convoff(vnp, ap, 0, off);
1163 code = afs_lockctl(VTOAFS(vnp), ap, cmd, credp);
1170 afs_space(struct vnode *vnp, int cmd, struct flock64 *ap, int flag,
1171 offset_t off, afs_ucred_t *credp)
1173 afs_int32 code = EINVAL;
1176 if ((cmd == F_FREESP)
1177 && ((code = convoff(vnp, ap, 0, off)) == 0)) {
1180 vattr.va_mask = AT_SIZE;
1181 vattr.va_size = ap->l_start;
1182 code = afs_setattr(VTOAFS(vnp), &vattr, 0, credp);
1190 afs_dump(struct vnode *vp, caddr_t addr, int i1, int i2)
1192 AFS_STATCNT(afs_dump);
1193 afs_warn("AFS_DUMP. MUST IMPLEMENT THIS!!!\n");
1198 /* Nothing fancy here; just compare if vnodes are identical ones */
1200 afs_cmp(struct vnode *vp1, struct vnode *vp2)
1202 AFS_STATCNT(afs_cmp);
1203 return (vp1 == vp2);
1208 afs_realvp(struct vnode *vp, struct vnode **vpp)
1210 AFS_STATCNT(afs_realvp);
1216 afs_pageio(struct vnode *vp, struct page *pp, u_int ui1, u_int ui2, int i1,
1219 afs_warn("afs_pageio: Not implemented\n");
1224 #ifdef AFS_SUN59_ENV
1225 afs_dumpctl(struct vnode *vp, int i, int *blkp)
1227 afs_dumpctl(struct vnode *vp, int i)
1230 afs_warn("afs_dumpctl: Not implemented\n");
1234 #ifdef AFS_SUN511_ENV
1236 afs_dispose(struct vnode *vp, struct page *p, int fl, int dn, struct cred *cr, struct caller_context_t *ct)
1238 fs_dispose(vp, p, fl, dn, cr,ct);
1242 afs_setsecattr(struct vnode *vp, vsecattr_t *vsecattr, int flag, struct cred *creds, struct caller_context_t *ct)
1248 afs_getsecattr(struct vnode *vp, vsecattr_t *vsecattr, int flag, struct cred *creds, struct caller_context_t *ct)
1250 return fs_fab_acl(vp, vsecattr, flag, creds,ct);
1254 afs_dispose(struct vnode *vp, struct page *p, int fl, int dn, struct cred *cr)
1256 fs_dispose(vp, p, fl, dn, cr);
1260 afs_setsecattr(struct vnode *vp, vsecattr_t *vsecattr, int flag,
1267 afs_getsecattr(struct vnode *vp, vsecattr_t *vsecattr, int flag, struct cred *creds)
1269 return fs_fab_acl(vp, vsecattr, flag, creds);
1273 #ifdef AFS_GLOBAL_SUNLOCK
1276 gafs_open(struct vnode **vpp, afs_int32 aflags,
1280 struct vcache *avc = VTOAFS(*vpp);
1283 code = afs_open(&avc, aflags, acred);
1286 /* afs_open currently never changes avc, but just in case... */
1293 gafs_close(struct vnode *vp, afs_int32 aflags, int count,
1294 offset_t offset, afs_ucred_t *acred)
1298 code = afs_close(VTOAFS(vp), aflags, count, offset, acred);
1304 gafs_getattr(struct vnode *vp, struct vattr *attrs,
1305 int flags, afs_ucred_t *acred)
1309 code = afs_getattr(VTOAFS(vp), attrs, flags, acred);
1316 gafs_setattr(struct vnode *vp, struct vattr *attrs,
1317 int flags, afs_ucred_t *acred)
1321 code = afs_setattr(VTOAFS(vp), attrs, flags, acred);
1328 gafs_access(struct vnode *vp, afs_int32 amode, int flags,
1333 code = afs_access(VTOAFS(vp), amode, flags, acred);
1340 gafs_lookup(struct vnode *dvp, char *aname,
1341 struct vnode **vpp, struct pathname *pnp, int flags,
1342 struct vnode *rdir, afs_ucred_t *acred)
1345 struct vcache *tvc = NULL;
1348 code = afs_lookup(VTOAFS(dvp), aname, &tvc, pnp, flags, rdir, acred);
1361 gafs_create(struct vnode *dvp, char *aname, struct vattr *attrs,
1362 enum vcexcl aexcl, int amode, struct vnode **vpp,
1366 struct vcache *tvc = NULL;
1369 code = afs_create(VTOAFS(dvp), aname, attrs, aexcl, amode, &tvc, acred);
1381 gafs_remove(struct vnode *vp, char *aname, afs_ucred_t *acred)
1385 code = afs_remove(VTOAFS(vp), aname, acred);
1391 gafs_link(struct vnode *dvp, struct vnode *svp,
1392 char *aname, afs_ucred_t *acred)
1396 code = afs_link(VTOAFS(dvp), VTOAFS(svp), aname, acred);
1402 gafs_rename(struct vnode *odvp, char *aname1,
1403 struct vnode *ndvp, char *aname2,
1407 struct vcache *aodp = VTOAFS(odvp);
1408 struct vcache *andp = VTOAFS(ndvp);
1411 code = afs_rename(aodp, aname1, andp, aname2, acred);
1412 #ifdef AFS_SUN510_ENV
1414 struct vcache *avcp = NULL;
1416 (void) afs_lookup(andp, aname2, &avcp, NULL, 0, NULL, acred);
1418 struct vnode *vp = AFSTOV(avcp), *pvp = AFSTOV(andp);
1420 # ifdef HAVE_VN_RENAMEPATH
1421 vn_renamepath(pvp, vp, aname2, strlen(aname2));
1423 mutex_enter(&vp->v_lock);
1424 if (vp->v_path != NULL) {
1425 kmem_free(vp->v_path, strlen(vp->v_path) + 1);
1428 mutex_exit(&vp->v_lock);
1429 vn_setpath(afs_globalVp, pvp, vp, aname2, strlen(aname2));
1430 # endif /* !HAVE_VN_RENAMEPATH */
1432 AFS_RELE(AFSTOV(avcp));
1441 gafs_mkdir(struct vnode *dvp, char *aname, struct vattr *attrs,
1442 struct vnode **vpp, afs_ucred_t *acred)
1445 struct vcache *tvc = NULL;
1448 code = afs_mkdir(VTOAFS(dvp), aname, attrs, &tvc, acred);
1460 gafs_rmdir(struct vnode *vp, char *aname, struct vnode *cdirp,
1465 code = afs_rmdir(VTOAFS(vp), aname, cdirp, acred);
1472 gafs_readdir(struct vnode *vp, struct uio *auio,
1473 afs_ucred_t *acred, int *eofp)
1477 code = afs_readdir(VTOAFS(vp), auio, acred, eofp);
1483 gafs_symlink(struct vnode *vp, char *aname, struct vattr *attrs,
1484 char *atargetName, afs_ucred_t *acred)
1488 code = afs_symlink(VTOAFS(vp), aname, attrs, atargetName, NULL, acred);
1495 gafs_readlink(struct vnode *vp, struct uio *auio, afs_ucred_t *acred)
1499 code = afs_readlink(VTOAFS(vp), auio, acred);
1505 gafs_fsync(struct vnode *vp, int flag, afs_ucred_t *acred)
1509 code = afs_fsync(VTOAFS(vp), flag, acred);
1515 afs_inactive(struct vcache *avc, afs_ucred_t *acred)
1517 struct vnode *vp = AFSTOV(avc);
1518 if (afs_shuttingdown != AFS_RUNNING)
1522 * In Solaris and HPUX s800 and HP-UX10.0 they actually call us with
1523 * v_count 1 on last reference!
1525 mutex_enter(&vp->v_lock);
1526 if (avc->vrefCount <= 0)
1527 osi_Panic("afs_inactive : v_count <=0\n");
1530 * If more than 1 don't unmap the vnode but do decrement the ref count
1533 if (vp->v_count > 0) {
1534 mutex_exit(&vp->v_lock);
1537 mutex_exit(&vp->v_lock);
1539 #ifndef AFS_SUN511_ENV
1541 * Solaris calls VOP_OPEN on exec, but doesn't call VOP_CLOSE when
1542 * the executable exits. So we clean up the open count here.
1544 * Only do this for AFS_MVSTAT_FILE vnodes: when using fakestat, we can't
1545 * lose the open count for volume roots (AFS_MVSTAT_ROOT), even though they
1546 * will get VOP_INACTIVE'd when released by afs_PutFakeStat().
1548 if (avc->opens > 0 && avc->mvstat == AFS_MVSTAT_FILE && !(avc->f.states & CCore))
1549 avc->opens = avc->execsOrWriters = 0;
1552 afs_InactiveVCache(avc, acred);
1555 /* VFS_RELE must be called outside of GLOCK, since it can potentially
1556 * call afs_freevfs, which acquires GLOCK */
1557 VFS_RELE(afs_globalVFS);
1564 gafs_inactive(struct vnode *vp, afs_ucred_t *acred)
1567 (void)afs_inactive(VTOAFS(vp), acred);
1573 gafs_fid(struct vnode *vp, struct fid **fidpp)
1577 code = afs_fid(VTOAFS(vp), fidpp);
1582 #if defined(AFS_SUN511_ENV)
1583 /* The following list must always be NULL-terminated */
1584 const fs_operation_def_t afs_vnodeops_template[] = {
1585 VOPNAME_OPEN, { .vop_open = gafs_open },
1586 VOPNAME_CLOSE, { .vop_close = gafs_close },
1587 VOPNAME_READ, { .vop_read = afs_vmread },
1588 VOPNAME_WRITE, { .vop_write = afs_vmwrite },
1589 VOPNAME_IOCTL, { .vop_ioctl = afs_ioctl },
1590 VOPNAME_SETFL, { .vop_setfl = fs_setfl },
1591 VOPNAME_GETATTR, { .vop_getattr = gafs_getattr },
1592 VOPNAME_SETATTR, { .vop_setattr = gafs_setattr },
1593 VOPNAME_ACCESS, { .vop_access = gafs_access },
1594 VOPNAME_LOOKUP, { .vop_lookup = gafs_lookup },
1595 VOPNAME_CREATE, { .vop_create = gafs_create },
1596 VOPNAME_REMOVE, { .vop_remove = gafs_remove },
1597 VOPNAME_LINK, { .vop_link = gafs_link },
1598 VOPNAME_RENAME, { .vop_rename = gafs_rename },
1599 VOPNAME_MKDIR, { .vop_mkdir = gafs_mkdir },
1600 VOPNAME_RMDIR, { .vop_rmdir = gafs_rmdir },
1601 VOPNAME_READDIR, { .vop_readdir = gafs_readdir },
1602 VOPNAME_SYMLINK, { .vop_symlink = gafs_symlink },
1603 VOPNAME_READLINK, { .vop_readlink = gafs_readlink },
1604 VOPNAME_FSYNC, { .vop_fsync = gafs_fsync },
1605 VOPNAME_INACTIVE, { .vop_inactive = gafs_inactive },
1606 VOPNAME_FID, { .vop_fid = gafs_fid },
1607 VOPNAME_RWLOCK, { .vop_rwlock = afs_rwlock },
1608 VOPNAME_RWUNLOCK, { .vop_rwunlock = afs_rwunlock },
1609 VOPNAME_SEEK, { .vop_seek = afs_seek },
1610 VOPNAME_CMP, { .vop_cmp = afs_cmp },
1611 VOPNAME_FRLOCK, { .vop_frlock = afs_frlock },
1612 VOPNAME_SPACE, { .vop_space = afs_space },
1613 VOPNAME_REALVP, { .vop_realvp = afs_realvp },
1614 VOPNAME_GETPAGE, { .vop_getpage = afs_getpage },
1615 VOPNAME_PUTPAGE, { .vop_putpage = afs_putpage },
1616 VOPNAME_MAP, { .vop_map = afs_map },
1617 VOPNAME_ADDMAP, { .vop_addmap = afs_addmap },
1618 VOPNAME_DELMAP, { .vop_delmap = afs_delmap },
1619 VOPNAME_POLL, { .vop_poll = fs_poll },
1620 VOPNAME_PATHCONF, { .vop_pathconf = afs_pathconf },
1621 VOPNAME_PAGEIO, { .vop_pageio = afs_pageio },
1622 VOPNAME_DUMP, { .vop_dump = afs_dump },
1623 VOPNAME_DUMPCTL, { .vop_dumpctl = afs_dumpctl },
1624 VOPNAME_DISPOSE, { .vop_dispose = afs_dispose },
1625 VOPNAME_GETSECATTR, { .vop_getsecattr = afs_getsecattr },
1626 VOPNAME_SETSECATTR, { .vop_setsecattr = afs_setsecattr },
1627 VOPNAME_SHRLOCK, { .vop_shrlock = fs_shrlock },
1630 vnodeops_t *afs_ops;
1631 #elif defined(AFS_SUN510_ENV)
1632 /* The following list must always be NULL-terminated */
1633 const fs_operation_def_t afs_vnodeops_template[] = {
1634 VOPNAME_OPEN, gafs_open,
1635 VOPNAME_CLOSE, gafs_close,
1636 VOPNAME_READ, afs_vmread,
1637 VOPNAME_WRITE, afs_vmwrite,
1638 VOPNAME_IOCTL, afs_ioctl,
1639 VOPNAME_SETFL, fs_setfl,
1640 VOPNAME_GETATTR, gafs_getattr,
1641 VOPNAME_SETATTR, gafs_setattr,
1642 VOPNAME_ACCESS, gafs_access,
1643 VOPNAME_LOOKUP, gafs_lookup,
1644 VOPNAME_CREATE, gafs_create,
1645 VOPNAME_REMOVE, gafs_remove,
1646 VOPNAME_LINK, gafs_link,
1647 VOPNAME_RENAME, gafs_rename,
1648 VOPNAME_MKDIR, gafs_mkdir,
1649 VOPNAME_RMDIR, gafs_rmdir,
1650 VOPNAME_READDIR, gafs_readdir,
1651 VOPNAME_SYMLINK, gafs_symlink,
1652 VOPNAME_READLINK, gafs_readlink,
1653 VOPNAME_FSYNC, gafs_fsync,
1654 VOPNAME_INACTIVE, gafs_inactive,
1655 VOPNAME_FID, gafs_fid,
1656 VOPNAME_RWLOCK, afs_rwlock,
1657 VOPNAME_RWUNLOCK, afs_rwunlock,
1658 VOPNAME_SEEK, afs_seek,
1659 VOPNAME_CMP, afs_cmp,
1660 VOPNAME_FRLOCK, afs_frlock,
1661 VOPNAME_SPACE, afs_space,
1662 VOPNAME_REALVP, afs_realvp,
1663 VOPNAME_GETPAGE, afs_getpage,
1664 VOPNAME_PUTPAGE, afs_putpage,
1665 VOPNAME_MAP, afs_map,
1666 VOPNAME_ADDMAP, afs_addmap,
1667 VOPNAME_DELMAP, afs_delmap,
1668 VOPNAME_POLL, fs_poll,
1669 VOPNAME_DUMP, afs_dump,
1670 VOPNAME_PATHCONF, afs_pathconf,
1671 VOPNAME_PAGEIO, afs_pageio,
1672 VOPNAME_DUMPCTL, afs_dumpctl,
1673 VOPNAME_DISPOSE, afs_dispose,
1674 VOPNAME_GETSECATTR, afs_getsecattr,
1675 VOPNAME_SETSECATTR, afs_setsecattr,
1676 VOPNAME_SHRLOCK, fs_shrlock,
1679 struct vnodeops *afs_ops;
1681 struct vnodeops Afs_vnodeops = {
1726 struct vnodeops *afs_ops = &Afs_vnodeops;
1729 #endif /* AFS_GLOBAL_SUNLOCK */