char lockers;
char dirty;
char hashIndex;
-#if defined(AFS_USEBUFFERS)
- struct buf *bufp;
-#endif
afs_rwlock_t lock; /* the lock for this structure */
};
#ifndef BUF_TIME_MAX
#define BUF_TIME_MAX 0x7fffffff
#endif
-#if defined(AFS_USEBUFFERS)
-/* number of pages per Unix buffer, when we're using Unix buffer pool */
-#define NPB 4
-#else
#define NPB 8 /* must be a pwer of 2 */
-#endif
static int afs_max_buffers; /* should be an integral multiple of NPB */
/* page size */
/* Initialize the venus buffer system. */
register int i;
register struct buffer *tb;
-#if defined(AFS_USEBUFFERS)
- struct buf *tub; /* unix buffer for allocation */
-#endif
AFS_STATCNT(DInit);
if (dinit_flag)
dinit_flag = 1;
/* round up to next multiple of NPB, since we allocate multiple pages per chunk */
abuffers = ((abuffers - 1) | (NPB - 1)) + 1;
-#if defined(AFS_USEBUFFERS)
- afs_max_buffers = abuffers;
-#else
afs_max_buffers = abuffers << 2; /* possibly grow up to 4 times as big */
-#endif
LOCK_INIT(&afs_bufferLock, "afs_bufferLock");
Buffers =
(struct buffer *)afs_osi_Alloc(afs_max_buffers * sizeof(struct buffer));
for (i = 0; i < abuffers; i++) {
if ((i & (NPB - 1)) == 0) {
/* time to allocate a fresh buffer */
-#if defined(AFS_USEBUFFERS)
- tub = geteblk(AFS_BUFFER_PAGESIZE * NPB);
- BufferData = (char *)tub->b_un.b_addr;
-#else
BufferData = (char *) afs_osi_Alloc(AFS_BUFFER_PAGESIZE * NPB);
-#endif
}
/* Fill in each buffer with an empty indication. */
tb = &Buffers[i];
afs_reset_inode(&tb->inode);
tb->accesstime = 0;
tb->lockers = 0;
-#if defined(AFS_USEBUFFERS)
- if ((i & (NPB - 1)) == 0)
- tb->bufp = tub;
- else
- tb->bufp = 0;
-#endif
tb->data = &BufferData[AFS_BUFFER_PAGESIZE * (i & (NPB - 1))];
tb->hashIndex = 0;
tb->dirty = 0;
dinit_flag = 0;
tp = Buffers;
for (i = 0; i < nbuffers; i += NPB, tp += NPB) {
-#if defined(AFS_USEBUFFERS)
- /* The following check shouldn't be necessary and it will be removed soon */
- if (!tp->bufp)
- afs_warn
- ("afs: shutdown_bufferpackage: bufp == 0!! Shouldn't happen\n");
- else {
- brelse(tp->bufp);
- tp->bufp = 0;
- }
-#else
afs_osi_Free(tp->data, NPB * AFS_BUFFER_PAGESIZE);
-#endif
}
afs_osi_Free(Buffers, nbuffers * sizeof(struct buffer));
nbuffers = 0;
#ifdef KERNEL
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
#ifdef KERNEL
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
#ifdef KERNEL
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
#ifdef KERNEL
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
#ifdef KERNEL
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
#ifdef KERNEL
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
#ifdef KERNEL
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
#ifdef KERNEL
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
#ifdef KERNEL
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
#ifdef KERNEL
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
#ifdef KERNEL\r
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */\r
#define AFS_SYSVLOCK 1 /* sys v locking supported */\r
-/*#define AFS_USEBUFFERS 1*/\r
#define afsio_iov uio_iov\r
#define afsio_iovcnt uio_iovcnt\r
#define afsio_offset uio_offset\r
#define AFS_VFS34 1 /* afs/afs_vfsops.c (afs_vget), afs/afs_vnodeops.c (afs_lockctl, afs_noop) */
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
#ifdef KERNEL
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
#define AFS_VFS34 1 /* afs/afs_vfsops.c (afs_vget), afs/afs_vnodeops.c (afs_lockctl, afs_noop) */
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
#ifdef KERNEL
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
#define AFS_VFS34 1 /* afs/afs_vfsops.c (afs_vget), afs/afs_vnodeops.c (afs_lockctl, afs_noop) */
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
#ifdef KERNEL
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
#define AFS_VFS34 1 /* afs/afs_vfsops.c (afs_vget), afs/afs_vnodeops.c (afs_lockctl, afs_noop) */
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
#ifdef KERNEL
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
/* sun definitions here */
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_loffset
#ifdef KERNEL
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
/* sun definitions here */
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_loffset
#ifdef KERNEL
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
/* sun definitions here */
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
#ifdef KERNEL
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
/* sun definitions here */
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_loffset
#ifdef KERNEL
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
/* sun definitions here */
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_loffset
#ifdef KERNEL
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
/* sun definitions here */
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_loffset
#ifdef KERNEL
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
/* sun definitions here */
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_loffset
#ifdef KERNEL
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
/* sun definitions here */
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_loffset
#ifdef KERNEL
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
/* sun definitions here */
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_loffset
#ifdef KERNEL
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
/* sun definitions here */
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
/* sun definitions here */
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_loffset
#ifdef KERNEL
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
/* sun definitions here */
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_loffset
#ifdef KERNEL
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
/* sun definitions here */
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_loffset
#ifdef KERNEL
#define AFS_UIOFMODE 1 /* Only in afs/afs_vnodeops.c (afs_ustrategy) */
#define AFS_SYSVLOCK 1 /* sys v locking supported */
-/*#define AFS_USEBUFFERS 1*/
#define afsio_iov uio_iov
#define afsio_iovcnt uio_iovcnt
#define afsio_offset uio_offset
T += i;
printf("%20s:\t%8d bytes\t[%d entries/%d bytes each]\n", "Buffer package",
i, j, sizeof(struct buffer));
-#if !AFS_USEBUFFERS
#define AFS_BUFFER_PAGESIZE 2048
i = j * AFS_BUFFER_PAGESIZE;
T += i;
printf("%20s:\t%8d bytes\t[%d entries/%d bytes each]\n",
"Xtra Buffer pkg area", i, j, AFS_BUFFER_PAGESIZE);
-#endif
Sum_exps = 0;
Sum_nfssysnames = 0;