diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2016-08-23 23:28:03 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2016-08-23 23:28:03 +0000 |
commit | 23e5637fa89f1ae07867fbee688d160f216345f7 (patch) | |
tree | ca48df75a9c899e274a625d864856865cd60863f /sys | |
parent | c7e1b3fc5e7b86fdf30fdf831d79d9eaa000908f (diff) |
rename nfiles to numfiles to avoid shadowing and stretch out the name.
ok deraadt
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_descrip.c | 10 | ||||
-rw-r--r-- | sys/kern/kern_sysctl.c | 4 | ||||
-rw-r--r-- | sys/sys/file.h | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 6899e6d691d..12b12618026 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_descrip.c,v 1.132 2016/05/29 13:51:53 natano Exp $ */ +/* $OpenBSD: kern_descrip.c,v 1.133 2016/08/23 23:28:02 tedu Exp $ */ /* $NetBSD: kern_descrip.c,v 1.42 1996/03/30 22:24:38 christos Exp $ */ /* @@ -68,7 +68,7 @@ * Descriptor management. */ struct filelist filehead; /* head of list of open files */ -int nfiles; /* actual number of open files */ +int numfiles; /* actual number of open files */ static __inline void fd_used(struct filedesc *, int); static __inline void fd_unused(struct filedesc *, int); @@ -901,7 +901,7 @@ restart: } return (error); } - if (nfiles >= maxfiles) { + if (numfiles >= maxfiles) { fd_unused(p->p_fd, i); tablefull("file"); return (ENFILE); @@ -912,7 +912,7 @@ restart: * of open files at that point, otherwise put it at the front of * the list of open files. */ - nfiles++; + numfiles++; fp = pool_get(&file_pool, PR_WAITOK|PR_ZERO); fp->f_iflags = FIF_LARVAL; if ((fq = p->p_fd->fd_ofiles[0]) != NULL) { @@ -1165,7 +1165,7 @@ fdrop(struct file *fp, struct proc *p) /* Free fp */ LIST_REMOVE(fp, f_list); crfree(fp->f_cred); - nfiles--; + numfiles--; pool_put(&file_pool, fp); return (error); diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index d78d6d76de6..68e1f38e09a 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.306 2016/07/14 15:39:40 deraadt Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.307 2016/08/23 23:28:02 tedu Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -325,7 +325,7 @@ kern_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, case KERN_MAXFILES: return (sysctl_int(oldp, oldlenp, newp, newlen, &maxfiles)); case KERN_NFILES: - return (sysctl_rdint(oldp, oldlenp, newp, nfiles)); + return (sysctl_rdint(oldp, oldlenp, newp, numfiles)); case KERN_TTYCOUNT: return (sysctl_rdint(oldp, oldlenp, newp, tty_count)); case KERN_NUMVNODES: diff --git a/sys/sys/file.h b/sys/sys/file.h index 18607edaf24..fef8dd0af67 100644 --- a/sys/sys/file.h +++ b/sys/sys/file.h @@ -1,4 +1,4 @@ -/* $OpenBSD: file.h,v 1.37 2016/04/26 09:13:05 deraadt Exp $ */ +/* $OpenBSD: file.h,v 1.38 2016/08/23 23:28:02 tedu Exp $ */ /* $NetBSD: file.h,v 1.11 1995/03/26 20:24:13 jtc Exp $ */ /* @@ -101,7 +101,7 @@ int fdrop(struct file *, struct proc *); LIST_HEAD(filelist, file); extern struct filelist filehead; /* head of list of open files */ extern int maxfiles; /* kernel limit on number of open files */ -extern int nfiles; /* actual number of open files */ +extern int numfiles; /* actual number of open files */ extern struct fileops vnops; /* vnode operations for files */ #endif /* _KERNEL */ |