Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src/sys/ufs/lfs Pull up revisions 1.33-1.35 (requested by p...
details: https://anonhg.NetBSD.org/src/rev/58e5d8d0624b
branches: netbsd-1-5
changeset: 490625:58e5d8d0624b
user: he <he%NetBSD.org@localhost>
date: Sat Feb 03 21:50:12 2001 +0000
description:
Pull up revisions 1.33-1.35 (requested by perseant):
o Don't write anything if the filesystem is idle (PR#10979).
o Close up accounting holes in LFS' accounting of immediately-
available-space, number of clean segments, and amount of dirty
space taken up by metadata (PR#11468, PR#11470, PR#11534).
diffstat:
sys/ufs/lfs/lfs.h | 43 ++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 42 insertions(+), 1 deletions(-)
diffs (64 lines):
diff -r 3b4579b1cf63 -r 58e5d8d0624b sys/ufs/lfs/lfs.h
--- a/sys/ufs/lfs/lfs.h Sat Feb 03 21:47:12 2001 +0000
+++ b/sys/ufs/lfs/lfs.h Sat Feb 03 21:50:12 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs.h,v 1.25.2.1 2000/09/14 18:50:17 perseant Exp $ */
+/* $NetBSD: lfs.h,v 1.25.2.2 2001/02/03 21:50:12 he Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -89,6 +89,36 @@
#define LFS_MAX_ACTIVE 10
#define LFS_MAXDIROP (desiredvnodes>>2)
+/*
+ * #define WRITE_THRESHHOLD ((nbuf >> 1) - 10)
+ * #define WAIT_THRESHHOLD (nbuf - (nbuf >> 2) - 10)
+ */
+#define LFS_MAX_BUFS ((nbuf >> 2) - 10)
+#define LFS_WAIT_BUFS ((nbuf >> 1) - (nbuf >> 3) - 10)
+/* These are new ... is LFS taking up too much memory in its buffers? */
+#define LFS_MAX_BYTES (((bufpages >> 2) - 10) * NBPG)
+#define LFS_WAIT_BYTES (((bufpages >> 1) - (bufpages >> 3) - 10) * NBPG)
+#define LFS_BUFWAIT 2
+
+#define LFS_LOCK_BUF(bp) do { \
+ if (((bp)->b_flags & (B_LOCKED | B_CALL)) == 0) { \
+ ++locked_queue_count; \
+ locked_queue_bytes += bp->b_bufsize; \
+ } \
+ (bp)->b_flags |= B_LOCKED; \
+} while(0)
+
+#define LFS_UNLOCK_BUF(bp) do { \
+ if (((bp)->b_flags & (B_LOCKED | B_CALL)) == B_LOCKED) { \
+ --locked_queue_count; \
+ locked_queue_bytes -= bp->b_bufsize; \
+ if (locked_queue_count < LFS_WAIT_BUFS && \
+ locked_queue_bytes < LFS_WAIT_BYTES) \
+ wakeup(&locked_queue_count); \
+ } \
+ (bp)->b_flags &= ~B_LOCKED; \
+} while(0)
+
/* For convenience */
#define IN_ALLMOD (IN_MODIFIED|IN_ACCESS|IN_CHANGE|IN_UPDATE|IN_ACCESSED|IN_CLEANING)
#define LFS_SET_UINO(ip, flags) do { \
@@ -482,6 +512,17 @@
(CP) = (CLEANERINFO *)(BP)->b_data; \
}
+/* Synchronize the Ifile cleaner info with current avail and bfree */
+#define LFS_SYNC_CLEANERINFO(cip, fs, bp, w) do { \
+ if ((w) || (cip)->bfree != (fs)->lfs_bfree || \
+ (cip)->avail != (fs)->lfs_avail - (fs)->lfs_ravail) { \
+ (cip)->bfree = (fs)->lfs_bfree; \
+ (cip)->avail = (fs)->lfs_avail - (fs)->lfs_ravail; \
+ (void) VOP_BWRITE(bp); /* Ifile */ \
+ } else \
+ brelse(bp); \
+} while(0)
+
/* Read in the block with a specific inode from the ifile. */
#define LFS_IENTRY(IP, F, IN, BP) { \
int _e; \
Home |
Main Index |
Thread Index |
Old Index