extern ino_t VnodeToIno(vnode_t * vp);
extern dev_t VnodeToDev(vnode_t * vp);
+#define osi_curproc() current_proc()
+
+/* FIXME */
+#define osi_curcred() &afs_osi_cred
+
#endif /* KERNEL */
#endif /* _OSI_MACHDEP_H_ */
return EBUSY;
/* if a lock is held, give up */
- if (CheckLock(&avc->lock) || afs_CheckBozonLock(&avc->pvnLock))
+ if (CheckLock(&avc->lock))
return EBUSY;
AFS_GUNLOCK();
if (AFSTOV(vc) != vp)
panic("AFS open changed vnode!");
#endif
- afs_BozonLock(&vc->pvnLock, vc);
osi_FlushPages(vc, ap->a_cred);
- afs_BozonUnlock(&vc->pvnLock, vc);
AFS_GUNLOCK();
#ifdef AFS_DARWIN14_ENV
if (error && didhold)
code = afs_close(avc, ap->a_fflag, ap->a_cred, ap->a_p);
else
code = afs_close(avc, ap->a_fflag, &afs_osi_cred, ap->a_p);
- afs_BozonLock(&avc->pvnLock, avc);
osi_FlushPages(avc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */
- afs_BozonUnlock(&avc->pvnLock, avc);
AFS_GUNLOCK();
#ifdef AFS_DARWIN14_ENV
if (UBCINFOEXISTS(ap->a_vp) && ap->a_vp->v_ubcinfo->ui_refcount < 2) {
int code;
struct vcache *avc = VTOAFS(ap->a_vp);
AFS_GLOCK();
- afs_BozonLock(&avc->pvnLock, avc);
osi_FlushPages(avc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */
code = afs_read(avc, ap->a_uio, ap->a_cred, 0, 0, 0);
- afs_BozonUnlock(&avc->pvnLock, avc);
AFS_GUNLOCK();
return code;
}
auio.uio_resid = aiov.iov_len = size;
aiov.iov_base = (caddr_t) ioaddr;
AFS_GLOCK();
- afs_BozonLock(&tvc->pvnLock, tvc);
osi_FlushPages(tvc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */
code = afs_read(tvc, uio, cred, 0, 0, 0);
if (code == 0) {
tvc->states |= CMAPPED;
ReleaseWriteLock(&tvc->lock);
}
- afs_BozonUnlock(&tvc->pvnLock, tvc);
AFS_GUNLOCK();
/* Zero out rest of last page if there wasn't enough data in the file */
struct vcache *avc = VTOAFS(ap->a_vp);
void *object;
AFS_GLOCK();
- afs_BozonLock(&avc->pvnLock, avc);
osi_FlushPages(avc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */
if (UBCINFOEXISTS(ap->a_vp))
ubc_clean(ap->a_vp, 1);
ap->a_uio->uio_resid);
code =
afs_write(VTOAFS(ap->a_vp), ap->a_uio, ap->a_ioflag, ap->a_cred, 0);
- afs_BozonUnlock(&avc->pvnLock, avc);
AFS_GUNLOCK();
return code;
}
#endif /* ] USV */
AFS_GLOCK();
- afs_BozonLock(&tvc->pvnLock, tvc);
osi_FlushPages(tvc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */
ObtainWriteLock(&tvc->lock, 1);
afs_FakeOpen(tvc);
ObtainWriteLock(&tvc->lock, 1);
afs_FakeClose(tvc, cred);
ReleaseWriteLock(&tvc->lock);
- afs_BozonUnlock(&tvc->pvnLock, tvc);
AFS_GUNLOCK();
kernel_upl_unmap(kernel_map, pl);
if (!nocommit) {
return EBUSY;
/* if a lock is held, give up */
- if (CheckLock(&avc->lock) || afs_CheckBozonLock(&avc->pvnLock))
+ if (CheckLock(&avc->lock))
return EBUSY;
AFS_GUNLOCK();
if (AFSTOV(vc) != ap->a_vp)
panic("AFS open changed vnode!");
#endif
- afs_BozonLock(&vc->pvnLock, vc);
osi_FlushPages(vc, ap->a_cred);
- afs_BozonUnlock(&vc->pvnLock, vc);
AFS_GUNLOCK();
return error;
}
code = afs_close(avc, ap->a_fflag, ap->a_cred);
else
code = afs_close(avc, ap->a_fflag, afs_osi_credp);
- afs_BozonLock(&avc->pvnLock, avc);
osi_FlushPages(avc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */
- afs_BozonUnlock(&avc->pvnLock, avc);
AFS_GUNLOCK();
return code;
}
int code;
struct vcache *avc = VTOAFS(ap->a_vp);
AFS_GLOCK();
- afs_BozonLock(&avc->pvnLock, avc);
osi_FlushPages(avc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */
code = afs_read(avc, ap->a_uio, ap->a_cred, 0, 0, 0);
- afs_BozonUnlock(&avc->pvnLock, avc);
AFS_GUNLOCK();
return code;
}
#endif
AFS_GLOCK();
- afs_BozonLock(&avc->pvnLock, avc);
osi_FlushPages(avc, osi_curcred()); /* hold bozon lock, but not basic vnode lock */
code = afs_read(avc, &uio, osi_curcred(), 0, 0, 0);
- afs_BozonUnlock(&avc->pvnLock, avc);
AFS_GUNLOCK();
pmap_qremove(kva, npages);
int code;
struct vcache *avc = VTOAFS(ap->a_vp);
AFS_GLOCK();
- afs_BozonLock(&avc->pvnLock, avc);
osi_FlushPages(avc, ap->a_cred); /* hold bozon lock, but not basic vnode lock */
code =
afs_write(VTOAFS(ap->a_vp), ap->a_uio, ap->a_ioflag, ap->a_cred, 0);
- afs_BozonUnlock(&avc->pvnLock, avc);
AFS_GUNLOCK();
return code;
}
* sync |= IO_INVAL; */
AFS_GLOCK();
- afs_BozonLock(&avc->pvnLock, avc);
code = afs_write(avc, &uio, sync, osi_curcred(), 0);
- afs_BozonUnlock(&avc->pvnLock, avc);
AFS_GUNLOCK();
pmap_qremove(kva, npages);
return EBUSY;
/* if a lock is held, give up */
- if (CheckLock(&avc->lock) || afs_CheckBozonLock(&avc->pvnLock))
+ if (CheckLock(&avc->lock))
return EBUSY;
AFS_GUNLOCK();
AFS_GUNLOCK();
return EISDIR; /* can't read or write other things */
}
- afs_BozonLock(&avc->pvnLock, avc);
osi_FlushPages(avc); /* hold bozon lock, but not basic vnode lock */
ObtainWriteLock(&avc->lock, 162);
/* adjust parameters when appending files */
code = afs_DoPartialWrite(avc, &treq);
}
ReleaseWriteLock(&avc->lock);
- afs_BozonUnlock(&avc->pvnLock, avc);
if (DO_FLUSH || (!newpage && (cnt < 10))) {
AFS_GUNLOCK();
ubc_flush_dirty(((struct vnode *)avc)->v_object, flags);
AFS_GUNLOCK();
return code;
}
- afs_BozonLock(&avc->pvnLock, avc);
osi_FlushPages(avc); /* ensure old pages are gone */
- afs_BozonUnlock(&avc->pvnLock, avc);
ObtainWriteLock(&avc->lock, 166);
avc->states |= CMAPPED;
ReleaseWriteLock(&avc->lock);
ubc_flush_dirty(vop, 0);
AFS_GLOCK();
- afs_BozonLock(&avc->pvnLock, avc);
ObtainWriteLock(&avc->lock, 167);
afs_Trace4(afs_iclSetp, CM_TRACE_PAGEIN, ICL_TYPE_POINTER, avc,
ICL_TYPE_LONG, offset, ICL_TYPE_LONG, len, ICL_TYPE_INT32,
out:
pl[i] = VM_PAGE_NULL;
ReleaseWriteLock(&avc->lock);
- afs_BozonUnlock(&avc->pvnLock, avc);
afs_Trace3(afs_iclSetp, CM_TRACE_PAGEINDONE, ICL_TYPE_INT32, code,
ICL_TYPE_POINTER, *pagep, ICL_TYPE_INT32, flags);
code = afs_CheckCode(code, &treq, 40);
}
/* first, obtain the proper lock for the VM system */
- afs_BozonLock(&avc->pvnLock, avc);
ObtainWriteLock(&avc->lock, 170);
for (i = 0; i < pcnt; i++) {
vm_page_t page = pl[i];
}
done:
ReleaseWriteLock(&avc->lock);
- afs_BozonUnlock(&avc->pvnLock, avc);
afs_Trace2(afs_iclSetp, CM_TRACE_PAGEOUTDONE, ICL_TYPE_INT32, code,
ICL_TYPE_INT32, avc->m.Length);
AFS_GUNLOCK();
#include "afs/afs_stats.h" /* statistics */
#include "afs/nfsclient.h"
-#if defined(AFS_SUN5_ENV)
/* This file contains Solaris VM-related code for the cache manager. */
#include <sys/mman.h>
pvn_vplist_dirty(AFSTOV(avc), alen, afs_putapage, B_TRUNC | B_INVAL,
acred);
}
-
-#endif /* SUN5 && !NCR */
RCSID
("$Header$");
-#if defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV)
/*
* SOLARIS/osi_vnodeops.c
*
#include <vm/seg_map.h>
#include <vm/seg_vn.h>
#include <vm/rm.h>
-#if defined(AFS_SUN5_ENV)
#include <sys/modctl.h>
#include <sys/syscall.h>
-#else
-#include <vm/swap.h>
-#endif
#include <sys/debug.h>
-#if defined(AFS_SUN5_ENV)
#include <sys/fs_subr.h>
-#endif
-#if defined(AFS_SUN5_ENV)
/*
* XXX Temporary fix for problems with Solaris rw_tryupgrade() lock.
* It isn't very persistent in getting the upgrade when others are
}
}
#endif
-#endif
/* Translate a faultcode_t as returned by some of the vm routines
int afs_pvn_vptrunc;
-#ifdef AFS_SUN5_ENV
-
int
afs_addmap(avp, offset, asp, addr, length, prot, maxprot, flags, credp)
register struct vnode *avp;
return code;
}
-#endif /* AFS_SUN5_ENV */
-
int
afs_getpage(vp, off, len, protp, pl, plsz, seg, addr, rw, acred)
struct vnode *vp;
struct page *pl[];
u_int plsz;
struct seg *seg;
-#ifdef AFS_SUN5_ENV
offset_t off;
caddr_t addr;
-#else
- u_int off;
- addr_t addr;
-#endif
enum seg_rw rw;
struct AFS_UCRED *acred;
{
register afs_int32 code = 0;
AFS_STATCNT(afs_getpage);
-#ifdef AFS_SUN5_ENV
if (vp->v_flag & VNOMAP) /* File doesn't allow mapping */
return (ENOSYS);
-#endif
AFS_GLOCK();
afs_GetOnePage(vp, off, len, protp, pl, plsz, seg, addr, rw,
acred);
#else
-#ifdef AFS_SUN5_ENV
if (len <= PAGESIZE)
code =
afs_GetOnePage(vp, (u_int) off, len, protp, pl, plsz, seg, addr,
rw, acred);
-#else
- if (len == PAGESIZE)
- code = afs_GetOnePage(vp, off, protp, pl, plsz, seg, addr, rw, acred);
-#endif
#endif
else {
struct vcache *vcp = VTOAFS(vp);
-#ifdef AFS_SUN5_ENV
ObtainWriteLock(&vcp->vlock, 548);
vcp->multiPage++;
ReleaseWriteLock(&vcp->vlock);
-#endif
afs_BozonLock(&vcp->pvnLock, vcp);
#if defined(AFS_SUN56_ENV)
code =
plsz, seg, addr, rw, acred);
#endif
afs_BozonUnlock(&vcp->pvnLock, vcp);
-#ifdef AFS_SUN5_ENV
ObtainWriteLock(&vcp->vlock, 549);
vcp->multiPage--;
ReleaseWriteLock(&vcp->vlock);
-#endif
}
AFS_GUNLOCK();
return code;
}
/* Return all the pages from [off..off+len) in file */
-#ifdef AFS_SUN5_ENV
int
afs_GetOnePage(vp, off, alen, protp, pl, plsz, seg, addr, rw, acred)
u_int alen;
-#else
-int
-afs_GetOnePage(vp, off, protp, pl, plsz, seg, addr, rw, acred)
-#endif
struct vnode *vp;
#if defined(AFS_SUN56_ENV)
u_offset_t off;
struct page *pl[];
u_int plsz;
struct seg *seg;
-#ifdef AFS_SUN5_ENV
caddr_t addr;
-#else
- addr_t addr;
-#endif
enum seg_rw rw;
struct AFS_UCRED *acred;
{
afs_size_t offset, nlen;
struct vrequest treq;
afs_int32 mapForRead = 0, Code = 0;
-#if defined(AFS_SUN56_ENV)
u_offset_t toffset;
-#else
- afs_int32 toffset;
-#endif
if (!acred)
-#ifdef AFS_SUN5_ENV
osi_Panic("GetOnePage: !acred");
-#else
- acred = u.u_cred; /* better than nothing */
-#endif
avc = VTOAFS(vp); /* cast to afs vnode */
-#ifdef AFS_SUN5_ENV
if (avc->credp /*&& AFS_NFSXLATORREQ(acred) */
&& AFS_NFSXLATORREQ(avc->credp)) {
acred = avc->credp;
}
-#endif
if (code = afs_InitReq(&treq, acred))
return code;
if (!pl) {
/* This is a read-ahead request, e.g. due to madvise. */
-#ifdef AFS_SUN5_ENV
int plen = alen;
-#else
- int plen = PAGESIZE;
-#endif
ObtainReadLock(&avc->lock);
while (plen > 0 && !afs_BBusy()) {
if (protp)
*protp = PROT_ALL;
-#ifndef AFS_SUN5_ENV
- if (AFS_NFSXLATORREQ(acred)) {
- if (rw == S_READ) {
- if (!afs_AccessOK
- (avc, PRSFS_READ, &treq,
- CHECK_MODE_BITS | CMB_ALLOW_EXEC_AS_READ)) {
- return EACCES;
- }
- }
- }
-#endif
retry:
-#ifdef AFS_SUN5_ENV
if (rw == S_WRITE || rw == S_CREATE)
tdc = afs_GetDCache(avc, (afs_offs_t) off, &treq, &offset, &nlen, 5);
else
tdc = afs_GetDCache(avc, (afs_offs_t) off, &treq, &offset, &nlen, 1);
if (!tdc)
return EINVAL;
-#endif
code = afs_VerifyVCache(avc, &treq);
if (code) {
-#ifdef AFS_SUN5_ENV
afs_PutDCache(tdc);
-#endif
return afs_CheckCode(code, &treq, 44); /* failed to get it */
}
tlen = len;
slot = 0;
toffset = off;
-#ifdef AFS_SUN5_ENV
/* Check to see if we're in the middle of a VM purge, and if we are, release
* the locks and try again when the VM purge is done. */
ObtainWriteLock(&avc->vlock, 550);
goto retry;
}
ReleaseWriteLock(&avc->vlock);
-#endif
/* We're about to do stuff with our dcache entry.. Lock it. */
ObtainReadLock(&tdc->lock);
/* if we make it here, we can't find the page in memory. Do a real disk read
* from the cache to get the data */
Code |= 0x200; /* XXX */
-#ifdef AFS_SUN5_ENV
#if defined(AFS_SUN54_ENV)
/* use PG_EXCL because we know the page does not exist already. If it
* actually does exist, we have somehow raced between lookup and create.
}
if (alen < PAGESIZE)
pagezero(page, alen, PAGESIZE - alen);
-#else
- page = rm_allocpage(seg, addr, PAGESIZE, 1); /* can't fail */
- if (!page)
- osi_Panic("afs_getpage alloc page");
- /* we get a circularly-linked list of pages back, but we expect only
- * one, since that's what we asked for */
- if (page->p_next != page)
- osi_Panic("afs_getpage list");
- /* page enter returns a locked page; we'll drop the lock as a side-effect
- * of the pvn_done done by afs_ustrategy. If we decide not to call
- * strategy, we must be sure to call pvn_fail, at least, to release the
- * page locks and otherwise reset the pages. The page, while locked, is
- * not held, for what it is worth */
- page->p_intrans = 1; /* set appropriate flags */
- page->p_pagein = 1;
- /* next call shouldn't fail, since we have pvnLock set */
- if (page_enter(page, vp, toffset))
- osi_Panic("afs_getpage enter race");
-#endif /* AFS_SUN5_ENV */
-
-#ifdef AFS_SUN5_ENV
+
if (rw == S_CREATE) {
/* XXX Don't read from AFS in write only cases XXX */
page_io_unlock(page);
} else
-#else
- if (0) {
- /* XXX Don't read from AFS in write only cases XXX */
- page->p_intrans = page->p_pagein = 0;
- page_unlock(page); /* XXX */
- } else
-#endif
{
-#ifndef AFS_SUN5_ENV
- PAGE_HOLD(page);
-#endif
/* now it is time to start I/O operation */
buf = pageio_setup(page, PAGESIZE, vp, B_READ); /* allocate a buf structure */
-#if defined(AFS_SUN5_ENV)
buf->b_edev = 0;
-#endif
buf->b_dev = 0;
buf->b_blkno = btodb(toffset);
bp_mapin(buf); /* map it in to our address space */
-#if defined(AFS_SUN5_ENV)
AFS_GLOCK();
/* afs_ustrategy will want to lock the dcache entry */
ReleaseReadLock(&tdc->lock);
code = afs_ustrategy(buf, acred); /* do the I/O */
ObtainReadLock(&tdc->lock);
AFS_GUNLOCK();
-#else
- ReleaseReadLock(&tdc->lock);
- ReleaseReadLock(&avc->lock);
- code = afs_ustrategy(buf); /* do the I/O */
- ObtainReadLock(&avc->lock);
- ObtainReadLock(&tdc->lock);
-#endif
-#ifdef AFS_SUN5_ENV
/* Before freeing unmap the buffer */
bp_mapout(buf);
pageio_done(buf);
-#endif
if (code) {
-#ifndef AFS_SUN5_ENV
- PAGE_RELE(page);
-#endif
goto bad;
}
-#ifdef AFS_SUN5_ENV
page_io_unlock(page);
-#endif
}
/* come here when we have another page (already held) to enter */
nextpage:
/* put page in array and continue */
-#ifdef AFS_SUN5_ENV
/* The p_selock must be downgraded to a shared lock after the page is read */
#if defined(AFS_SUN56_ENV)
if ((rw != S_CREATE) && !(PAGE_SHARED(page)))
{
page_downgrade(page);
}
-#endif
pl[slot++] = page;
-#ifdef AFS_SUN5_ENV
code = page_iolock_assert(page);
-#endif
code = 0;
toffset += PAGESIZE;
addr += PAGESIZE;
}
ReleaseReadLock(&avc->lock);
-#ifdef AFS_SUN5_ENV
ObtainWriteLock(&afs_xdcache, 246);
if (!mapForRead) {
/* track that we have dirty (or dirty-able) pages for this chunk. */
}
afs_indexFlags[tdc->index] |= IFAnyPages;
ReleaseWriteLock(&afs_xdcache);
-#endif
afs_BozonUnlock(&avc->pvnLock, avc);
-#ifdef AFS_SUN5_ENV
afs_PutDCache(tdc);
-#endif
afs_Trace3(afs_iclSetp, CM_TRACE_PAGEINDONE, ICL_TYPE_LONG, code,
ICL_TYPE_LONG, (int)page, ICL_TYPE_LONG, Code);
return 0;
afs_Trace3(afs_iclSetp, CM_TRACE_PAGEINDONE, ICL_TYPE_LONG, code,
ICL_TYPE_LONG, (int)page, ICL_TYPE_LONG, Code);
/* release all pages, drop locks, return code */
-#ifdef AFS_SUN5_ENV
if (page)
pvn_read_done(page, B_ERROR);
-#else
- for (i = 0; i < slot; i++)
- PAGE_RELE(pl[i]);
-#endif
ReleaseReadLock(&avc->lock);
afs_BozonUnlock(&avc->pvnLock, avc);
-#ifdef AFS_SUN5_ENV
ReleaseReadLock(&tdc->lock);
afs_PutDCache(tdc);
-#endif
return code;
}
-#ifdef AFS_SUN5_ENV
int
afs_putpage(vp, off, len, flags, cred)
struct vnode *vp;
return code;
}
-#else /* AFS_SUN5_ENV */
-
-int
-afs_putpage(vp, off, len, flags, cred)
- struct vnode *vp;
- u_int off;
- u_int len;
- int flags;
- struct AFS_UCRED *cred;
-{
- int wholeEnchilada; /* true if we must get all of the pages */
- struct vcache *avc;
- struct page *pages;
- struct page *tpage;
- struct buf *tbuf;
- afs_int32 tlen;
- afs_int32 code = 0, rcode;
- afs_int32 poffset;
- afs_int32 clusterStart, clusterEnd, endPos;
-
- /* In the wholeEnchilada case, we must ensure that we get all of the pages
- * from the system, since we're doing this to shutdown the use of a vnode */
-
- AFS_STATCNT(afs_putpage);
- wholeEnchilada = (off == 0 && len == 0
- && (flags & (B_INVAL | B_ASYNC)) == B_INVAL);
-
- avc = VTOAFS(vp);
- afs_BozonLock(&avc->pvnLock, avc);
- ObtainWriteLock(&avc->lock, 248);
-
- while (1) {
- /* in whole enchilada case, loop until call to pvn_getdirty can't find
- * any more modified pages */
-
- /* first we try to get a list of modified (or whatever) pages */
- if (len == 0) {
- pages = pvn_vplist_dirty(vp, off, flags);
- } else {
- endPos = off + len; /* position we're supposed to write up to */
- if (endPos > avc->m.Length)
- endPos = avc->m.Length; /* bound by this */
- clusterStart = off & ~(PAGESIZE - 1); /* round down to nearest page */
- clusterEnd = ((endPos - 1) | (PAGESIZE - 1)) + 1; /* round up to nearest page */
- pages =
- pvn_range_dirty(vp, off, endPos, clusterStart, clusterEnd,
- flags);
- }
-
- /* Now we've got the modified pages. All pages are locked and held */
- rcode = 0; /* return code */
- while (pages) { /* look over all pages in the returned set */
- tpage = pages; /* get first page in the list */
-
- /* write out the page */
- poffset = tpage->p_offset; /* where the page starts in the file */
- /* tlen will represent the end of the range to write, for a while */
- tlen = PAGESIZE + poffset; /* basic place to end tpage write */
- /* but we also don't want to write past end of off..off+len range */
- if (len != 0 && tlen > off + len)
- tlen = off + len;
- /* and we don't want to write past the end of the file */
- if (tlen > avc->m.Length)
- tlen = avc->m.Length;
- /* and we don't want to write at all if page starts after end */
- if (poffset >= tlen) {
- pvn_fail(pages, B_WRITE | flags);
- goto done;
- }
- /* finally change tlen from end position to length */
- tlen -= poffset; /* compute bytes to write from this page */
- page_sub(&pages, tpage); /* remove tpage from "pages" list */
- tbuf = pageio_setup(tpage, tlen, vp, B_WRITE | flags);
- if (!tbuf) {
- pvn_fail(tpage, B_WRITE | flags);
- pvn_fail(pages, B_WRITE | flags);
- goto done;
- }
- tbuf->b_dev = 0;
- tbuf->b_blkno = btodb(tpage->p_offset);
- bp_mapin(tbuf);
- ReleaseWriteLock(&avc->lock); /* can't hold during strategy call */
- code = afs_ustrategy(tbuf); /* unlocks page */
- ObtainWriteLock(&avc->lock, 249); /* re-obtain */
- if (code) {
- /* unlocking of tpage is done by afs_ustrategy */
- rcode = code;
- if (pages) /* may have already removed last page */
- pvn_fail(pages, B_WRITE | flags);
- goto done;
- }
- } /* for (tpage=pages....) */
-
- /* see if we've gotten all of the pages in the whole enchilada case */
- if (!wholeEnchilada || !vp->v_pages)
- break;
- } /* while(1) obtaining all pages */
-
- /*
- * If low on chunks, and if writing the last byte of a chunk, try to
- * free some. Note that afs_DoPartialWrite calls osi_SyncVM which now
- * calls afs_putpage, so this is recursion. It stops there because we
- * insist on len being non-zero.
- */
- if (afs_stats_cmperf.cacheCurrDirtyChunks >
- afs_stats_cmperf.cacheMaxDirtyChunks && len != 0
- && AFS_CHUNKOFFSET((off + len)) == 0) {
- struct vrequest treq;
- if (!afs_InitReq(&treq, cred ? cred : u.u_cred)) {
- rcode = afs_DoPartialWrite(avc, &treq); /* XXX */
- }
- }
-
- done:
-
- if (rcode && !avc->vc_error)
- avc->vc_error = rcode;
-
- /* when we're here, we just return code. */
- ReleaseWriteLock(&avc->lock);
- afs_BozonUnlock(&avc->pvnLock, avc);
- return rcode;
-}
-
-#endif /* AFS_SUN5_ENV */
-
int
afs_nfsrdwr(avc, auio, arw, ioflag, acred)
register struct vcache *avc;
return (EFBIG);
#endif
-#ifdef AFS_SUN5_ENV
if (!acred)
osi_Panic("rdwr: !acred");
-#else
- if (!acred)
- acred = u.u_cred;
-#endif
+
if (code = afs_InitReq(&treq, acred))
return code;
return EACCES;
}
}
-#ifdef AFS_SUN5_ENV
crhold(acred);
if (avc->credp) {
crfree(avc->credp);
}
avc->credp = acred;
-#endif
}
counter = 0; /* don't call afs_DoPartialWrite first time through. */
while (1) {
}
sflags = 0;
} else {
-#ifdef AFS_SUN5_ENV
/* Purge dirty chunks of file if there are too many dirty
* chunks. Inside the write loop, we only do this at a chunk
* boundary. Clean up partial chunk if necessary at end of loop.
if (code)
break;
}
-#endif /* AFS_SUN5_ENV */
/* write case, we ask segmap_release to call putpage. Really, we
* don't have to do this on every page mapin, but for now we're
* lazy, and don't modify the rest of AFS to scan for modified
code = 0;
break; /* nothing to transfer, we're done */
}
-#ifdef AFS_SUN5_ENV
if (arw == UIO_WRITE)
avc->states |= CDirty; /* may have been cleared by DoPartialWrite */
break;
}
}
-#endif
ReleaseWriteLock(&avc->lock); /* uiomove may page fault */
AFS_GUNLOCK();
#if defined(AFS_SUN56_ENV)
data = segmap_getmap(segkmap, AFSTOV(avc), (u_offset_t) pageBase);
-#else
- data = segmap_getmap(segkmap, AFSTOV(avc), pageBase);
-#endif
-#ifndef AFS_SUN5_ENV
- code =
- afs_fc2errno(as_fault
- (&kas, data + pageOffset, tsize, F_SOFTLOCK, mode));
- if (code == 0) {
- AFS_UIOMOVE(data + pageOffset, tsize, arw, auio, code);
- as_fault(&kas, data + pageOffset, tsize, F_SOFTUNLOCK, mode);
- code2 = segmap_release(segkmap, data, sflags);
- if (!code)
- code = code2;
- } else {
- (void)segmap_release(segkmap, data, 0);
- }
-#else
-#if defined(AFS_SUN56_ENV)
raddr = (caddr_t) (((uintptr_t) data + pageOffset) & PAGEMASK);
#else
+ data = segmap_getmap(segkmap, AFSTOV(avc), pageBase);
raddr = (caddr_t) (((u_int) data + pageOffset) & PAGEMASK);
#endif
rsize =
} else {
(void)segmap_release(segkmap, data, 0);
}
-#endif /* AFS_SUN5_ENV */
AFS_GLOCK();
ObtainWriteLock(&avc->lock, 253);
-#ifdef AFS_SUN5_ENV
counter++;
if (dcp)
afs_PutDCache(dcp);
-#endif /* AFS_SUN5_ENV */
if (code)
break;
}
if (didFakeOpen) {
afs_FakeClose(avc, acred);
}
-#ifdef AFS_SUN5_ENV
if (arw == UIO_WRITE && (avc->states & CDirty)) {
code2 = afs_DoPartialWrite(avc, &treq);
if (!code)
code = code2;
}
-#endif /* AFS_SUN5_ENV */
if (!code && avc->vc_error) {
code = avc->vc_error;
afs_map(vp, off, as, addr, len, prot, maxprot, flags, cred)
struct vnode *vp;
struct as *as;
-#ifdef AFS_SUN5_ENV
offset_t off;
caddr_t *addr;
-#else
- u_int off;
- addr_t *addr;
-#endif
u_int len;
-#ifdef AFS_SUN5_ENV
u_char prot, maxprot;
-#else
- u_int prot, maxprot;
-#endif
u_int flags;
struct AFS_UCRED *cred;
{
}
#endif
-#if defined(AFS_SUN5_ENV)
if (vp->v_flag & VNOMAP) /* File isn't allowed to be mapped */
return (ENOSYS);
if (vp->v_filocks) /* if locked, disallow mapping */
return (EAGAIN);
-#endif
+
AFS_GLOCK();
if (code = afs_InitReq(&treq, cred))
goto out;
afs_BozonUnlock(&avc->pvnLock, avc);
AFS_GUNLOCK();
-#ifdef AFS_SUN5_ENV
as_rangelock(as);
-#endif
if ((flags & MAP_FIXED) == 0) {
#if defined(AFS_SUN57_ENV)
map_addr(addr, len, off, 1, flags);
map_addr(addr, len, (off_t) off, 1);
#endif
if (*addr == NULL) {
-#ifdef AFS_SUN5_ENV
as_rangeunlock(as);
-#endif
code = ENOMEM;
goto out1;
}
crargs.prot = prot;
crargs.maxprot = maxprot;
crargs.amp = (struct anon_map *)0;
-#if defined(AFS_SUN5_ENV)
crargs.flags = flags & ~MAP_TYPE;
-#endif
code = as_map(as, *addr, len, segvn_create, (char *)&crargs);
-#ifdef AFS_SUN5_ENV
as_rangeunlock(as);
-#endif
out1:
AFS_GLOCK();
code = afs_CheckCode(code, &treq, 47);
return code;
}
-/* Sun 4.0.X-specific code. It computes the number of bytes that need
- to be zeroed at the end of a page by pvn_vptrunc, given that you're
- trying to get vptrunc to truncate a file to alen bytes. The result
- will be passed to pvn_vptrunc by the truncate code */
-#ifndef AFS_SUN5_ENV /* Not good for Solaris */
-afs_PageLeft(alen)
- register afs_int32 alen;
-{
- register afs_int32 nbytes;
-
- AFS_STATCNT(afs_PageLeft);
- nbytes = PAGESIZE - (alen & PAGEOFFSET); /* amount to zap in last page */
- /* now check if we'd zero the entire last page. Don't need to do this
- * since pvn_vptrunc will handle this case properly (it will invalidate
- * this page) */
- if (nbytes == PAGESIZE)
- nbytes = 0;
- if (nbytes < 0)
- nbytes = 0; /* just in case */
- return nbytes;
-}
-#endif
-
/*
* For Now We use standard local kernel params for AFS system values. Change this
* at some point.
*/
-#if defined(AFS_SUN5_ENV)
afs_pathconf(vp, cmd, outdatap, credp)
register struct AFS_UCRED *credp;
-#else
-afs_cntl(vp, cmd, indatap, outdatap, inflag, outflag)
- int inflag, outflag;
- char *indatap;
-#endif
struct vnode *vp;
int cmd;
u_long *outdatap;
case _PC_NO_TRUNC:
*outdatap = 1;
break;
-#if !defined(AFS_SUN5_ENV)
- case _PC_MAX_CANON:
- *outdatap = CANBSIZ;
- break;
- case _PC_VDISABLE:
- *outdatap = VDISABLE;
- break;
- case _PC_PIPE_BUF:
- return EINVAL;
- break;
-#endif
default:
return EINVAL;
}
return 0;
}
-#endif /* AFS_SUN_ENV */
-
-#if defined(AFS_SUN5_ENV)
-
afs_ioctl(vnp, com, arg, flag, credp, rvalp)
struct vnode *vnp;
int com, arg, flag;
return (code);
}
-
-#endif
-
int
afs_dump(vp, addr, i1, i2)
struct vnode *vp;
AFS_STATCNT(afs_CopyOutAttrs);
if (afs_fakestat_enable && avc->mvstat == 1)
fakedir = 1;
-#if defined(AFS_MACH_ENV )
- attrs->va_mode =
- fakedir ? VDIR | 0755 : vType(avc) | (avc->m.Mode & ~VFMT);
-#else /* AFS_MACH_ENV */
attrs->va_type = fakedir ? VDIR : vType(avc);
#if defined(AFS_SGI_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_SUN5_ENV)
attrs->va_mode = fakedir ? 0755 : (mode_t) (avc->m.Mode & 0xffff);
#else
attrs->va_mode = fakedir ? VDIR | 0755 : avc->m.Mode;
#endif
-#endif /* AFS_MACH_ENV */
if (avc->m.Mode & (VSUID | VSGID)) {
/* setuid or setgid, make sure we're allowed to run them from this cell */
#endif /* AFS_DARWIN_ENV */
attrs->va_uid = fakedir ? 0 : avc->m.Owner;
attrs->va_gid = fakedir ? 0 : avc->m.Group; /* yeah! */
-#if defined(AFS_SUN56_ENV)
+#if defined(AFS_SUN56_ENV)
attrs->va_fsid = avc->v.v_vfsp->vfs_fsid.val[0];
-#else
-#ifdef AFS_SUN5_ENV
- /* XXX We try making this match the vfs's dev field XXX */
- attrs->va_fsid = 1;
-#else
-#ifdef AFS_OSF_ENV
+#elif defined(AFS_OSF_ENV)
attrs->va_fsid = avc->v.v_mount->m_stat.f_fsid.val[0];
-#else
-#ifdef AFS_DARWIN70_ENV
+#elif defined(AFS_DARWIN70_ENV)
attrs->va_fsid = avc->v.v_mount->mnt_stat.f_fsid.val[0];
-#else /* ! AFS_DARWIN70_ENV */
+#else
attrs->va_fsid = 1;
-#endif /* AFS_DARWIN70_ENV */
-#endif
-#endif
-#endif /* AFS_SUN56_ENV */
+#endif
if (avc->mvstat == 2) {
tvp = afs_GetVolume(&avc->fid, 0, READ_LOCK);
/* The mount point's vnode. */
#else
attrs->va_blocksize = PAGESIZE; /* XXX Was 8192 XXX */
#endif
-#ifdef AFS_DEC_ENV
- /* Have to use real device #s in Ultrix, since that's how FS type is
- * encoded. If rdev doesn't match Ultrix equivalent of statfs's rdev, then
- * "df ." doesn't work.
- */
- if (afs_globalVFS && afs_globalVFS->vfs_data)
- attrs->va_rdev = ((struct mount *)(afs_globalVFS->vfs_data))->m_dev;
- else
- attrs->va_rdev = 1; /* better than nothing */
-#else
attrs->va_rdev = 1;
-#endif
#if defined(AFS_HPUX110_ENV)
if (afs_globalVFS)
attrs->va_fstype = afs_globalVFS->vfs_mtype;
/* And linux has its own stash as well. */
vattr2inode(AFSTOV(avc), attrs);
#endif
-#ifdef notdef
-#ifdef AFS_AIX51_ENV
- afs_Trace2(afs_iclSetp, CM_TRACE_STATACLX, ICL_TYPE_POINTER,
- attrs->va_acl, ICL_TYPE_INT32, attrs->va_aclsiz);
- if (attrs->va_acl && attrs->va_aclsiz >= 12) {
- struct acl *ap;
-
- ap = (struct acl *)attrs->va_acl;
- ap->acl_len = 8;
- ap->acl_mode = ACL_MODE;
- ap->acl_rsvd = 0;
- ap->u_access = 7;
- }
- /* temporary fix ? */
- attrs->va_aclsiz = 1;
-#endif
-#endif
return 0;
}
}
#endif
-#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV)
+#ifdef AFS_BOZONLOCK_ENV
afs_BozonLock(&avc->pvnLock, avc);
#endif
} else
code = 0;
-#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV)
+#ifdef AFS_BOZONLOCK_ENV
if (code == 0)
osi_FlushPages(avc, acred);
afs_BozonUnlock(&avc->pvnLock, avc);
CMB_ALLOW_EXEC_AS_READ)) {
return EACCES;
}
-#if 0
-/* The effect of the following is to force the NFS client to refetch the
- * volume root every time, since the mtime changes. For Solaris 9 NFSv3
- * clients, this means looping forever, since for some reason (related
- * to caching?) it wants the mtime to be consistent two reads in a row.
- * Why are volume roots special???
- * --jhutz 2-May-2004
- */
- if (avc->mvstat == 2) {
-#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
- attrs->va_mtime.tv_nsec += ((++avc->xlatordv) * 1000);
-#else
- attrs->va_mtime.tv_usec += ++avc->xlatordv;
-#endif
- }
-#endif
}
if ((au = afs_FindUser(treq.uid, -1, READ_LOCK))) {
register struct afs_exporter *exporter = au->exporter;
if (av->va_mask & ATTR_GID) {
#elif defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
if (av->va_mask & AT_GID) {
-#elif (defined(AFS_HPUX_ENV) || defined(AFS_SUN_ENV))
+#elif defined(AFS_HPUX_ENV)
#if defined(AFS_HPUX102_ENV)
if (av->va_gid != GID_NO_CHANGE) {
#else
if (av->va_mask & ATTR_UID) {
#elif defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
if (av->va_mask & AT_UID) {
-#elif (defined(AFS_HPUX_ENV) || defined(AFS_SUN_ENV))
+#elif defined(AFS_HPUX_ENV)
#if defined(AFS_HPUX102_ENV)
if (av->va_uid != UID_NO_CHANGE) {
#elif defined(AFS_XBSD_ENV)
}
#if defined(AFS_LINUX22_ENV)
if (av->va_mask & ATTR_MTIME) {
-#else
-#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
+#elif defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
if (av->va_mask & AT_MTIME) {
#else
if (av->va_mtime.tv_sec != -1) {
#endif
-#endif
mask |= AFS_SETMODTIME;
#ifndef AFS_SGI_ENV
#if defined(AFS_SUN5_ENV) || defined(AFS_AIX41_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
if (flags & ATTR_LAZY)
goto done;
#endif
-#ifndef AFS_DEC_ENV
/* if file size has changed, we need write access, otherwise (e.g.
* chmod) give it a shot; if it fails, we'll discard the status
* info.
- *
- * Note that Ultrix actually defines ftruncate of a file you have open to
- * be O.K., and does the proper access checks itself in the truncate
- * path (unlike BSD or SUNOS), so we skip this check for Ultrix.
- *
*/
#if defined(AFS_LINUX22_ENV)
if (attrs->va_mask & ATTR_SIZE) {
goto done;
}
}
-#endif
afs_VAttrToAS(avc, attrs, &astat); /* interpret request */
code = 0;
-#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV)
+#ifdef AFS_BOZONLOCK_ENV
afs_BozonLock(&avc->pvnLock, avc);
#endif
#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
ReleaseWriteLock(&avc->lock);
hzero(avc->flushDV);
osi_FlushText(avc); /* do this after releasing all locks */
-#ifdef AFS_DEC_ENV
- /* in case we changed the size here, propagate it to gp->g_size */
- afs_gfshack((struct gnode *)avc);
-#endif
}
if (code == 0) {
ObtainSharedLock(&avc->lock, 16); /* lock entry */
avc->execsOrWriters--;
}
#endif
-#if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV)
+#ifdef AFS_BOZONLOCK_ENV
afs_BozonUnlock(&avc->pvnLock, avc);
#endif
#if defined(AFS_SGI_ENV)
extern int afs_NFSRootOnly; /* 1 => only allow NFS mounts of /afs. */
-#if !defined(AFS_DEC_ENV) && !defined(AFS_ATHENA_ENV)
+#if !defined(AFS_ATHENA_ENV)
int
#ifdef AFS_AIX41_ENV
afs_fid(OSI_VC_DECL(avc), struct fid *fidpp, struct ucred *credp)
#endif
slp->pid = clid;
#else
-#if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
slp->pid = clid;
#else
#if defined(AFS_LINUX20_ENV) || defined(AFS_HPUX_ENV)
#endif
flock->l_pid = clid;
#else
-#if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
flock->l_pid = clid;
#else
#if defined(AFS_LINUX20_ENV) || defined(AFS_HPUX_ENV)
#ifdef AFS_OSF_ENV
int afs_lockctl(struct vcache * avc, struct eflock * af, int flag,
struct AFS_UCRED * acred, pid_t clid, off_t offset)
-#elif defined(AFS_SGI_ENV) || (defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#elif defined(AFS_SGI_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
int afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd,
struct AFS_UCRED * acred, pid_t clid)
#else
acmd = F_SETLK;
}
#endif
-#if (defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)) && !defined(AFS_SUN58_ENV)
+#if (defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)) && !defined(AFS_SUN58_ENV)
if ((acmd == F_GETLK) || (acmd == F_RGETLK)) {
#else
if (acmd == F_GETLK) {
afs_PutFakeStat(&fakestate);
return code;
} else if ((acmd == F_SETLK) || (acmd == F_SETLKW)
-#if (defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)) && !defined(AFS_SUN58_ENV)
+#if (defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)) && !defined(AFS_SUN58_ENV)
|| (acmd == F_RSETLK) || (acmd == F_RSETLKW)) {
#else
) {
return EINVAL; /* unknown lock type */
}
if (((acmd == F_SETLK)
-#if (defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV)) && !defined(AFS_SUN58_ENV)
+#if (defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)) && !defined(AFS_SUN58_ENV)
|| (acmd == F_RSETLK)
#endif
) && code != LOCK_UN)
code |= LOCK_NB; /* non-blocking, s.v.p. */
-#if (defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)) || defined(AFS_OSF_ENV)
+#if defined(AFS_OSF_ENV)
code = HandleFlock(avc, code, &treq, clid, 0 /*!onlymine */ );
#elif defined(AFS_SGI_ENV)
AFS_RWLOCK((vnode_t *) avc, VRWLOCK_WRITE);
tvc = VTOAFS(fd->f_data); /* valid, given a vnode */
if (IsAfsVnode(AFSTOV(tvc))) {
/* This is an AFS vnode, so do the work */
-#ifdef AFS_DEC_ENV
- /* find real vcache entry; shouldn't be null if gnode ref count
- * is greater than 0.
- */
- tvc = VTOAFS(afs_gntovn) (tvc);
- if (!tvc) {
- u.u_error = ENOENT;
- afs_PutFakeStat(&fakestate);
- return;
- }
-#endif
code = afs_EvalFakeStat(&tvc, &fakestate, &treq);
if (code) {
afs_PutFakeStat(&fakestate);
}
if ((fd->f_flag & (FEXLOCK | FSHLOCK)) && !(uap->com & LOCK_UN)) {
/* First, if fd already has lock, release it for relock path */
-#if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || (defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV))
+#if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV)
HandleFlock(tvc, LOCK_UN, &treq, u.u_procp->p_pid,
0 /*!onlymine */ );
#else
}
/* now try the requested operation */
-#if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || (defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV))
+#if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV)
code =
HandleFlock(tvc, uap->com, &treq, u.u_procp->p_pid,
0 /*!onlymine */ );
#endif
/* normal file or symlink */
osi_FlushText(tvc); /* only needed to flush text if text locked last time */
-#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV)
+#ifdef AFS_BOZONLOCK_ENV
afs_BozonLock(&tvc->pvnLock, tvc);
#endif
osi_FlushPages(tvc, acred);
-#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV)
+#ifdef AFS_BOZONLOCK_ENV
afs_BozonUnlock(&tvc->pvnLock, tvc);
#endif
}
AFS_GUNLOCK();
VOP_READ(tfile->vnode, &tuio, 0, afs_osi_credp, code);
AFS_GLOCK();
-#elif defined(AFS_SUN_ENV)
- code = VOP_RDWR(tfile->vnode, &tuio, UIO_READ, 0, afs_osi_credp);
#elif defined(AFS_HPUX100_ENV)
AFS_GUNLOCK();
code = VOP_RDWR(tfile->vnode, &tuio, UIO_READ, 0, afs_osi_credp);
u_short d_reclen;
u_char d_type;
u_char d_namlen;
-#else
-#ifdef AFS_SUN5_ENV
+#elif defined(AFS_SUN5_ENV)
afs_uint32 d_fileno;
afs_int32 d_off;
u_short d_reclen;
#else
-#if defined(AFS_SUN_ENV) || defined(AFS_AIX32_ENV)
+#if defined(AFS_AIX32_ENV)
afs_int32 d_off;
-#endif
-#if defined(AFS_HPUX100_ENV)
+#elif defined(AFS_HPUX100_ENV)
unsigned long long d_off;
#endif
afs_uint32 d_fileno;
u_short d_reclen;
u_short d_namlen;
#endif
-#endif
};
#endif /* AFS_SGI_ENV */
#if !defined(AFS_SGI_ENV)
sdirEntry.d_namlen = slen;
#endif
-#if defined(AFS_SUN_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV)
+#if defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV)
sdirEntry.d_off = off;
#endif
#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
FIXUPSTUPIDINODE(sdirEntry->d_fileno);
sdirEntry->d_reclen = rlen = auio->afsio_resid;
sdirEntry->d_namlen = o_slen;
-#if defined(AFS_SUN_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_HPUX100_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_HPUX100_ENV)
sdirEntry->d_off = origOffset;
#endif
AFS_UIOMOVE((char *)sdirEntry, sizeof(*sdirEntry), UIO_READ,
FIXUPSTUPIDINODE(sdirEntry->d_fileno);
sdirEntry->d_reclen = rlen = auio->afsio_resid;
sdirEntry->d_namlen = o_slen;
-#if defined(AFS_SUN_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_HPUX100_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_HPUX100_ENV)
sdirEntry->d_off = origOffset;
#endif
AFS_UIOMOVE((char *)sdirEntry, sizeof(*sdirEntry), UIO_READ,
FIXUPSTUPIDINODE(sdirEntry->d_fileno);
sdirEntry->d_reclen = rlen = len;
sdirEntry->d_namlen = o_slen;
-#if defined(AFS_SUN_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_HPUX100_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_AIX32_ENV) || defined(AFS_HPUX100_ENV)
sdirEntry->d_off = origOffset;
#endif
AFS_UIOMOVE((char *)sdirEntry, sizeof(*sdirEntry), UIO_READ, auio,
* call FindVCache instead of GetVCache since if the file's really
* gone, we won't be able to fetch the status info anyway. */
if (tvc) {
-#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV)
+#ifdef AFS_BOZONLOCK_ENV
afs_BozonLock(&tvc->pvnLock, tvc);
/* Since afs_TryToSmush will do a pvn_vptrunc */
#endif
afs_TryToSmush(tvc, acred, 0);
}
ReleaseWriteLock(&tvc->lock);
-#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV)
+#ifdef AFS_BOZONLOCK_ENV
afs_BozonUnlock(&tvc->pvnLock, tvc);
#endif
afs_PutVCache(tvc);
tvc = afs_GetVCache(&unlinkFid, areq, NULL, NULL);
if (tvc) {
-#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV)
+#ifdef AFS_BOZONLOCK_ENV
afs_BozonLock(&tvc->pvnLock, tvc); /* Since afs_TryToSmush will do a pvn_vptrunc */
#endif
ObtainWriteLock(&tvc->lock, 151);
afs_TryToSmush(tvc, acred, 0);
}
ReleaseWriteLock(&tvc->lock);
-#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV)
+#ifdef AFS_BOZONLOCK_ENV
afs_BozonUnlock(&tvc->pvnLock, tvc);
#endif
afs_PutVCache(tvc);
*/
tuio.afsio_iov = tiovec;
tuio.afsio_iovcnt = 1;
-#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_XBSD_ENV)
#ifdef AFS_64BIT_CLIENT
tuio.afsio_offset = (afs_offs_t) dbtob(abp->b_blkno);
#else /* AFS_64BIT_CLIENT */
} else {
tuio.afsio_iov = tiovec;
tuio.afsio_iovcnt = 1;
-#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV)
+#if defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV)
#ifdef AFS_64BIT_CLIENT
tuio.afsio_offset = (afs_offs_t) dbtob(abp->b_blkno);
#else /* AFS_64BIT_CLIENT */
*/
len = MIN(len, tvc->m.Length - dbtob(abp->b_blkno));
#endif
-#ifdef AFS_ALPHA_ENV
+#ifdef AFS_OSF_ENV
len =
MIN(abp->b_bcount,
(VTOAFS(abp->b_vp))->m.Length - dbtob(abp->b_blkno));
-#endif /* AFS_ALPHA_ENV */
+#endif /* AFS_OSF_ENV */
tuio.afsio_resid = len;
#if defined(AFS_XBSD_ENV)
tiovec[0].iov_base = abp->b_saveaddr;
*/
avc->m.Date = startDate;
-#if defined(AFS_HPUX_ENV) || defined(AFS_GFS_ENV)
+#if defined(AFS_HPUX_ENV)
#if defined(AFS_HPUX101_ENV)
if ((totalLength + filePos) >> 9 >
(p_rlimit(u.u_procp))[RLIMIT_FSIZE].rlim_cur) {
#else
-#ifdef AFS_HPUX_ENV
if ((totalLength + filePos) >> 9 > u.u_rlimit[RLIMIT_FSIZE].rlim_cur) {
-#else
- if (totalLength + filePos > u.u_rlimit[RLIMIT_FSIZE].rlim_cur) {
-#endif
#endif
if (!noLock)
ReleaseWriteLock(&avc->lock);
if (!noLock)
ReleaseWriteLock(&avc->lock);
osi_FreeSmallSpace(tvec);
-#ifdef AFS_DEC_ENV
- /* next, on GFS systems, we update g_size so that lseek's relative to EOF will
- * work. GFS is truly a poorly-designed interface! */
- afs_gfshack((struct gnode *)avc);
-#endif
error = afs_CheckCode(error, &treq, 6);
return error;
}
*/
avc->m.Date = startDate;
-#if defined(AFS_HPUX_ENV) || defined(AFS_GFS_ENV)
+#if defined(AFS_HPUX_ENV)
#if defined(AFS_HPUX101_ENV)
if ((totalLength + filePos) >> 9 >
p_rlimit(u.u_procp)[RLIMIT_FSIZE].rlim_cur) {
#else
-#ifdef AFS_HPUX_ENV
if ((totalLength + filePos) >> 9 > u.u_rlimit[RLIMIT_FSIZE].rlim_cur) {
-#else
- if (totalLength + filePos > u.u_rlimit[RLIMIT_FSIZE].rlim_cur) {
-#endif
#endif
if (!noLock)
ReleaseWriteLock(&avc->lock);
if (!noLock)
ReleaseWriteLock(&avc->lock);
osi_FreeSmallSpace(tvec);
-#ifdef AFS_DEC_ENV
- /* next, on GFS systems, we update g_size so that lseek's relative to EOF will
- * work. GFS is truly a poorly-designed interface! */
- afs_gfshack((struct gnode *)avc);
-#endif
#ifndef AFS_VM_RDWR_ENV
/*
* If write is implemented via VM, afs_fsync() is called from the high-level
if (flags)
HandleFlock(tvc, LOCK_UN, &treq, u.u_procp->p_pid,
1 /*onlymine */ );
-#ifdef AFS_DEC_ENV
- grele((struct gnode *)tvc);
-#else
AFS_RELE(AFSTOV(tvc));
-#endif
closeDone = 1;
}
}
struct flid *flp;
#endif
#endif
-#elif defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV)
-#ifdef AFS_SUN5_ENV
+#elif defined(AFS_SUN5_ENV)
afs_close(OSI_VC_ARG(avc), aflags, count, offset, acred)
offset_t offset;
-#else
-afs_close(OSI_VC_ARG(avc), aflags, count, acred)
-#endif
int count;
#else
afs_close(OSI_VC_ARG(avc), aflags, acred)
afs_PutFakeStat(&fakestat);
return 0;
}
-#elif defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV)
+#elif defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
if (count > 1) {
/* The vfs layer may call this repeatedly with higher "count"; only on the last close (i.e. count = 1) we should actually proceed with the close. */
afs_PutFakeStat(&fakestat);
afs_chkpgoob(&avc->v, btoc(avc->m.Length));
#else /* AFS_SGI_ENV */
if (avc->flockCount) { /* Release Lock */
-#if defined(AFS_OSF_ENV) || defined(AFS_SUN_ENV)
+#if defined(AFS_OSF_ENV)
HandleFlock(avc, LOCK_UN, &treq, u.u_procp->p_pid, 1 /*onlymine */ );
#else
HandleFlock(avc, LOCK_UN, &treq, 0, 1 /*onlymine */ );
* Macros to uniquely identify the AFS vfs struct
*/
#define AFS_VFSMAGIC 0x1234
-#if defined(AFS_SUN_ENV) || defined(AFS_HPUX90_ENV) || defined(AFS_LINUX20_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_HPUX90_ENV) || defined(AFS_LINUX20_ENV)
#define AFS_VFSFSID 99
#else
#if defined(AFS_SGI_ENV)
krwlock_t rwlock;
struct cred *credp;
#endif
-#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#ifdef AFS_BOZONLOCK_ENV
afs_bozoLock_t pvnLock; /* see locks.x */
#endif
#ifdef AFS_AIX32_ENV
#include "h/param.h"
#include "h/types.h"
#include "h/time.h"
-#if defined(AFS_AIX31_ENV) || defined(AFS_DEC_ENV)
+#if defined(AFS_AIX31_ENV)
#include "h/limits.h"
#endif
#if !defined(AFS_AIX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_SGI_ENV) && !defined(AFS_LINUX20_ENV)
#endif
-#if defined(AFS_AIX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_HPUX_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_AIX_ENV) || defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV)
#define AFS_MINBUFFERS 100
#else
#define AFS_MINBUFFERS 50
while (!afs_InitSetup_done)
afs_osi_Sleep(&afs_InitSetup_done);
-#if defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) || defined(AFS_SUN5_ENV)
temp = AFS_MINBUFFERS; /* Should fix this soon */
#else
/* number of 2k buffers we could get from all of the buffer space */
afs_initState = 101;
afs_setTime = parm2;
afs_osi_Wakeup(&afs_initState);
-#if (!defined(AFS_NONFSTRANS) && !defined(AFS_DEC_ENV)) || defined(AFS_AIX_IAUTH_ENV)
+#if (!defined(AFS_NONFSTRANS)) || defined(AFS_AIX_IAUTH_ENV)
afs_nfsclient_init();
#endif
printf("found %d non-empty cache files (%d%%).\n",
} *uap = (struct a *)u.u_ap;
#else /* UKERNEL */
int
-#if defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)
-afs_syscall()
-#else
Afs_syscall()
-#endif /* SUN && !SUN5 */
{
register struct a {
long syscall;
long parm6;
} *uap = (struct a *)u.u_ap;
#endif /* UKERNEL */
-#if defined(AFS_DEC_ENV)
- int *retval = &u.u_r.r_val1;
-#elif defined(AFS_HPUX_ENV)
+#if defined(AFS_HPUX_ENV)
long *retval = &u.u_rval1;
#else
int *retval = &u.u_rval1;
shutdown_vfsops();
shutdown_exporter();
shutdown_memcache();
-#if !defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV)
-#if !defined(AFS_DEC_ENV) && !defined(AFS_OSF_ENV)
- /* this routine does not exist in Ultrix systems... 93.01.19 */
+#if (!defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV)) && !defined(AFS_OSF_ENV)
shutdown_nfsclnt();
-#endif /* AFS_DEC_ENV */
#endif
shutdown_afstest();
/* The following hold the cm stats */
}
-#if defined(AFS_ALPHA_ENV) || defined(AFS_SGI61_ENV)
+#if defined(AFS_OSF_ENV) || defined(AFS_SGI61_ENV)
/* For SGI 6.2, this can is changed to 1 if it's a 32 bit kernel. */
#if defined(AFS_SGI62_ENV) && defined(KERNEL) && !defined(_K64U64)
int afs_icl_sizeofLong = 1;
(lp)->logElements++; \
MACRO_END
-#if defined(AFS_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
+#if defined(AFS_OSF_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
#define ICL_APPENDLONG(lp, x) \
MACRO_BEGIN \
ICL_APPENDINT32((lp), ((x) >> 32) & 0xffffffffL); \
ICL_APPENDINT32((lp), (x) & 0xffffffffL); \
MACRO_END
-#else /* AFS_ALPHA_ENV */
+#else /* AFS_OSF_ENV */
#define ICL_APPENDLONG(lp, x) ICL_APPENDINT32((lp), (x))
-#endif /* AFS_ALPHA_ENV */
+#endif /* AFS_OSF_ENV */
/* routine to tell whether we're dealing with the address or the
* object itself
ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p1)[2]);
ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p1)[3]);
}
-#if defined(AFS_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
+#if defined(AFS_OSF_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
else if (t1 == ICL_TYPE_INT32)
ICL_APPENDINT32(logp, (afs_int32) p1);
-#endif /* AFS_ALPHA_ENV */
+#endif /* AFS_OSF_ENV */
else
ICL_APPENDLONG(logp, p1);
}
ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p2)[2]);
ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p2)[3]);
}
-#if defined(AFS_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
+#if defined(AFS_OSF_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
else if (t2 == ICL_TYPE_INT32)
ICL_APPENDINT32(logp, (afs_int32) p2);
-#endif /* AFS_ALPHA_ENV */
+#endif /* AFS_OSF_ENV */
else
ICL_APPENDLONG(logp, p2);
}
ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p3)[2]);
ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p3)[3]);
}
-#if defined(AFS_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
+#if defined(AFS_OSF_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
else if (t3 == ICL_TYPE_INT32)
ICL_APPENDINT32(logp, (afs_int32) p3);
-#endif /* AFS_ALPHA_ENV */
+#endif /* AFS_OSF_ENV */
else
ICL_APPENDLONG(logp, p3);
}
ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p4)[2]);
ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p4)[3]);
}
-#if defined(AFS_ALPHA_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
+#if defined(AFS_OSF_ENV) || (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
else if (t4 == ICL_TYPE_INT32)
ICL_APPENDINT32(logp, (afs_int32) p4);
-#endif /* AFS_ALPHA_ENV */
+#endif /* AFS_OSF_ENV */
else
ICL_APPENDLONG(logp, p4);
}
afs_osi_Wakeup(&afs_initState);
afs_PutVolume(tvp, READ_LOCK);
}
-#ifdef AFS_DEC_ENV
-/* This is to make sure that we update the root gnode */
-/* every time root volume gets released */
- {
- struct gnode *rootgp;
- struct mount *mp;
- int code;
-
- /* Only do this if afs_globalVFS is properly set due to race conditions
- * this routine could be called before the gfs_mount is performed!
- * Furthermore, afs_root (called below) *waits* until
- * initState >= 200, so we don't try this until we've gotten
- * at least that far */
- if (afs_globalVFS && afs_initState >= 200) {
- if (code = afs_root(afs_globalVFS, &rootgp))
- return code;
- mp = (struct mount *)afs_globalVFS->vfs_data;
- mp->m_rootgp = gget(mp, 0, 0, (char *)rootgp);
- afs_unlock(mp->m_rootgp); /* unlock basic gnode */
- afs_vrele(VTOAFS(rootgp)); /* zap afs_root's vnode hold */
- }
- }
-#endif
if (afs_rootFid.Fid.Volume)
return 0;
else
if (!tvn || !IsAfsVnode(tvn)) {
/* release it and give up */
if (tvn) {
-#ifdef AFS_DEC_ENV
- grele(tvn);
-#else
#ifdef AFS_LINUX22_ENV
dput(dp);
#else
AFS_RELE(tvn);
#endif
-#endif
}
return;
}
-#ifdef AFS_DEC_ENV
- tvc = VTOAFS(afs_gntovn(tvn));
-#else
tvc = VTOAFS(tvn);
-#endif
/* here we know its an afs vnode, so we can get the data for the chunk */
tdc = afs_GetDCache(tvc, ab->size_parm[0], &treq, &offset, &len, 1);
if (tdc) {
afs_PutDCache(tdc);
}
-#ifdef AFS_DEC_ENV
- grele(tvn);
-#else
#ifdef AFS_LINUX22_ENV
dput(dp);
#else
AFS_RELE(tvn);
#endif
-#endif
}
/* size_parm 0 to the fetch is the chunk number,
tb->cred = acred;
crhold(tb->cred);
if (avc) {
-#ifdef AFS_DEC_ENV
- avc->vrefCount++;
-#else
VN_HOLD(AFSTOV(avc));
-#endif
}
tb->refCount = ause + 1;
tb->size_parm[0] = asparm0;
else
panic("background bop");
if (tb->vc) {
-#ifdef AFS_DEC_ENV
- tb->vc->vrefCount--; /* fix up reference count */
-#else
AFS_RELE(AFSTOV(tb->vc)); /* MUST call vnode layer or could lose vnodes */
-#endif
tb->vc = NULL;
}
if (tb->cred) {
ICL_TYPE_POINTER, tvc, ICL_TYPE_INT32, 3,
ICL_TYPE_INT32, tdc->index, ICL_TYPE_OFFSET,
ICL_HANDLE_OFFSET(tchunkoffset));
-#ifndef AFS_DEC_ENV
AFS_STATCNT(afs_gget);
-#endif
afs_HashOutDCache(tdc);
if (tdc->f.chunkBytes != 0) {
discard = 1;
{
int i, us;
-#ifndef AFS_DEC_ENV
AFS_STATCNT(afs_glink);
-#endif
/* we know this guy's in the LRUQ. We'll move dude into DCQ below */
DZap(adc);
/* if this guy is in the hash table, pull him out */
#endif /* AFS_SGI_ENV */
if (AFS_CHUNKTOBASE(chunk) + adjustsize >= avc->m.Length &&
#else /* defined(AFS_AIX32_ENV) || defined(AFS_SGI_ENV) */
-#if defined(AFS_SUN_ENV) || defined(AFS_OSF_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_OSF_ENV)
if ((doAdjustSize || (AFS_CHUNKTOBASE(chunk) >= avc->m.Length)) &&
#else
if (AFS_CHUNKTOBASE(chunk) >= avc->m.Length &&
dput(filevp);
#else
tdc->f.inode = afs_vnodeToInumber(filevp);
-#ifdef AFS_DEC_ENV
- grele(filevp);
-#else
AFS_RELE(filevp);
-#endif
#endif /* AFS_LINUX22_ENV */
} else {
tdc->f.inode = ainode;
/* Exported variables */
struct osi_dev cacheDev; /*Cache device */
afs_int32 cacheInfoModTime; /*Last time cache info modified */
-#if defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_OSF_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
struct mount *afs_cacheVfsp = 0;
#elif defined(AFS_LINUX20_ENV)
struct super_block *afs_cacheSBp = 0;
if (fvpp)
*fvpp = filevp;
else {
-#if defined(AFS_DEC_ENV)
- grele(filevp);
-#else
AFS_RELE(filevp);
-#endif
}
#endif /* AFS_LINUX22_ENV */
void
shutdown_vnodeops(void)
{
-#if !defined(AFS_SGI_ENV) && !defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)
+#if !defined(AFS_SGI_ENV) && !defined(AFS_SUN5_ENV)
struct buf *afs_bread_freebp = 0;
#endif
#ifndef AFS_LINUX20_ENV
afs_rd_stash_i = 0;
#endif
-#if !defined(AFS_SGI_ENV) && !defined(AFS_SUN_ENV) && !defined(AFS_SUN5_ENV)
+#if !defined(AFS_SGI_ENV) && !defined(AFS_SUN5_ENV)
afs_bread_freebp = 0;
#endif
shutdown_mariner();
#ifndef AFS_LINUX22_ENV
#include "rpc/types.h"
#endif
-#ifdef AFS_ALPHA_ENV
+#ifdef AFS_OSF_ENV
#undef kmem_alloc
#undef kmem_free
#undef mem_alloc
#undef mem_free
#undef register
-#endif /* AFS_ALPHA_ENV */
+#endif /* AFS_OSF_ENV */
#include "afsincludes.h" /* Afs-based standard headers */
#include "afs/afs_stats.h" /* statistics */
("$Header$");
#if !defined(AFS_NONFSTRANS) || defined(AFS_AIX_IAUTH_ENV)
-#ifndef AFS_DEC_ENV
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
#include "afs/afs_stats.h" /* statistics */
shutdown_nfsclnt()
{
-#if 0
- extern int afs_allnfsreqs, afs_nfscalls;
-#endif
-
#if defined(AFS_SGIMP_ENV)
osi_Assert(ISAFS_GLOCK());
#endif
#endif
afs_nfsclient_GC(afs_nfsexporter, -1);
init_nfsexporter = 0;
-#if 0
- /* The following are for the nfs/afs server */
- afs_allnfsreqs = afs_nfscalls = 0;
-#endif
}
-#endif /* AFS_DEC_ENV */
#endif /* AFS_NONFSTRANS */
osi_Active(register struct vcache *avc)
{
AFS_STATCNT(osi_Active);
-#if defined(AFS_SUN_ENV) || defined(AFS_AIX_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) || (AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_AIX_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) || (AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
if ((avc->opens > 0) || (avc->states & CMAPPED))
return 1; /* XXX: Warning, verify this XXX */
-#elif defined(AFS_MACH_ENV)
- if (avc->opens > 0
- || ((avc->v.v_flag & VTEXT) && !inode_uncache_try(avc)))
- return 1;
#elif defined(AFS_SGI_ENV)
if ((avc->opens > 0) || AFS_VN_MAPPED(AFSTOV(avc)))
return 1;
if (hcmp(vp->m.DataVersion, vp->flushDV) <= 0)
return;
-#ifdef AFS_DEC_ENV
- {
- void afs_gfs_FlushText();
- afs_gfs_FlushText(vp);
- return;
- }
-#else
-
MObtainWriteLock(&afs_ftf, 317);
hset(fdv, vp->m.DataVersion);
hset(vp->flushDV, fdv);
MReleaseWriteLock(&afs_ftf);
-#endif /* AFS_DEC_ENV */
}
-
-#ifdef AFS_DEC_ENV
-/* I don't really like using xinval() here, because it kills processes
- * a bit aggressively. Previous incarnations of this functionality
- * used to use xrele() instead of xinval, and didn't invoke
- * cacheinval(). But they would panic. So it might be worth looking
- * into some middle ground...
- */
-static void
-afs_gfs_FlushText(register struct vcache *vp)
-{
- afs_hyper_t fdv; /* version before which we'll flush */
- register struct text *xp;
- struct gnode *gp;
-
- MObtainWriteLock(&afs_ftf, 318);
- hset(fdv, vp->m.DataVersion);
- gp = afs_vntogn(vp);
-
- if (!gp) {
- /* this happens frequently after cores are created. */
- MReleaseWriteLock(&afs_ftf);
- return;
- }
-
- if (gp->g_flag & GTEXT) {
- if (gp->g_textp) {
- xp = (struct text *)gp->g_textp;
- /* if text object is locked, give up */
- if (xp && (xp->x_flag & XLOCK)) {
- MReleaseWriteLock(&afs_ftf);
- return;
- }
- } else
- xp = NULL;
-
- if (gp->g_flag & GTEXT) { /* still has a text object? */
- xinval(gp);
- }
- }
-
- /* next do the stuff that need not check for deadlock problems */
- /* maybe xinval(gp); here instead of above */
- binval(NODEV, gp);
- cacheinval(gp);
- /* finally, record that we've done it */
- hset(vp->flushDV, fdv);
-
- MReleaseWriteLock(&afs_ftf);
-}
-#endif /* AFS_DEC_ENV */
-
#endif /* AFS_TEXT_ENV */
/* mask signals in afsds */
{
#ifdef AFS_LINUX22_ENV
afs_osi_MaskSignals();
-#elif defined(AFS_DEC_ENV)
- u.u_procp->p_type |= SSYS;
#elif defined(AFS_SUN5_ENV)
curproc->p_flag |= SSYS;
#elif defined(AFS_HPUX101_ENV) && !defined(AFS_HPUX1123_ENV)
#else
size = x;
tm = (struct osimem *)AFS_KALLOC(size);
-#ifdef AFS_SUN_ENV
+#ifdef AFS_SUN5_ENV
if (!tm)
osi_Panic("osi_Alloc: Couldn't allocate %d bytes; out of memory!\n",
size);
#endif
}
-#if defined(AFS_SUN_ENV) || defined(AFS_SGI_ENV)
+#if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV)
void *
afs_osi_Alloc_NoSleep(size_t x)
#endif
#endif /* AFS_AIX32_ENV */
-#if defined (AFS_SUN_ENV)
+#if defined (AFS_SUN5_ENV)
if (avc->states & CMAPPED) {
struct page *pg;
for (pg = avc->v.v_s.v_Pages; pg; pg = pg->p_vpnext) {
#endif
#endif /* AFS_LINUX22_ENV */
if (tvc && IsAfsVnode(AFSTOV(tvc))) {
-#ifdef AFS_DEC_ENV
- tvc = VTOAFS(afs_gntovn((struct gnode *)tvc));
- if (!tvc) { /* shouldn't happen with held gnodes */
- u.u_error = ENOENT;
- return;
- }
-#endif
/* This is an AFS vnode */
if (((uap->com >> 8) & 0xff) == 'V') {
register struct afs_ioctl *datap;
struct AFS_UCRED *foreigncreds = NULL;
register afs_int32 code = 0;
struct vnode *vp = NULL;
-#ifdef AFS_DEC_ENV
- struct vnode *gp;
-#endif
#ifdef AFS_AIX41_ENV
struct ucred *credp = crref(); /* don't free until done! */
#endif
/* now make the call if we were passed no file, or were passed an AFS file */
if (!vp || IsAfsVnode(vp)) {
-#if defined(AFS_DEC_ENV)
- /* Ultrix 4.0: can't get vcache entry unless we've got an AFS gnode.
- * So, we must test in this part of the code. Also, must arrange to
- * GRELE the original gnode pointer when we're done, since in Ultrix 4.0,
- * we hold gnodes, whose references hold our vcache entries.
- */
- if (vp) {
- gp = vp; /* remember for "put" */
- vp = (struct vnode *)afs_gntovn(vp); /* get vcache from gp */
- } else
- gp = NULL;
-#elif defined(AFS_SUN5_ENV)
+#if defined(AFS_SUN5_ENV)
code = afs_HandlePioctl(vp, com, &data, follow, &credp);
#elif defined(AFS_AIX41_ENV)
{
#else
code = EINVAL; /* not in /afs */
#endif
-#ifdef AFS_DEC_ENV
- if (vp) {
- GRELE(vp);
- vp = NULL;
- }
-#endif
}
rescred:
AFS_STATCNT(PFlush);
if (!avc)
return EINVAL;
-#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV)
+#ifdef AFS_BOZONLOCK_ENV
afs_BozonLock(&avc->pvnLock, avc); /* Since afs_TryToSmush will do a pvn_vptrunc */
#endif
ObtainWriteLock(&avc->lock, 225);
avc->linkData = NULL;
}
ReleaseWriteLock(&avc->lock);
-#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV)
+#ifdef AFS_BOZONLOCK_ENV
afs_BozonUnlock(&avc->pvnLock, avc);
#endif
return 0;
for (i = 0; i < VCSIZE; i++) {
for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) {
if (tvc->fid.Fid.Volume == volume && tvc->fid.Cell == cell) {
-#if defined(AFS_SGI_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV)
+#if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_LINUX20_ENV)
VN_HOLD(AFSTOV(tvc));
#else
#if defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
osi_vnhold(tvc, 0);
#else
- VREFCOUNT_INC(tvc);
+ VREFCOUNT_INC(tvc); /* AIX, apparently */
#endif
#endif
ReleaseReadLock(&afs_xvcache);
-#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV)
+#ifdef AFS_BOZONLOCK_ENV
afs_BozonLock(&tvc->pvnLock, tvc); /* Since afs_TryToSmush will do a pvn_vptrunc */
#endif
ObtainWriteLock(&tvc->lock, 232);
osi_dnlc_purgedp(tvc);
afs_TryToSmush(tvc, *acred, 1);
ReleaseWriteLock(&tvc->lock);
-#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV)
+#ifdef AFS_BOZONLOCK_ENV
afs_BozonUnlock(&tvc->pvnLock, tvc);
#endif
ObtainReadLock(&afs_xvcache);
newcred->cr_groups[i] = NOGROUP;
#endif
#endif
-#if !defined(AFS_OSF_ENV) && !defined(AFS_DEC_ENV)
+#if !defined(AFS_OSF_ENV)
afs_nfsclient_init(); /* before looking for exporter, ensure one exists */
#endif
if (!(exporter = exporter_find(exporter_type))) {
code = EINVAL;
goto out;
}
-#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV)
+#ifdef AFS_BOZONLOCK_ENV
afs_BozonLock(&tvc->pvnLock, tvc); /* Since afs_TryToSmush will do a pvn_vptrunc */
#endif
ObtainWriteLock(&tvc->lock, 649);
tvc->linkData = NULL;
}
ReleaseWriteLock(&tvc->lock);
-#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV)
+#ifdef AFS_BOZONLOCK_ENV
afs_BozonUnlock(&tvc->pvnLock, tvc);
#endif
afs_PutVCache(tvc);
#ifdef AFS_AIX_ENV
struct gnode *gnodepnt;
#endif
-#ifdef AFS_MACH_ENV
- struct vm_info *vm_info_ptr;
-#endif /* AFS_MACH_ENV */
#ifdef AFS_OSF_ENV
struct vcache *nvc;
#endif /* AFS_OSF_ENV */
#ifdef KERNEL_HAVE_PIN
pin((char *)tvc, sizeof(struct vcache)); /* XXX */
#endif
-#ifdef AFS_MACH_ENV
- /* In case it still comes here we need to fill this */
- tvc->v.v_vm_info = VM_INFO_NULL;
- vm_info_init(tvc->v.v_vm_info);
- /* perhaps we should also do close_flush on non-NeXT mach systems;
- * who knows; we don't currently have the sources.
- */
-#endif /* AFS_MACH_ENV */
#if defined(AFS_SGI_ENV)
{
char name[METER_NAMSZ];
}
#endif /* AFS_OSF_ENV */
-#ifdef AFS_MACH_ENV
- vm_info_ptr = tvc->v.v_vm_info;
-#endif /* AFS_MACH_ENV */
-
#if defined(AFS_XBSD_ENV)
if (tvc->v)
panic("afs_NewVCache(): free vcache with vnode attached");
RWLOCK_INIT(&tvc->vlock, "vcache vlock");
#endif /* defined(AFS_SUN5_ENV) */
-#ifdef AFS_MACH_ENV
- tvc->v.v_vm_info = vm_info_ptr;
- tvc->v.v_vm_info->pager = MEMORY_OBJECT_NULL;
-#endif /* AFS_MACH_ENV */
#ifdef AFS_OBSD_ENV
AFS_GUNLOCK();
afs_nbsd_getnewvnode(tvc); /* includes one refcount */
tvc->vmh = tvc->segid = NULL;
tvc->credp = NULL;
#endif
-#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV) || defined(AFS_SUN5_ENV)
+#ifdef AFS_BOZONLOCK_ENV
#if defined(AFS_SUN5_ENV)
rw_init(&tvc->rwlock, "vcache rwlock", RW_DEFAULT, NULL);
tvc->v.v_next = gnodepnt->gn_vnode; /*Single vnode per gnode for us! */
gnodepnt->gn_vnode = &tvc->v;
#endif
-#ifdef AFS_DEC_ENV
- tvc->v.g_dev = ((struct mount *)afs_globalVFS->vfs_data)->m_dev;
-#endif
#if defined(AFS_DUX40_ENV)
insmntque(tvc, afs_globalVFS, &afs_ubcops);
#else
*/
osi_vnhold(tvc, 0);
ReleaseReadLock(&afs_xvcache);
-#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV)
+#ifdef AFS_BOZONLOCK_ENV
afs_BozonLock(&tvc->pvnLock, tvc);
#endif
#if defined(AFS_SGI_ENV)
tvc->execsOrWriters);
code = afs_StoreOnLastReference(tvc, &ureq);
ReleaseWriteLock(&tvc->lock);
-#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV)
+#ifdef AFS_BOZONLOCK_ENV
afs_BozonUnlock(&tvc->pvnLock, tvc);
#endif
hzero(tvc->flushDV);
* Ignore errors
*/
ReleaseWriteLock(&tvc->lock);
-#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV)
+#ifdef AFS_BOZONLOCK_ENV
afs_BozonUnlock(&tvc->pvnLock, tvc);
#endif
#if defined(AFS_SGI_ENV)
} else {
/* lost (or won, perhaps) the race condition */
ReleaseWriteLock(&tvc->lock);
-#if defined(AFS_SUN_ENV) || defined(AFS_ALPHA_ENV)
+#ifdef AFS_BOZONLOCK_ENV
afs_BozonUnlock(&tvc->pvnLock, tvc);
#endif
}
ObtainReadLock(&afs_xvcache);
AFS_FAST_RELE(tvc);
if (didCore) {
-#ifdef AFS_GFS_ENV
- VREFCOUNT_DEC(tvc);
-#else
AFS_RELE(AFSTOV(tvc));
-#endif
/* Matches write code setting CCore flag */
crfree(cred);
}
#include "afs/stds.h"
#ifdef AFS_AIX_ENV
#include "osi_vfs.h"
-#else
-#ifdef AFS_DEC_ENV
-#include "afs/gfs_vfs.h"
-#include "afs/gfs_vnode.h"
-#else
-#ifdef AFS_HPUX_ENV
+#elif defined(AFS_HPUX_ENV)
#include "osi_vfs.h"
-#endif /* AFS_HPUX_ENV */
-#endif /* AFS_DEC_ENV */
-#endif /* AFS_AIX_ENV */
+#endif
#if defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV)
#include "osi_vfs.h"
#endif
#ifndef _longc_procs_h_
#define _longc_procs_h_ 1
-#if !defined(LONGCALL_DEFS) && defined(KERNEL) && defined(DYNEL) && (defined(AFS_DEC_ENV) || defined(AFS_DECOSF_ENV))
+#if !defined(LONGCALL_DEFS) && defined(KERNEL) && defined(DYNEL) && defined(AFS_DECOSF_ENV)
#define LONGCALL_DEFS
#ifdef XDR_CHAR_IN_KERNEL
int (*LC_xdr_char) ();
#endif
-#ifdef AFS_DEC_ENV
-
- int (*LC_gfs_unlock) ();
- int (*LC_gfs_lock) ();
- int (*LC_gput) ();
- struct inode *(*LC_ufs_galloc) ();
- int (*LC_gno_close) ();
- int (*LC_km_alloc) ();
- int (*LC_km_free) ();
-
- int (*LC_nuxi_l) ();
- int (*LC_nuxi_s) ();
-
- struct inode *(*LC_gfs_gget) ();
- int (*LC_binval) ();
- int (*LC_splclock) ();
- int (*LC_xumount) ();
- int (*LC_bflush) ();
- int (*LC_blkclr) ();
- int (*LC_vmaccess) ();
- struct gnode *(*LC_gfs_namei) ();
- int (*LC_getpdev) ();
- int (*LC_check_mountp) ();
- int (*LC_access) ();
- int (*LC_ovbcopy) ();
- int (*LC_groupmember) ();
- int (*LC_imin) ();
- int (*LC_setjmp) ();
-
- struct gnode *(*LC_gget) ();
- void (*LC_grele) ();
- void (*LC_gref) ();
- int (*LC_xdr_char) ();
- int (*LC_smp_lock_once) ();
- int (*LC_smp_lock_long) ();
- int (*LC_smp_lock_retry) ();
- int (*LC_smp_unlock_long) ();
- int (*LC_smp_owner) ();
- int (*LC_xinval) ();
- int (*LC_cacheinvalall) ();
- int (*LC_psignal) ();
- int (*LC_ufs_rwgp_lock) ();
-#else
int (*LC_iunlock) ();
int (*LC_ilock) ();
int (*LC_iput) ();
struct inode *(*LC_iget) ();
struct mbuf *(*LC_m_more) ();
int (*LC__spl1) ();
-#endif
int (*LC_rdwri) ();
struct file *(*LC_falloc) ();
int (*LC_rmfree) ();
#define xdr_char (*afs_longcall_procs.LC_xdr_char)
#endif
-#ifdef AFS_DEC_ENV
-#define psignal (*afs_longcall_procs.LC_psignal)
-#define ufs_rwgp_lock (*afs_longcall_procs.LC_ufs_rwgp_lock)
-#define gput (*afs_longcall_procs.LC_gput)
-#define ufs_galloc (*afs_longcall_procs.LC_ufs_galloc)
-#define gno_close (*afs_longcall_procs.LC_gno_close)
-
-#define km_alloc (*afs_longcall_procs.LC_km_alloc)
-#define km_free (*afs_longcall_procs.LC_km_free)
-
-#define nuxi_l (*afs_longcall_procs.LC_nuxi_l)
-#define nuxi_s (*afs_longcall_procs.LC_nuxi_s)
-
-#define gfs_gget (*afs_longcall_procs.LC_gfs_gget)
-#define binval (*afs_longcall_procs.LC_binval)
-#define splclock (*afs_longcall_procs.LC_splclock)
-#define xumount (*afs_longcall_procs.LC_xumount)
-#define bflush (*afs_longcall_procs.LC_bflush)
-#define blkclr (*afs_longcall_procs.LC_blkclr)
-#define vmaccess (*afs_longcall_procs.LC_vmaccess)
-#define gfs_namei (*afs_longcall_procs.LC_gfs_namei)
-#define getpdev (*afs_longcall_procs.LC_getpdev)
-#define check_mountp (*afs_longcall_procs.LC_check_mountp)
-#define access (*afs_longcall_procs.LC_access)
-#define ovbcopy (*afs_longcall_procs.LC_ovbcopy)
-#define groupmember (*afs_longcall_procs.LC_groupmember)
-#define imin (*afs_longcall_procs.LC_imin)
-#define setjmp (*afs_longcall_procs.LC_setjmp)
-#define gget (*afs_longcall_procs.LC_gget)
-#define grele (*afs_longcall_procs.LC_grele)
-#define gref (*afs_longcall_procs.LC_gref)
-#define xdr_char (*afs_longcall_procs.LC_xdr_char)
-#define smp_lock_once (*afs_longcall_procs.LC_smp_lock_once)
-#define smp_lock_long (*afs_longcall_procs.LC_smp_lock_long)
-#define smp_lock_retry (*afs_longcall_procs.LC_smp_lock_retry)
-#define smp_unlock_long (*afs_longcall_procs.LC_smp_unlock_long)
-#define smp_owner (*afs_longcall_procs.LC_smp_owner)
-#define xinval (*afs_longcall_procs.LC_xinval)
-#define cacheinvalall (*afs_longcall_procs.LC_cacheinvalall)
-#else
#define iunlock (*afs_longcall_procs.LC_iunlock)
#define ilock (*afs_longcall_procs.LC_ilock)
#define iput (*afs_longcall_procs.LC_iput)
#define iget (*afs_longcall_procs.LC_iget)
#define m_more (*afs_longcall_procs.LC_m_more)
#define _spl1 (*afs_longcall_procs.LC__spl1)
-#endif
#define bcmp (*afs_longcall_procs.LC_bcmp)
#if !defined(AFS_DECOSF_ENV)
#include "h/socketvar.h"
#include "h/protosw.h"
-#if defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_SGI_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_FBSD_ENV)
# include "h/dirent.h"
# ifdef AFS_SUN5_ENV
# include "h/sysmacros.h"
# include "h/dir.h"
#endif /* SGI || SUN || HPUX */
-#ifdef AFS_DEC_ENV
-# include "h/smp_lock.h"
-#endif /* AFS_DEC_ENV */
-
-
#if !defined(AFS_SGI64_ENV) && !defined(AFS_FBSD_ENV)
#include "h/user.h"
#endif /* AFS_SGI64_ENV */
/* ----- The following mainly deal with vnodes/inodes stuff ------ */
-#ifdef AFS_DEC_ENV
-# include "h/mount.h"
-# include "machine/psl.h"
-# include "afs/gfs_vnode.h"
-#endif
-
-#ifdef AFS_MACH_ENV
-# include <vfs/vfs.h>
-# include <vfs/vnode.h>
-# include <sys/inode.h>
-# include <sys/mount.h>
-# include <vm/vm_pager.h>
-# include <kern/mfs.h>
-# include <mach/vm_param.h>
-# include <kern/parallel.h>
-#endif /* AFS_MACH_ENV */
-
-#ifndef AFS_DEC_ENV
# ifdef AFS_SUN5_ENV
# include "h/statvfs.h"
# endif /* AFS_SUN5_ENV */
# endif /* !AFS_AIX32_ENV */
# endif /* AFS_SUN5_ENV */
#endif /* AFS_DARWIN_ENV || AFS_FBSD_ENV */
-#endif /* AFS_DEC_ENV */
/* These mainly deal with networking and rpc headers */
#include "netinet/in.h"
#include "h/tty.h"
#endif
-#if !defined(AFS_SGI_ENV) && !defined(AFS_SUN_ENV) && !defined(AFS_MACH_ENV) && !defined(AFS_AIX32_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
+#if !defined(AFS_SGI_ENV) && !defined(AFS_AIX32_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
# include "h/text.h"
#endif
-#if defined(AFS_AIX_ENV) || defined(AFS_DEC_ENV)
+#if defined(AFS_AIX_ENV)
# include "h/flock.h" /* fcntl.h is a user-level include in aix */
#else
# include "h/fcntl.h"
-#endif /* AIX || DEC */
+#endif /* AIX */
-#if defined(AFS_SGI_ENV) || defined(AFS_SUN_ENV) || defined(AFS_SUN5_ENV)
+#if defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)
# include "h/unistd.h"
#endif /* SGI || SUN */
#include <sys/mbuf.h>
#include <rpc/types.h>
-#ifdef AFS_ALPHA_ENV
+#ifdef AFS_OSF_ENV
#undef kmem_alloc
#undef kmem_free
#undef mem_alloc
#undef mem_free
#undef register
-#endif /* AFS_ALPHA_ENV */
+#endif /* AFS_OSF_ENV */
#include <rx/xdr.h>
#include <sys/proc.h>
if (afsd_verbose)
printf("%s: Mounting the AFS root on '%s', flags: %d.\n", rn,
cacheMountDir, mountFlags);
-#ifdef AFS_DEC_ENV
- if ((mount("AFS", cacheMountDir, mountFlags, GT_AFS, (caddr_t) 0)) <
- 0) {
-#else
#ifdef AFS_FBSD_ENV
if ((mount("AFS", cacheMountDir, mountFlags, (caddr_t) 0)) < 0) {
-#else
-#ifdef AFS_AUX_ENV
- if ((fsmount(MOUNT_AFS, cacheMountDir, mountFlags, (caddr_t) 0)) < 0) {
-#else
-#ifdef AFS_AIX_ENV
+#elif defined(AFS_AIX_ENV)
if (aix_vmount()) {
-#else
-#if defined(AFS_HPUX100_ENV)
+#elif defined(AFS_HPUX100_ENV)
if ((mount("", cacheMountDir, mountFlags, "afs", NULL, 0)) < 0) {
-#else
-#ifdef AFS_HPUX_ENV
-#if defined(AFS_HPUX90_ENV)
- {
- char buffer[80];
- int code;
-
- strcpy(buffer, "afs");
- code = vfsmount(-1, cacheMountDir, mountFlags, (caddr_t) buffer);
- sscanf(buffer, "%d", &vfs1_type);
- if (code < 0) {
- printf
- ("Can't find 'afs' type in the registered filesystem table!\n");
- exit(1);
- }
- sscanf(buffer, "%d", &vfs1_type);
- if (afsd_verbose)
- printf("AFS vfs slot number is %d\n", vfs1_type);
- }
- if ((vfsmount(vfs1_type, cacheMountDir, mountFlags, (caddr_t) 0)) < 0) {
-#else
- if (call_syscall
- (AFSOP_AFS_VFSMOUNT, MOUNT_AFS, cacheMountDir, mountFlags,
- (caddr_t) NULL) < 0) {
-#endif
-#else
-#ifdef AFS_SUN5_ENV
+#elif defined(AFS_SUN5_ENV)
if ((mount("AFS", cacheMountDir, mountFlags, "afs", NULL, 0)) < 0) {
-#else
-#if defined(AFS_SGI_ENV)
+#elif defined(AFS_SGI_ENV)
mountFlags = MS_FSS;
if ((mount(MOUNT_AFS, cacheMountDir, mountFlags, (caddr_t) MOUNT_AFS))
< 0) {
-#else
-#ifdef AFS_LINUX20_ENV
+#elif defined(AFS_LINUX20_ENV)
if ((mount("AFS", cacheMountDir, MOUNT_AFS, 0, NULL)) < 0) {
#else
/* This is the standard mount used by the suns and rts */
if ((mount(MOUNT_AFS, cacheMountDir, mountFlags, (caddr_t) 0)) < 0) {
-#endif /* AFS_LINUX20_ENV */
-#endif /* AFS_SGI_ENV */
-#endif /* AFS_SUN5_ENV */
-#endif /* AFS_HPUX100_ENV */
-#endif /* AFS_HPUX_ENV */
-#endif /* AFS_AIX_ENV */
-#endif /* AFS_AUX_ENV */
-#endif /* AFS_FBSD_ENV */
-#endif /* AFS_DEC_ENV */
+#endif
printf("%s: Can't mount AFS on %s(%d)\n", rn, cacheMountDir,
errno);
exit(1);
#undef IN
#include <sys/types.h>
#include <netinet/in.h>
-#ifndef AFS_DEC_ENV
#include <sys/socket.h>
#include <netdb.h>
-#endif
#include <ctype.h>
#include <gtxwindows.h> /*Generic window package */
#include <gtxobjects.h> /*Object definitions */
-#if 0
-#include <gtxtextobj.h> /*Text object interface */
-#endif
#include <gtxlightobj.h> /*Light object interface */
#include <gtxcurseswin.h> /*Curses window package */
#include <gtxdumbwin.h> /*Dumb terminal window package */
struct servent *ts;
register struct afsconf_servPair *tsp;
-#if defined(AFS_OSF_ENV) || defined(AFS_DEC_ENV)
+#if defined(AFS_OSF_ENV)
ts = getservbyname(aname, "");
#else
ts = getservbyname(aname, NULL);
char *loadFile;
extern afs_int32 lastTaskCode;
-#ifdef AFS_DEC_ENV
-#define HOSTADDR(sockaddr) (sockaddr)->sin_addr.S_un.S_addr
-#else
#define HOSTADDR(sockaddr) (sockaddr)->sin_addr.s_addr
-#endif
int
bc_EvalVolumeSet(aconfig, avs, avols, uclient)
extern afs_int32 lastTaskCode;
-#ifdef AFS_DEC_ENV
-#define HOSTADDR(sockaddr) (sockaddr)->sin_addr.S_un.S_addr
-#else
#define HOSTADDR(sockaddr) (sockaddr)->sin_addr.s_addr
-#endif
/* bc_Dumper
* called (indirectly) to make a dump
#define BC_MAXLEVELS 20
#define MAXTAPESATONCE 10
-#ifdef AFS_DEC_ENV
-#define HOSTADDR(sockaddr) (sockaddr)->sin_addr.S_un.S_addr
-#else
#define HOSTADDR(sockaddr) (sockaddr)->sin_addr.s_addr
-#endif
/* local structure to keep track of volumes and the dumps from which
* they should be restored
}
-#if (defined(AFS_DEC_ENV) || defined(AFS_HPUX_ENV)) || defined(AFS_NT40_ENV)
+#if (defined(AFS_HPUX_ENV)) || defined(AFS_NT40_ENV)
/* mkstemp
* entry:
#endif
}
-#ifdef AFS_DEC_ENV
-#define HOSTADDR(sockaddr) (sockaddr)->sin_addr.S_un.S_addr
-#else
#define HOSTADDR(sockaddr) (sockaddr)->sin_addr.s_addr
-#endif
/* dumpPass
* Go through the list of volumes to dump, dumping each one. The action
if (info->posCount >= 2147467264) { /* 2GB - 16K */
info->posCount = 0;
-#if (defined(AFS_SUN_ENV) || defined(AFS_DEC_ENV) || defined(AFS_LINUX24_ENV))
+#if (defined(AFS_SUN_ENV) || defined(AFS_LINUX24_ENV))
if (!isafile) {
afs_hyper_t off;
hset64(off, 0, 0);
#define AFS_ALPHA_ENV 1
#define AFS_DECOSF_ENV 1
#define AFS_64BIT_ENV 1
+#define AFS_BOZONLOCK_ENV 1
#include <afs/afs_sysnames.h>
#define __alpha 1
#define AFS_ALPHA_ENV 1
#define AFS_DECOSF_ENV 1
+#define AFS_BOZONLOCK_ENV 1
#define AFS_64BIT_ENV 1
#define AFS_64BIT_CLIENT 1
#define __alpha 1
#define AFS_ALPHA_ENV 1
#define AFS_DECOSF_ENV 1
+#define AFS_BOZONLOCK_ENV 1
#define AFS_64BIT_ENV 1
#define AFS_64BIT_CLIENT 1
#define AFS_SUN58_ENV 1
#define AFS_SUN59_ENV 1
#define AFS_SUN510_ENV 1
+#define AFS_BOZONLOCK_ENV 1
#define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */
/*
#define AFS_SUN54_ENV 1
#define AFS_SUN55_ENV 1
+#define AFS_BOZONLOCK_ENV 1
#define AFS_HAVE_FLOCK_SYSID 1
#include <afs/afs_sysnames.h>
#define AFS_SUN54_ENV 1
#define AFS_SUN55_ENV 1
#define AFS_SUN56_ENV 1
+#define AFS_BOZONLOCK_ENV 1
#define AFS_GLOBAL_SUNLOCK 1 /* For global locking */
#define RXK_LISTENER_ENV 1
#define AFS_GCPAGS 1 /* if nonzero, garbage collect PAGs */
#define AFS_SUN55_ENV 1
#define AFS_SUN56_ENV 1
#define AFS_SUN57_ENV 1
+#define AFS_BOZONLOCK_ENV 1
#define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */
#define AFS_SUN56_ENV 1
#define AFS_SUN57_ENV 1
#define AFS_SUN58_ENV 1
+#define AFS_BOZONLOCK_ENV 1
#define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */
/*
#define AFS_SUN57_ENV 1
#define AFS_SUN58_ENV 1
#define AFS_SUN59_ENV 1
+#define AFS_BOZONLOCK_ENV 1
#define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */
/*
#define AFS_SUN58_ENV 1
#define AFS_SUN59_ENV 1
#define AFS_SUN510_ENV 1
+#define AFS_BOZONLOCK_ENV 1
#define AFS_X86_ENV 1
#define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */
#define AFS_SUN55_ENV 1
#define AFS_SUN56_ENV 1
#define AFS_SUN57_ENV 1
+#define AFS_BOZONLOCK_ENV 1
+
#define AFS_X86_ENV 1
#define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */
#define AFS_SUN56_ENV 1
#define AFS_SUN57_ENV 1
#define AFS_SUN58_ENV 1
+#define AFS_BOZONLOCK_ENV 1
+
#define AFS_X86_ENV 1
#define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */
#define AFS_SUN57_ENV 1
#define AFS_SUN58_ENV 1
#define AFS_SUN59_ENV 1
+#define AFS_BOZONLOCK_ENV 1
+
#define AFS_X86_ENV 1
#define AFS_64BIT_ENV 1 /* Defines afs_int32 as int, not long. */
#include "h/user.h"
#endif /* AFS_SGI64_ENV */
#include "h/uio.h"
-#ifdef AFS_DEC_ENV
-#include "afs/gfs_vfs.h"
-#include "afs/gfs_vnode.h"
-#else
-#ifdef AFS_MACH_ENV
-#ifdef NeXT
-#include <sys/vfs.h>
-#include <sys/vnode.h>
-#include <ufs/inode.h>
-#else
-#include <vfs/vfs.h>
-#include <vfs/vnode.h>
-#include <sys/inode.h>
-#endif /* NeXT */
-#else /* AFS_MACH_ENV */
#ifdef AFS_OSF_ENV
#include <sys/mount.h>
#include <sys/vnode.h>
#include <ufs/inode.h>
-#else /* AFS_OSF_ENV */
-#ifdef AFS_SUN5_ENV
-#else
-#if !defined(AFS_SGI_ENV)
-#endif
-#endif /* AFS_OSF_ENV */
-#endif /* AFS_MACH_ENV */
-#endif
#endif
#if !defined(AFS_SUN5_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_HPUX110_ENV)
#include "h/mbuf.h"
#include "afsincludes.h"
#include "rx/xdr.h"
#else /* defined(UKERNEL) */
-#if defined(AFS_ALPHA_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
+#if defined(AFS_OSF_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
#include "afs/sysincludes.h"
#include "afsincludes.h"
#else
#ifdef AFS_AIXNFS11
#define AUTH_DES 1
#endif
-#if (defined(AFS_AIX_ENV) && !defined(AUTH_DES)) || (!defined(AFS_SUN_ENV)) && !defined(AFS_SGI_ENV) && !defined(AFS_ALPHA_ENV) && !defined(AFS_SUN5_ENV)
+#if (defined(AFS_AIX_ENV) && !defined(AUTH_DES)) || (!defined(AFS_SUN_ENV)) && !defined(AFS_SGI_ENV) && !defined(AFS_OSF_ENV) && !defined(AFS_SUN5_ENV)
#ifndef AFS_AIX32_ENV
#if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN_ENV) && !defined(AFS_XBSD_ENV)
/*
#include "sys/debug.h"
#endif
#include "afsint.h"
-#ifdef AFS_ALPHA_ENV
+#ifdef AFS_OSF_ENV
#undef kmem_alloc
#undef kmem_free
#undef mem_alloc
#undef mem_free
#undef register
-#endif /* AFS_ALPHA_ENV */
+#endif /* AFS_OSF_ENV */
#else /* !UKERNEL */
#include "afs/sysincludes.h"
#include "afsincludes.h"
#ifndef KERNEL
-#if defined(AFS_GFS_ENV)
-#define STARTVALUE 8000000 /* Ultrix bounds smaller, too small for general use */
-#else
#define STARTVALUE 100000000 /* Max number of seconds setitimer allows, for some reason */
-#endif
static int startvalue = STARTVALUE;
struct clock clock_now; /* The last elapsed time ready by clock_GetTimer */
#include "rx/rx_globals.h"
#include "afs/lock.h"
#include "afsint.h"
-#ifdef AFS_ALPHA_ENV
+#ifdef AFS_OSF_ENV
#undef kmem_alloc
#undef kmem_free
#undef mem_alloc
#undef mem_free
#undef register
-#endif /* AFS_ALPHA_ENV */
+#endif /* AFS_OSF_ENV */
#else /* KERNEL */
# include <sys/types.h>
#ifndef AFS_NT40_ENV
#include <stdio.h>
#endif
#include "xdr.h"
-#if defined(KERNEL) && !defined(UKERNEL)
-#ifdef AFS_DEC_ENV
-#include <afs/longc_procs.h>
-#endif
-#endif
int
xdr_afsUUID(XDR * xdrs, afsUUID * objp)
#include <stdio.h>
#endif
#include "xdr.h"
-#if defined(KERNEL) && !defined(UKERNEL)
-#ifdef AFS_DEC_ENV
-#include <afs/longc_procs.h>
-#endif
-#endif
#define LASTUNSIGNED ((u_int)0-1)
#include <stdio.h>
#endif
#include "xdr.h"
-#if defined(KERNEL) && !defined(UKERNEL)
-#ifdef AFS_DEC_ENV
-#include <afs/longc_procs.h>
-#endif
-#endif
#ifdef AFS_64BIT_ENV
/*
#else
#include "rpc/types.h"
#endif
-#ifdef AFS_ALPHA_ENV
+#ifdef AFS_OSF_ENV
#undef kmem_alloc
#undef kmem_free
#undef mem_alloc
#undef mem_free
#undef register
-#endif /* AFS_ALPHA_ENV */
+#endif /* AFS_OSF_ENV */
#ifdef AFS_LINUX22_ENV
#ifndef quad_t
#define quad_t __quad_t
f_print(fout, "#include \"h/socket.h\"\n");
f_print(fout, "#endif\n");
f_print(fout, "#ifndef DTYPE_SOCKET /* XXXXX */\n");
- f_print(fout, "#ifdef AFS_DEC_ENV\n");
- f_print(fout, "#include \"h/smp_lock.h\"\n");
- f_print(fout, "#endif\n");
f_print(fout, "#ifndef AFS_LINUX22_ENV\n");
f_print(fout, "#include \"h/file.h\"\n");
f_print(fout, "#endif\n");
#include <afs/icl.h>
#include <afs/afsutil.h>
-#if defined(AFS_ALPHA_ENV) || defined(AFS_SGI61_ENV) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
+#if defined(AFS_OSF_ENV) || defined(AFS_SGI61_ENV) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
/* For SGI 6.2, this is changed to 1 if it's a 32 bit kernel. */
int afs_icl_sizeofLong = 2;
#else
printfParms[pfpix] <<= 32;
printfParms[pfpix] |= alp[pix + 1];
}
-#else /* AFS_SGI61_ENV */
-#ifdef AFS_ALPHA_ENV
+#elif defined(AFS_OSF_ENV)
printfParms[pfpix] = alp[pix + 1];
printfParms[pfpix] |= (alp[pix] <<= 32);
-#else /* AFS_ALPHA_ENV */
+#else /* !AFS_OSF_ENV && !AFS_SGI61_ENV */
printfParms[pfpix] = alp[pix];
-#endif /* AFS_ALPHA_ENV */
-#endif /* AFS_SGI61_ENV */
+#endif
pfpix++;
break;
case ICL_TYPE_INT32:
#include <sys/vnode.h>
#endif /* AFS_SGI_ENV */
#else
-#ifdef AFS_MACH_ENV
-#include <vfs/vfs.h>
-#include <vfs/vnode.h>
-#include <sys/inode.h>
-#else /* AFS_MACH_ENV */
#if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
#include <sys/vnode.h>
#include <sys/mount.h>
#endif
#endif
#endif
-#endif /* AFS_MACH_ENV */
#include <signal.h>
#endif
int debug; /* output debugging info */
int cvtflag; /* convert to old file system format */
char preen; /* just fix normal inconsistencies */
-#if defined(AFS_DEC_ENV)
-char only_when_needed; /* check filesystems only when needed */
-#endif
char hotroot; /* checking root device */
char havesb; /* superblock has been read */
#ifdef VICE
int nViceFiles; /* number of vice files seen */
-#if defined(AFS_SUN_ENV) || defined(AFS_DEC_ENV)
+#if defined(AFS_SUN_ENV)
int iscorrupt; /* known to be corrupt/inconsistent */
#endif
#ifdef AFS_SUN_ENV
#endif /* AFS_VFSINCL_ENV */
#endif /* AFS_OSF_ENV */
-#ifdef AFS_DEC_ENV
-#include <sys/fs_types.h>
-#endif
-
#include <sys/stat.h>
#include <sys/wait.h>
#ifdef AFS_SUN5_ENV
preen++;
break;
#endif
-#if defined(AFS_DEC_ENV)
- /* On the late versions of Ultrix they changed the defn of '-p' a bit. Particularly,
- * -p is used to check a file system that was not unmounted cleanly, and they added,
- * -P to check a file system regardless of how it was unmounted; this, unfortunately,
- * is identical to '-p' on the rest of the systems but we have to maintain vendor's
- * semantics so we leave it the way Dec likes it.
- */
- case 'p':
- only_when_needed++;
- /* P is for Ultrix compatibility */
- case 'P':
-#else
case 'p':
-#endif
preen++;
break;
#if defined(AFS_HPUX100_ENV)
&& strcmp(fsp->fs_type, FSTAB_RO)
&& strcmp(fsp->fs_type, FSTAB_RQ))
continue;
-#ifdef AFS_DEC_ENV
- /* Only check local (i.e. ufs) file systems */
- if (strcmp(fsp->fs_name, "4.2") && strcmp(fsp->fs_name, "ufs"))
- continue;
-#endif
#ifdef AFS_OSF_ENV
if (strcmp(fsp->fs_vfstype, "ufs") || fsp->fs_passno == 0) {
continue;
struct zlncnt *zlnp;
char devbuffer[128];
int ret_val;
-#ifdef AFS_DEC_ENV
- int retries = 3; /* # of retries fora clean fsck pass */
- int fsdirty = 0; /* file system was or is dirty */
- int rootdirty = 0; /* Root was or is dirty */
-#endif
#ifdef AFS_OSF_ENV
int temp;
EnsureDevice(devname); /* canonicalize name */
if (debug && preen)
pinfo("starting\n");
-#ifdef AFS_DEC_ENV
- for (; retries > 0; retries--) { /* 003 - Loop for NUMRETRIES or until clean */
-#endif
ret_val = setup(devname);
} else if (ret_val == -1) { /* pclean && FS_CLEAN */
return (1);
#endif
-#if defined(AFS_DEC_ENV) || defined(AFS_OSF_ENV)
+#if defined(AFS_OSF_ENV)
} else if (ret_val == FS_CLEAN) { /* pclean && FS_CLEAN */
return (1);
#endif
msgprintf("** Phase 5 - Check Cyl groups\n");
pass5();
-#ifdef AFS_DEC_ENV
- if (fsmodified || (sblk.b_dirty) || (cgblk.b_dirty)) {
- fsdirty = 1;
- if (hotroot)
- rootdirty = 1;
- if (retries <= 1) {
- /*
- * 003 - Number of retry attempts have been
- * exhausted. Mark super block as dirty.
- */
- (void)time(&sblock.fs_time);
- sbdirty();
- }
- } else {
- /*
- * 003 - If checking root file system, and it was
- * modified during any pass, don't assume it is ok. Must reboot.
- */
- if (rootdirty) {
- sbdirty();
- retries = 0;
- } else {
- if ((!hotroot) && (!bflag) && (!nflag) && (!iscorrupt)) {
- sblock.fs_fmod = 0;
- sblock.fs_clean = FS_CLEAN;
- (void)time(&sblock.fs_time);
- (void)time(&sblock.fs_lastfsck);
- if ((sblock.fs_deftimer) && (sblock.fs_deftimer > 0)
- && (sblock.fs_deftimer < 255))
- sblock.fs_cleantimer = sblock.fs_deftimer;
- else
- sblock.fs_cleantimer = sblock.fs_deftimer =
- FSCLEAN_TIMEOUTFACTOR;
- sbdirty();
- }
- /*
- * 006 - If an alternate super block was used,
- * we want to re fsck the partition after
- * updating the primary super block.
- */
- if (!bflag)
- retries = 0;
- }
- }
- /* Unless no updates are to be done, write out maps. */
- if (nflag)
- retries = 0;
- else
- ckfini();
- if (debug) {
- daddr_t nn_files = n_files;
- daddr_t nn_blks = n_blks;
-
- n_ffree = sblock.fs_cstotal.cs_nffree;
- n_bfree = sblock.fs_cstotal.cs_nbfree;
- if (nn_files -= maxino - ROOTINO - sblock.fs_cstotal.cs_nifree)
- printf("%d files missing\n", nn_files);
- nn_blks +=
- sblock.fs_ncg * (cgdmin(&sblock, 0) - cgsblock(&sblock, 0));
- nn_blks += cgsblock(&sblock, 0) - cgbase(&sblock, 0);
- nn_blks += howmany(sblock.fs_cssize, sblock.fs_fsize);
- if (nn_blks -= maxfsblock - (n_ffree + sblock.fs_frag * n_bfree))
- printf("%d blocks missing\n", nn_blks);
- }
- if (duplist != NULL) {
- if (debug)
- printf("The following duplicate blocks remain:");
- for (dp = duplist; dp; dp = dp->next) {
- if (debug)
- printf(" %d,", dp->dup);
- free(dp);
- }
- if (debug)
- printf("\n");
- }
- if (zlnhead != NULL) {
- if (debug)
- printf("The following zero link count inodes remain:");
- for (zlnp = zlnhead; zlnp; zlnp = zlnp->next) {
- if (debug)
- printf(" %d,", zlnp->zlncnt);
- free(zlnp);
- }
- if (debug)
- printf("\n");
- }
- zlnhead = NULL;
- duplist = NULL;
-
- free(blockmap);
- free(statemap);
- free((char *)lncntp);
- /* Print out retry message, and fsck file system again. */
- if (retries > 1)
- if (preen)
- printf("%s: FILE SYSTEM MODIFIED, VERIFYING\n", filesys);
- else
- printf("**** FILE SYSTEM MODIFIED, VERIFYING\n");
- } /* for retries */
-#endif
-
-#if defined(AFS_SUN_ENV) && !defined(AFS_SUN3_ENV)
+#if defined(AFS_SUN_ENV)
updateclean();
if (debug)
printclean();
n printf("(%d frags, %d blocks, %.1f%% fragmentation)\n", n_ffree,
n_bfree, (float)(n_ffree * 100) / sblock.fs_dsize);
#endif /* VICE */
-#ifdef AFS_DEC_ENV
- if ((!fsdirty) && (!rootdirty))
- return;
- if (!preen) {
- printf("\n***** FILE SYSTEM WAS MODIFIED *****\n");
- if (hotroot)
- printf("\n***** HALT PROCESSOR WITHOUT SYNCING DISK *****\n");
- }
- if (hotroot) {
- sync();
- exit(4);
- }
-#else
if (debug && (n_files -= maxino - ROOTINO - sblock.fs_cstotal.cs_nifree))
msgprintf("%d files missing\n", n_files);
if (debug) {
msgprintf("\n");
}
}
-#endif
#ifdef AFS_HPUX_ENV
/* if user's specification denotes that the file system block
* is going to be modified (nflag == 0) then fsck store the
}
#endif
#endif
-#ifndef AFS_DEC_ENV
ckfini();
free(blockmap);
free(statemap);
exit(4);
#endif
}
-#endif
#ifdef VICE
(void)close(fsreadfd);
(void)close(fswritefd);
if (nViceFiles || tryForce) {
/* Modified file system with vice files: force full salvage */
/* Salvager recognizes the file FORCESALVAGE in the root of each partition */
-#if !defined(AFS_DEC_ENV)
struct ufs_args ufsargs;
-#endif
char pname[100], fname[100], *special;
int fd, code, failed = 0;
if (failed && parname) {
strcpy(pname, parname);
}
-#if !defined(AFS_DEC_ENV) && !defined(AFS_HPUX_ENV)
+#if !defined(AFS_HPUX_ENV)
#ifdef AFS_SUN5_ENV
ufsargs.flags = UFSMNT_NOINTR;
#else
ufsargs.fspec = devname;
#endif
-#ifdef AFS_SUN_ENV
#ifdef AFS_SUN5_ENV
if (mount
(devname, pname, MS_DATA, "ufs", (char *)&ufsargs,
sizeof(ufsargs)) < 0) {
#else
- if (mount("4.2", pname, M_NEWTYPE, &ufsargs) < 0) {
-#endif
-#else
if (mount(MOUNT_UFS, pname, 0, &ufsargs) < 0) {
#endif
#else
-#ifdef AFS_DEC_ENV
- if (mount(devname, pname, 0, GT_ULTRIX, NULL)) {
-#else
if (mount(devname, pname, 0) < 0) {
#endif
-#endif
printf
("Couldn't mount %s on %s to force FULL SALVAGE; continuing anyway (%d)!\n",
devname, pname, errno);
fd = open(fname, O_CREAT, 0);
if (fd == -1) {
errexit("Couldn't create %s to force full salvage!\n", fname);
-#if defined(AFS_DEC_ENV)
- stat(".", &tstat);
-#endif
} else {
fstat(fd, &tstat);
close(fd);
}
-#if /*defined(AFS_VFS_ENV) &&*/ !defined(AFS_DEC_ENV) && !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV)
+#if !defined(AFS_HPUX_ENV) && !defined(AFS_SUN5_ENV) && !defined(AFS_OSF_ENV)
unmount(pname);
#else
-#if defined(AFS_DEC_ENV)
- umount(tstat.st_dev);
-#else
#if defined(AFS_OSF_ENV)
umount(pname, MNT_NOFORCE);
#else /* AFS_OSF_ENV */
umount(devname);
#endif
#endif
-#endif
}
rmdir(pname);
}
if (dirp->d_ino != 0 && strcmp(dirp->d_name, "..") != 0) {
pfatal("CANNOT FIX, FIRST ENTRY IN DIRECTORY CONTAINS %s\n",
dirp->d_name);
-#if defined(AFS_SUN_ENV) || defined(AFS_DEC_ENV)
+#if defined(AFS_SUN_ENV)
iscorrupt = 1;
#endif
} else if (dirp->d_reclen < entrysize) {
pfatal("CANNOT FIX, INSUFFICIENT SPACE TO ADD '.'\n");
-#if defined(AFS_SUN_ENV) || defined(AFS_DEC_ENV)
+#if defined(AFS_SUN_ENV)
iscorrupt = 1;
#endif
} else if (dirp->d_reclen < 2 * entrysize) {
if (dirp->d_ino != 0 && strcmp(dirp->d_name, ".") != 0) {
pfatal("CANNOT FIX, SECOND ENTRY IN DIRECTORY CONTAINS %s\n",
dirp->d_name);
-#if defined(AFS_SUN_ENV) || defined(AFS_DEC_ENV)
+#if defined(AFS_SUN_ENV)
iscorrupt = 1;
#endif
} else if (dirp->d_reclen < entrysize) {
pfatal("CANNOT FIX, INSUFFICIENT SPACE TO ADD '..'\n");
-#if defined(AFS_SUN_ENV) || defined(AFS_DEC_ENV)
+#if defined(AFS_SUN_ENV)
iscorrupt = 1;
#endif
} else {
sbfine(fs);
sbdirty();
}
-#if defined(AFS_DEC_ENV)
- if (sbfine(fs)) {
- int oldmod;
- /* don't change fsmodified here, or fsck will think that modified
- * mounted file system requires reboot, when it is really fine
- * (since it is mounted, and thus clean flag doesn't matter) */
- oldmod = fsmodified;
- sbdirty();
- flush(fswritefd, &sblk);
- fsmodified = oldmod;
- }
-#endif
}
/* returns true if sbdirty should be called */
{
int rcode;
rcode = 0;
-#if defined(AFS_DEC_ENV)
- if (fs->fs_fmod != 0 || fs->fs_clean != FS_CLEAN) {
- fs->fs_fmod = 0;
- fs->fs_clean = FS_CLEAN;
- rcode = 1;
- }
- if (fs->fs_deftimer) {
- fs->fs_cleantimer = fs->fs_deftimer = (fs->fs_deftimer > 0
- && fs->fs_deftimer <
- 255) ? fs->
- fs_deftimer : FSCLEAN_TIMEOUTFACTOR;
- rcode = 1;
- }
-#else
if (fs->fs_fmod != 0) {
fs->fs_fmod = 0;
rcode = 1;
}
-#endif /* AFS_DEC_ENV */
return rcode;
}
mlk_pbp = 0;
pbp = 0;
mlk_startinum = 0;
-#ifdef AFS_DEC_ENV
- iscorrupt = 0;
-#endif
#if defined(ACLS) && defined(AFS_HPUX_ENV)
n_cont = 0;
#endif
sbdirty();
}
}
-#ifdef AFS_DEC_ENV
- /*
- * If '-p' is used and the partition was cleanly unmounted last time then skip the
- * fscking process
- */
- if (only_when_needed && (sblock.fs_clean == FS_CLEAN)
- && clean_byte_valid(sblock.fs_lastfsck)) {
- msgprintf("%s: umounted cleanly\n", dev);
- return (FS_CLEAN);
- }
-#endif
#ifdef AFS_HPUX_ENV
/*
* Do we need to continue ?
memcpy((char *)altsblock.fs_sparecon, (char *)sblock.fs_sparecon,
sizeof sblock.fs_sparecon);
#endif
-#if defined(AFS_DEC_ENV)
- memcpy((char *)altsblock.fs_extra, (char *)sblock.fs_extra,
- sizeof sblock.fs_extra);
- altsblock.fs_deftimer = sblock.fs_deftimer;
- altsblock.fs_lastfsck = sblock.fs_lastfsck;
- altsblock.fs_gennum = sblock.fs_gennum;
-#endif
/*
* The following should not have to be copied.
*/
return 0;
}
-#ifdef AFS_DEC_ENV
-clean_byte_valid(lastfsck)
- time_t lastfsck;
-{
- time_t now;
- int delta;
-
- time(&now);
- if ((!sblock.fs_deftimer) || (!sblock.fs_lastfsck) || (lastfsck > now)) {
- sblock.fs_deftimer = 0;
- return (0);
- }
- if (!sblock.fs_cleantimer)
- return (0);
- delta = (now - lastfsck) / 86400;
- if (delta > 60)
- return (0);
- return (1);
-}
-#endif
-
#include <sys/ustat.h>
#ifdef AFS_HPUX_ENV
#include <sys/pstat.h>
long lseek();
#endif
char *malloc();
-#if defined(AFS_SUN_ENV) || defined(AFS_DEC_ENV)
+#if defined(AFS_SUN_ENV)
extern int iscorrupt;
#endif
#ifdef AFS_SUN_ENV
printf("\n");
if (!persevere && (nflag || fswritefd < 0)) {
printf("%s? no\n\n", question);
-#if defined(AFS_SUN_ENV) || defined(AFS_DEC_ENV)
+#if defined(AFS_SUN_ENV)
iscorrupt = 1; /* known to be corrupt */
#endif
return (0);
#ifdef AFS_HPUX_ENV
fixed = 0;
#endif
-#if defined(AFS_SUN_ENV) || defined(AFS_DEC_ENV)
+#if defined(AFS_SUN_ENV)
iscorrupt = 1; /* known to be corrupt */
#endif
return (0);
pfatal("WRITING %sZERO'ED BLOCK %d TO DISK\n",
(bp->b_errs == bp->b_size / dev_bsize) ? "" : "PARTIALLY ",
bp->b_bno);
-#ifdef AFS_DEC_ENV
- iscorrupt = 1;
-#endif
}
bp->b_dirty = 0;
bp->b_errs = 0;
("DT: inode=%s, name=%s, errno=%d\n",
PrintInode(NULL, VN_GET_INO(*targetptr)), Name,
errno));
-#ifdef AFS_DEC_ENV
- if ((errno != ENOENT) && (errno != EIO) && (errno != ENXIO))
-#else
if (errno != ENOENT)
-#endif
{
ViceLog(0,
("Volume %u now offline, must be salvaged.\n",
#endif
#endif
#else /* AFS_VFSINCL_ENV */
-#ifdef AFS_DEC_ENV
-#include <sys/time.h>
-#endif /* AFS_DEC_ENV */
#ifdef AFS_OSF_ENV
#include <ufs/inode.h>
#else /* AFS_OSF_ENV */