#include "afs/dir.h"
#include "afs/afs_stats.h"
-#include "afs/longc_procs.h"
#include "afs/afs.h"
#ifndef BUF_TIME_MAX
/* Initialize the venus buffer system. */
register int i;
register struct buffer *tb;
-#if AFS_USEBUFFERS
+#if defined(AFS_USEBUFFERS)
struct buf *tub; /* unix buffer for allocation */
#endif
if (dinit_flag)
return;
dinit_flag = 1;
-#if AFS_USEBUFFERS
+#if defined(AFS_USEBUFFERS)
/* round up to next multiple of NPB, since we allocate multiple pages per chunk */
abuffers = ((abuffers - 1) | (NPB - 1)) + 1;
#endif
LOCK_INIT(&afs_bufferLock, "afs_bufferLock");
Buffers =
(struct buffer *)afs_osi_Alloc(abuffers * sizeof(struct buffer));
-#if !AFS_USEBUFFERS
+#if !defined(AFS_USEBUFFERS)
BufferData = (char *)afs_osi_Alloc(abuffers * AFS_BUFFER_PAGESIZE);
#endif
timecounter = 1;
for (i = 0; i < PHSIZE; i++)
phTable[i] = 0;
for (i = 0; i < abuffers; i++) {
-#if AFS_USEBUFFERS
+#if defined(AFS_USEBUFFERS)
if ((i & (NPB - 1)) == 0) {
/* time to allocate a fresh buffer */
tub = geteblk(AFS_BUFFER_PAGESIZE * NPB);
tb->inode = 0;
tb->accesstime = 0;
tb->lockers = 0;
-#if AFS_USEBUFFERS
+#if defined(AFS_USEBUFFERS)
if ((i & (NPB - 1)) == 0)
tb->bufp = tub;
else
/* Release a buffer, specifying whether or not the buffer has been
* modified by the locker. */
register int index;
-#if AFS_USEBUFFERS
+#if defined(AFS_USEBUFFERS)
register struct buffer *tp;
#endif
AFS_STATCNT(DRelease);
if (!bp)
return;
-#if AFS_USEBUFFERS
+#if defined(AFS_USEBUFFERS)
/* look for buffer by scanning Unix buffers for appropriate address */
tp = Buffers;
for (index = 0; index < nbuffers; index += NPB, tp += NPB) {
/* Return the byte within a file represented by a buffer pointer. */
register struct buffer *bp;
register int index;
-#if AFS_USEBUFFERS
+#if defined(AFS_USEBUFFERS)
register struct buffer *tp;
#endif
AFS_STATCNT(DVOffset);
bp = ap;
-#if AFS_USEBUFFERS
+#if defined(AFS_USEBUFFERS)
/* look for buffer by scanning Unix buffers for appropriate address */
tp = Buffers;
for (index = 0; index < nbuffers; index += NPB, tp += NPB) {
void
shutdown_bufferpackage(void)
{
-#if AFS_USEBUFFERS
+#if defined(AFS_USEBUFFERS)
register struct buffer *tp;
#endif
int i;
DFlush();
if (afs_cold_shutdown) {
dinit_flag = 0;
-#if !AFS_USEBUFFERS
+#if !defined(AFS_USEBUFFERS)
afs_osi_Free(BufferData, nbuffers * AFS_BUFFER_PAGESIZE);
#else
tp = Buffers;