diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 311d6a54a1fc..c33640ac758a 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -1979,13 +1979,13 @@ nchinit(void *dummy __unused) SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_SECOND, nchinit, NULL); void -cache_changesize(int newmaxvnodes) +cache_changesize(u_long newmaxvnodes) { struct nchashhead *new_nchashtbl, *old_nchashtbl; u_long new_nchash, old_nchash; struct namecache *ncp; uint32_t hash; - int newncsize; + u_long newncsize; int i; newncsize = newmaxvnodes * ncsizefactor; diff --git a/sys/kern/vfs_hash.c b/sys/kern/vfs_hash.c index ca3c371a0f8b..f3e12df9c130 100644 --- a/sys/kern/vfs_hash.c +++ b/sys/kern/vfs_hash.c @@ -199,7 +199,7 @@ vfs_hash_rehash(struct vnode *vp, u_int hash) } void -vfs_hash_changesize(int newmaxvnodes) +vfs_hash_changesize(u_long newmaxvnodes) { struct vfs_hash_head *vfs_hash_newtbl, *vfs_hash_oldtbl; u_long vfs_hash_newmask, vfs_hash_oldmask; diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index c51af90a561b..d65839d66722 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -310,20 +310,21 @@ static enum { SYNCER_RUNNING, SYNCER_SHUTTING_DOWN, SYNCER_FINAL_DELAY } syncer_state; /* Target for maximum number of vnodes. */ -int desiredvnodes; -static int gapvnodes; /* gap between wanted and desired */ -static int vhiwat; /* enough extras after expansion */ -static int vlowat; /* minimal extras before expansion */ -static int vstir; /* nonzero to stir non-free vnodes */ +u_long desiredvnodes; +static u_long gapvnodes; /* gap between wanted and desired */ +static u_long vhiwat; /* enough extras after expansion */ +static u_long vlowat; /* minimal extras before expansion */ +static u_long vstir; /* nonzero to stir non-free vnodes */ static volatile int vsmalltrigger = 8; /* pref to keep if > this many pages */ static int sysctl_update_desiredvnodes(SYSCTL_HANDLER_ARGS) { - int error, old_desiredvnodes; + u_long old_desiredvnodes; + int error; old_desiredvnodes = desiredvnodes; - if ((error = sysctl_handle_int(oidp, arg1, arg2, req)) != 0) + if ((error = sysctl_handle_long(oidp, arg1, arg2, req)) != 0) return (error); if (old_desiredvnodes != desiredvnodes) { wantfreevnodes = desiredvnodes / 4; @@ -336,7 +337,7 @@ sysctl_update_desiredvnodes(SYSCTL_HANDLER_ARGS) SYSCTL_PROC(_kern, KERN_MAXVNODES, maxvnodes, CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, &desiredvnodes, 0, - sysctl_update_desiredvnodes, "I", "Target for maximum number of vnodes"); + sysctl_update_desiredvnodes, "UL", "Target for maximum number of vnodes"); SYSCTL_ULONG(_kern, OID_AUTO, minvnodes, CTLFLAG_RW, &wantfreevnodes, 0, "Old name for vfs.wantfreevnodes (legacy)"); static int vnlru_nowhere; @@ -459,7 +460,7 @@ PCTRIE_DEFINE(BUF, buf, b_lblkno, buf_trie_alloc, buf_trie_free); * grows, the ratio of the memory size in KB to vnodes approaches 64:1. */ #ifndef MAXVNODES_MAX -#define MAXVNODES_MAX (512 * 1024 * 1024 / 64) /* 8M */ +#define MAXVNODES_MAX (512UL * 1024 * 1024 / 64) /* 8M */ #endif static MALLOC_DEFINE(M_VNODE_MARKER, "vnodemarker", "vnode marker"); @@ -582,7 +583,7 @@ vntblinit(void *dummy __unused) desiredvnodes = min(physvnodes, virtvnodes); if (desiredvnodes > MAXVNODES_MAX) { if (bootverbose) - printf("Reducing kern.maxvnodes %d -> %d\n", + printf("Reducing kern.maxvnodes %lu -> %lu\n", desiredvnodes, MAXVNODES_MAX); desiredvnodes = MAXVNODES_MAX; } diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index efbe5df5dba0..98a12bbea962 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -434,7 +434,7 @@ extern int vttoif_tab[]; */ extern struct vnode *rootvnode; /* root (i.e. "/") vnode */ extern struct mount *rootdevmp; /* "/dev" mount */ -extern int desiredvnodes; /* number of vnodes desired */ +extern u_long desiredvnodes; /* number of vnodes desired */ extern struct uma_zone *namei_zone; extern struct vattr va_null; /* predefined null vattr structure */ @@ -607,7 +607,7 @@ typedef int (*vn_get_ino_t)(struct mount *, void *, int, struct vnode **); int bnoreuselist(struct bufv *bufv, struct bufobj *bo, daddr_t startn, daddr_t endn); /* cache_* may belong in namei.h. */ -void cache_changesize(int newhashsize); +void cache_changesize(u_long newhashsize); #define cache_enter(dvp, vp, cnp) \ cache_enter_time(dvp, vp, cnp, NULL, NULL) void cache_enter_time(struct vnode *dvp, struct vnode *vp, @@ -924,7 +924,7 @@ int fifo_printinfo(struct vnode *); /* vfs_hash.c */ typedef int vfs_hash_cmp_t(struct vnode *vp, void *arg); -void vfs_hash_changesize(int newhashsize); +void vfs_hash_changesize(u_long newhashsize); int vfs_hash_get(const struct mount *mp, u_int hash, int flags, struct thread *td, struct vnode **vpp, vfs_hash_cmp_t *fn, void *arg); u_int vfs_hash_index(struct vnode *vp);