From: gnezdo Date: Sat, 1 May 2021 16:18:28 +0000 (+0000) Subject: Update the remaining SYSCTL_INT_READONLY cases X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9c14f6a5c90024cf18256cc3f89b99802c4bf777;p=openbsd Update the remaining SYSCTL_INT_READONLY cases OK mvs@ --- diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index 40f68fde765..a8edb52bde0 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.273 2021/03/11 11:16:55 jsg Exp $ */ +/* $OpenBSD: machdep.c,v 1.274 2021/05/01 16:18:28 gnezdo Exp $ */ /* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */ /*- @@ -475,10 +475,10 @@ extern int amd64_has_xcrypt; const struct sysctl_bounded_args cpuctl_vars[] = { { CPU_LIDACTION, &lid_action, 0, 2 }, { CPU_PWRACTION, &pwr_action, 0, 2 }, - { CPU_CPUID, &cpu_id, 1, 0 }, - { CPU_CPUFEATURE, &cpu_feature, 1, 0 }, - { CPU_XCRYPT, &amd64_has_xcrypt, 1, 0 }, - { CPU_INVARIANTTSC, &tsc_is_invariant, 1, 0 }, + { CPU_CPUID, &cpu_id, SYSCTL_INT_READONLY }, + { CPU_CPUFEATURE, &cpu_feature, SYSCTL_INT_READONLY }, + { CPU_XCRYPT, &amd64_has_xcrypt, SYSCTL_INT_READONLY }, + { CPU_INVARIANTTSC, &tsc_is_invariant, SYSCTL_INT_READONLY }, }; /* diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index 87c5a0ed6a6..5180762983d 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.644 2021/01/09 21:01:20 gnezdo Exp $ */ +/* $OpenBSD: machdep.c,v 1.645 2021/05/01 16:18:28 gnezdo Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -3560,11 +3560,11 @@ idt_vec_free(int vec) const struct sysctl_bounded_args cpuctl_vars[] = { { CPU_LIDACTION, &lid_action, 0, 2 }, - { CPU_CPUID, &cpu_id, 1, 0 }, - { CPU_OSFXSR, &i386_use_fxsave, 1, 0 }, - { CPU_SSE, &i386_has_sse, 1, 0 }, - { CPU_SSE2, &i386_has_sse2, 1, 0 }, - { CPU_XCRYPT, &i386_has_xcrypt, 1, 0 }, + { CPU_CPUID, &cpu_id, SYSCTL_INT_READONLY }, + { CPU_OSFXSR, &i386_use_fxsave, SYSCTL_INT_READONLY }, + { CPU_SSE, &i386_has_sse, SYSCTL_INT_READONLY }, + { CPU_SSE2, &i386_has_sse2, SYSCTL_INT_READONLY }, + { CPU_XCRYPT, &i386_has_xcrypt, SYSCTL_INT_READONLY }, }; /* diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 2a41db49833..c4cb0db1e43 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.391 2021/04/30 13:52:48 bluhm Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.392 2021/05/01 16:18:28 gnezdo Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -292,54 +292,54 @@ extern int uvm_wxabort; extern int global_ptrace; const struct sysctl_bounded_args kern_vars[] = { - {KERN_OSREV, &openbsd, 1, 0}, + {KERN_OSREV, &openbsd, SYSCTL_INT_READONLY}, {KERN_MAXVNODES, &maxvnodes, 0, INT_MAX}, {KERN_MAXPROC, &maxprocess, 0, INT_MAX}, {KERN_MAXFILES, &maxfiles, 0, INT_MAX}, - {KERN_NFILES, &numfiles, 1, 0}, - {KERN_TTYCOUNT, &tty_count, 1, 0}, - {KERN_ARGMAX, &arg_max, 1, 0}, - {KERN_NSELCOLL, &nselcoll, 1, 0}, - {KERN_POSIX1, &posix_version, 1, 0}, - {KERN_NGROUPS, &ngroups_max, 1, 0}, - {KERN_JOB_CONTROL, &int_one, 1, 0}, - {KERN_SAVED_IDS, &int_one, 1, 0}, - {KERN_MAXPARTITIONS, &maxpartitions, 1, 0}, - {KERN_RAWPARTITION, &raw_part, 1, 0}, + {KERN_NFILES, &numfiles, SYSCTL_INT_READONLY}, + {KERN_TTYCOUNT, &tty_count, SYSCTL_INT_READONLY}, + {KERN_ARGMAX, &arg_max, SYSCTL_INT_READONLY}, + {KERN_NSELCOLL, &nselcoll, SYSCTL_INT_READONLY}, + {KERN_POSIX1, &posix_version, SYSCTL_INT_READONLY}, + {KERN_NGROUPS, &ngroups_max, SYSCTL_INT_READONLY}, + {KERN_JOB_CONTROL, &int_one, SYSCTL_INT_READONLY}, + {KERN_SAVED_IDS, &int_one, SYSCTL_INT_READONLY}, + {KERN_MAXPARTITIONS, &maxpartitions, SYSCTL_INT_READONLY}, + {KERN_RAWPARTITION, &raw_part, SYSCTL_INT_READONLY}, {KERN_MAXTHREAD, &maxthread, 0, INT_MAX}, - {KERN_NTHREADS, &nthreads, 1, 0}, + {KERN_NTHREADS, &nthreads, SYSCTL_INT_READONLY}, {KERN_SOMAXCONN, &somaxconn, 0, SHRT_MAX}, {KERN_SOMINCONN, &sominconn, 0, SHRT_MAX}, {KERN_NOSUIDCOREDUMP, &nosuidcoredump, 0, 3}, - {KERN_FSYNC, &int_one, 1, 0}, + {KERN_FSYNC, &int_one, SYSCTL_INT_READONLY}, {KERN_SYSVMSG, #ifdef SYSVMSG &int_one, #else &int_zero, #endif - 1, 0}, + SYSCTL_INT_READONLY}, {KERN_SYSVSEM, #ifdef SYSVSEM &int_one, #else &int_zero, #endif - 1, 0}, + SYSCTL_INT_READONLY}, {KERN_SYSVSHM, #ifdef SYSVSHM &int_one, #else &int_zero, #endif - 1, 0}, - {KERN_FSCALE, &fscale, 1, 0}, - {KERN_CCPU, &ccpu, 1, 0}, - {KERN_NPROCS, &nprocesses, 1, 0}, + SYSCTL_INT_READONLY}, + {KERN_FSCALE, &fscale, SYSCTL_INT_READONLY}, + {KERN_CCPU, &ccpu, SYSCTL_INT_READONLY}, + {KERN_NPROCS, &nprocesses, SYSCTL_INT_READONLY}, {KERN_SPLASSERT, &splassert_ctl, 0, 3}, {KERN_MAXLOCKSPERUID, &maxlocksperuid, 0, INT_MAX}, {KERN_WXABORT, &uvm_wxabort, 0, 1}, - {KERN_NETLIVELOCKS, &int_zero, 1, 0}, + {KERN_NETLIVELOCKS, &int_zero, SYSCTL_INT_READONLY}, #ifdef PTRACE {KERN_GLOBAL_PTRACE, &global_ptrace, 0, 1}, #endif @@ -660,11 +660,11 @@ static int byte_order = BYTE_ORDER; static int page_size = PAGE_SIZE; const struct sysctl_bounded_args hw_vars[] = { - {HW_NCPU, &ncpus, 1, 0}, - {HW_NCPUFOUND, &ncpusfound, 1, 0}, - {HW_BYTEORDER, &byte_order, 1, 0}, - {HW_PAGESIZE, &page_size, 1, 0}, - {HW_DISKCOUNT, &disk_count, 1, 0}, + {HW_NCPU, &ncpus, SYSCTL_INT_READONLY}, + {HW_NCPUFOUND, &ncpusfound, SYSCTL_INT_READONLY}, + {HW_BYTEORDER, &byte_order, SYSCTL_INT_READONLY}, + {HW_PAGESIZE, &page_size, SYSCTL_INT_READONLY}, + {HW_DISKCOUNT, &disk_count, SYSCTL_INT_READONLY}, }; int diff --git a/sys/miscfs/fuse/fuse_vfsops.c b/sys/miscfs/fuse/fuse_vfsops.c index 3e2af8960af..5b30b1544aa 100644 --- a/sys/miscfs/fuse/fuse_vfsops.c +++ b/sys/miscfs/fuse/fuse_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fuse_vfsops.c,v 1.44 2020/11/17 03:23:10 gnezdo Exp $ */ +/* $OpenBSD: fuse_vfsops.c,v 1.45 2021/05/01 16:18:29 gnezdo Exp $ */ /* * Copyright (c) 2012-2013 Sylvestre Gallon * @@ -356,10 +356,10 @@ fusefs_init(struct vfsconf *vfc) extern int stat_fbufs_in, stat_fbufs_wait, stat_opened_fusedev; const struct sysctl_bounded_args fusefs_vars[] = { - { FUSEFS_OPENDEVS, &stat_opened_fusedev, 1, 0 }, - { FUSEFS_INFBUFS, &stat_fbufs_in, 1, 0 }, - { FUSEFS_WAITFBUFS, &stat_fbufs_wait, 1, 0 }, - { FUSEFS_POOL_NBPAGES, &fusefs_fbuf_pool.pr_npages, 1, 0 }, + { FUSEFS_OPENDEVS, &stat_opened_fusedev, SYSCTL_INT_READONLY }, + { FUSEFS_INFBUFS, &stat_fbufs_in, SYSCTL_INT_READONLY }, + { FUSEFS_WAITFBUFS, &stat_fbufs_wait, SYSCTL_INT_READONLY }, + { FUSEFS_POOL_NBPAGES, &fusefs_fbuf_pool.pr_npages, SYSCTL_INT_READONLY }, }; int diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index bd488ef4773..a7cc61b2b51 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.188 2020/11/07 05:24:20 gnezdo Exp $ */ +/* $OpenBSD: ffs_vfsops.c,v 1.189 2021/05/01 16:18:29 gnezdo Exp $ */ /* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */ /* @@ -1578,21 +1578,21 @@ const struct sysctl_bounded_args ffs_vars[] = { #ifdef FFS_SOFTUPDATES { FFS_MAX_SOFTDEPS, &max_softdeps, 0, INT_MAX }, { FFS_SD_TICKDELAY, &tickdelay, 2, INT_MAX }, - { FFS_SD_WORKLIST_PUSH, &stat_worklist_push, 1, 0 }, /* read-only */ - { FFS_SD_BLK_LIMIT_PUSH, &stat_blk_limit_push, 1, 0 }, - { FFS_SD_INO_LIMIT_PUSH, &stat_ino_limit_push, 1, 0 }, - { FFS_SD_BLK_LIMIT_HIT, &stat_blk_limit_hit, 1, 0 }, - { FFS_SD_INO_LIMIT_HIT, &stat_ino_limit_hit, 1, 0 }, - { FFS_SD_SYNC_LIMIT_HIT, &stat_sync_limit_hit, 1, 0 }, - { FFS_SD_INDIR_BLK_PTRS, &stat_indir_blk_ptrs, 1, 0 }, - { FFS_SD_INODE_BITMAP, &stat_inode_bitmap, 1, 0 }, - { FFS_SD_DIRECT_BLK_PTRS, &stat_direct_blk_ptrs, 1, 0 }, - { FFS_SD_DIR_ENTRY, &stat_dir_entry, 1, 0 }, + { FFS_SD_WORKLIST_PUSH, &stat_worklist_push, SYSCTL_INT_READONLY }, + { FFS_SD_BLK_LIMIT_PUSH, &stat_blk_limit_push, SYSCTL_INT_READONLY }, + { FFS_SD_INO_LIMIT_PUSH, &stat_ino_limit_push, SYSCTL_INT_READONLY }, + { FFS_SD_BLK_LIMIT_HIT, &stat_blk_limit_hit, SYSCTL_INT_READONLY }, + { FFS_SD_INO_LIMIT_HIT, &stat_ino_limit_hit, SYSCTL_INT_READONLY }, + { FFS_SD_SYNC_LIMIT_HIT, &stat_sync_limit_hit, SYSCTL_INT_READONLY }, + { FFS_SD_INDIR_BLK_PTRS, &stat_indir_blk_ptrs, SYSCTL_INT_READONLY }, + { FFS_SD_INODE_BITMAP, &stat_inode_bitmap, SYSCTL_INT_READONLY }, + { FFS_SD_DIRECT_BLK_PTRS, &stat_direct_blk_ptrs, SYSCTL_INT_READONLY }, + { FFS_SD_DIR_ENTRY, &stat_dir_entry, SYSCTL_INT_READONLY }, #endif #ifdef UFS_DIRHASH { FFS_DIRHASH_DIRSIZE, &ufs_mindirhashsize, 0, INT_MAX }, { FFS_DIRHASH_MAXMEM, &ufs_dirhashmaxmem, 0, INT_MAX }, - { FFS_DIRHASH_MEM, &ufs_dirhashmem, 1, 0 }, + { FFS_DIRHASH_MEM, &ufs_dirhashmem, SYSCTL_INT_READONLY }, #endif };