summaryrefslogtreecommitdiff
path: root/sys/ufs/ffs
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2004-01-07 20:47:48 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2004-01-07 20:47:48 +0000
commiteeee9a1d3c9f98a31ebe3555d9c7c6efff9a762d (patch)
tree8adc97452481cd596a9d5c708431be8bbcd38c08 /sys/ufs/ffs
parent04647a749cfc2388b71cd4d9c0283ad6bd5c6d7b (diff)
sysctls for dirhash variables. with a hint from miod. ok deraadt
Diffstat (limited to 'sys/ufs/ffs')
-rw-r--r--sys/ufs/ffs/ffs_extern.h10
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c14
2 files changed, 21 insertions, 3 deletions
diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h
index 1652ea0eba6..1eb46553dad 100644
--- a/sys/ufs/ffs/ffs_extern.h
+++ b/sys/ufs/ffs/ffs_extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_extern.h,v 1.21 2003/06/02 23:28:23 millert Exp $ */
+/* $OpenBSD: ffs_extern.h,v 1.22 2004/01/07 20:47:47 tedu Exp $ */
/* $NetBSD: ffs_extern.h,v 1.4 1996/02/09 22:22:22 christos Exp $ */
/*-
@@ -48,7 +48,10 @@
#define FFS_SD_INODE_BITMAP 14 /* bufs redirtied as inode bitmap not written */
#define FFS_SD_DIRECT_BLK_PTRS 15 /* bufs redirtied as direct ptrs not written */
#define FFS_SD_DIR_ENTRY 16 /* bufs redirtied as dir entry cannot write */
-#define FFS_MAXID 17 /* number of valid ffs ids */
+#define FFS_DIRHASH_DIRSIZE 17 /* min directory size, in bytes */
+#define FFS_DIRHASH_MAXMEM 18 /* max kvm to use, in bytes */
+#define FFS_DIRHASH_MEM 19 /* current mem usage, in bytes */
+#define FFS_MAXID 20 /* number of valid ffs ids */
#define FFS_NAMES { \
{ 0, 0 }, \
@@ -68,6 +71,9 @@
{ "sd_inode_bitmap", CTLTYPE_INT }, \
{ "sd_direct_blk_ptrs", CTLTYPE_INT }, \
{ "sd_dir_entry", CTLTYPE_INT }, \
+ { "dirhash_dirsize", CTLTYPE_INT }, \
+ { "dirhash_maxmem", CTLTYPE_INT }, \
+ { "dirhash_mem", CTLTYPE_INT }, \
}
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 4d0e448eba8..58cf64d7c6b 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_vfsops.c,v 1.61 2003/10/17 15:08:11 mpech Exp $ */
+/* $OpenBSD: ffs_vfsops.c,v 1.62 2004/01/07 20:47:47 tedu Exp $ */
/* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */
/*
@@ -60,6 +60,7 @@
#include <ufs/ufs/inode.h>
#include <ufs/ufs/dir.h>
#include <ufs/ufs/ufs_extern.h>
+#include <ufs/ufs/dirhash.h>
#include <ufs/ffs/fs.h>
#include <ufs/ffs/ffs_extern.h>
@@ -1440,6 +1441,17 @@ ffs_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
case FFS_SD_DIR_ENTRY:
return (sysctl_rdint(oldp, oldlenp, newp, stat_dir_entry));
#endif
+#ifdef UFS_DIRHASH
+ case FFS_DIRHASH_DIRSIZE:
+ return (sysctl_int(oldp, oldlenp, newp, newlen,
+ &ufs_mindirhashsize));
+ case FFS_DIRHASH_MAXMEM:
+ return (sysctl_int(oldp, oldlenp, newp, newlen,
+ &ufs_dirhashmaxmem));
+ case FFS_DIRHASH_MEM:
+ return (sysctl_rdint(oldp, oldlenp, newp, ufs_dirhashmem));
+#endif
+
default:
return (EOPNOTSUPP);
}