diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2020-01-20 23:21:58 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2020-01-20 23:21:58 +0000 |
commit | 72bbc166dfdddaa40aaa7591458bdbeafd8256f2 (patch) | |
tree | 6ebef5167051e75989a6aab75ad8825ff84e7054 /sys | |
parent | 69afc17e65e0a80c075a1bfb4a1f84f5614383e4 (diff) |
struct vops is not modified during runtime so use const which moves each
into read-only data segment.
OK deraadt@ tedu@
Diffstat (limited to 'sys')
30 files changed, 78 insertions, 78 deletions
diff --git a/sys/isofs/cd9660/cd9660_extern.h b/sys/isofs/cd9660/cd9660_extern.h index 8c4bebfa8dd..2a5348e1768 100644 --- a/sys/isofs/cd9660/cd9660_extern.h +++ b/sys/isofs/cd9660/cd9660_extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cd9660_extern.h,v 1.14 2018/02/10 05:24:23 deraadt Exp $ */ +/* $OpenBSD: cd9660_extern.h,v 1.15 2020/01/20 23:21:55 claudio Exp $ */ /* $NetBSD: cd9660_extern.h,v 1.1 1997/01/24 00:24:53 cgd Exp $ */ /*- @@ -99,10 +99,10 @@ int cd9660_check_export(struct mount *, struct mbuf *, int *, int cd9660_mountroot(void); -extern struct vops cd9660_vops; -extern struct vops cd9660_specvops; +extern const struct vops cd9660_vops; +extern const struct vops cd9660_specvops; #ifdef FIFO -extern struct vops cd9660_fifovops; +extern const struct vops cd9660_fifovops; #endif int isochar(const u_char *, const u_char *, int, u_char *); diff --git a/sys/isofs/cd9660/cd9660_vnops.c b/sys/isofs/cd9660/cd9660_vnops.c index 7860c71032d..98498bcd79b 100644 --- a/sys/isofs/cd9660/cd9660_vnops.c +++ b/sys/isofs/cd9660/cd9660_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cd9660_vnops.c,v 1.80 2019/12/31 13:48:32 visa Exp $ */ +/* $OpenBSD: cd9660_vnops.c,v 1.81 2020/01/20 23:21:55 claudio Exp $ */ /* $NetBSD: cd9660_vnops.c,v 1.42 1997/10/16 23:56:57 christos Exp $ */ /*- @@ -832,7 +832,7 @@ cd9660_pathconf(void *v) #define cd9660_revoke vop_generic_revoke /* Global vfs data structures for cd9660. */ -struct vops cd9660_vops = { +const struct vops cd9660_vops = { .vop_lookup = cd9660_lookup, .vop_create = cd9660_create, .vop_mknod = cd9660_mknod, @@ -871,7 +871,7 @@ struct vops cd9660_vops = { }; /* Special device vnode ops */ -struct vops cd9660_specvops = { +const struct vops cd9660_specvops = { .vop_access = cd9660_access, .vop_getattr = cd9660_getattr, .vop_setattr = cd9660_setattr, @@ -912,7 +912,7 @@ struct vops cd9660_specvops = { }; #ifdef FIFO -struct vops cd9660_fifovops = { +const struct vops cd9660_fifovops = { .vop_access = cd9660_access, .vop_getattr = cd9660_getattr, .vop_setattr = cd9660_setattr, diff --git a/sys/isofs/udf/udf_extern.h b/sys/isofs/udf/udf_extern.h index c48782c820c..fb5166d14d6 100644 --- a/sys/isofs/udf/udf_extern.h +++ b/sys/isofs/udf/udf_extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: udf_extern.h,v 1.14 2018/02/10 05:24:23 deraadt Exp $ */ +/* $OpenBSD: udf_extern.h,v 1.15 2020/01/20 23:21:55 claudio Exp $ */ /* * Written by Pedro Martelletto <pedro@ambientworks.net> in February 2005. @@ -65,6 +65,6 @@ extern struct pool unode_pool; extern struct pool udf_ds_pool; /* Set of UDF vnode operations.*/ -extern struct vops udf_vops; +extern const struct vops udf_vops; #endif /* _KERNEL */ diff --git a/sys/isofs/udf/udf_vnops.c b/sys/isofs/udf/udf_vnops.c index d4ffea8a196..181fb621933 100644 --- a/sys/isofs/udf/udf_vnops.c +++ b/sys/isofs/udf/udf_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udf_vnops.c,v 1.67 2018/05/27 06:02:14 visa Exp $ */ +/* $OpenBSD: udf_vnops.c,v 1.68 2020/01/20 23:21:55 claudio Exp $ */ /* * Copyright (c) 2001, 2002 Scott Long <scottl@freebsd.org> @@ -58,7 +58,7 @@ int udf_bmap_internal(struct unode *, off_t, daddr_t *, uint32_t *); -struct vops udf_vops = { +const struct vops udf_vops = { .vop_access = udf_access, .vop_bmap = udf_bmap, .vop_lookup = udf_lookup, diff --git a/sys/kern/spec_vnops.c b/sys/kern/spec_vnops.c index 66529da7096..887a7acb641 100644 --- a/sys/kern/spec_vnops.c +++ b/sys/kern/spec_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spec_vnops.c,v 1.99 2019/12/27 22:17:01 bluhm Exp $ */ +/* $OpenBSD: spec_vnops.c,v 1.100 2020/01/20 23:21:55 claudio Exp $ */ /* $NetBSD: spec_vnops.c,v 1.29 1996/04/22 01:42:38 christos Exp $ */ /* @@ -62,7 +62,7 @@ int spec_open_clone(struct vop_open_args *); struct vnodechain speclisth[SPECHSZ]; -struct vops spec_vops = { +const struct vops spec_vops = { .vop_lookup = vop_generic_lookup, .vop_create = spec_badop, .vop_mknod = spec_badop, diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index f90d4659e89..0ddb7585e95 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_subr.c,v 1.298 2020/01/10 10:33:34 bluhm Exp $ */ +/* $OpenBSD: vfs_subr.c,v 1.299 2020/01/20 23:21:55 claudio Exp $ */ /* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */ /* @@ -365,7 +365,7 @@ long numvnodes; * Return the next vnode from the free list. */ int -getnewvnode(enum vtagtype tag, struct mount *mp, struct vops *vops, +getnewvnode(enum vtagtype tag, struct mount *mp, const struct vops *vops, struct vnode **vpp) { struct proc *p = curproc; diff --git a/sys/kern/vfs_sync.c b/sys/kern/vfs_sync.c index d871f111836..9a9231a3eee 100644 --- a/sys/kern/vfs_sync.c +++ b/sys/kern/vfs_sync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_sync.c,v 1.62 2020/01/16 16:35:04 mpi Exp $ */ +/* $OpenBSD: vfs_sync.c,v 1.63 2020/01/20 23:21:56 claudio Exp $ */ /* * Portions of this code are: @@ -256,7 +256,7 @@ int sync_fsync(void *); int sync_inactive(void *); int sync_print(void *); -struct vops sync_vops = { +const struct vops sync_vops = { .vop_close = nullop, .vop_fsync = sync_fsync, .vop_inactive = sync_inactive, diff --git a/sys/miscfs/deadfs/dead_vnops.c b/sys/miscfs/deadfs/dead_vnops.c index 6abb2eb638d..606960c726d 100644 --- a/sys/miscfs/deadfs/dead_vnops.c +++ b/sys/miscfs/deadfs/dead_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dead_vnops.c,v 1.31 2019/12/05 10:41:08 mpi Exp $ */ +/* $OpenBSD: dead_vnops.c,v 1.32 2020/01/20 23:21:56 claudio Exp $ */ /* $NetBSD: dead_vnops.c,v 1.16 1996/02/13 13:12:48 mycroft Exp $ */ /* @@ -60,7 +60,7 @@ int dead_print(void *); int chkvnlock(struct vnode *); -struct vops dead_vops = { +const struct vops dead_vops = { .vop_lookup = vop_generic_lookup, .vop_create = dead_badop, .vop_mknod = dead_badop, diff --git a/sys/miscfs/fifofs/fifo_vnops.c b/sys/miscfs/fifofs/fifo_vnops.c index 83b2c891178..ce61ed10671 100644 --- a/sys/miscfs/fifofs/fifo_vnops.c +++ b/sys/miscfs/fifofs/fifo_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fifo_vnops.c,v 1.71 2020/01/08 15:03:10 mpi Exp $ */ +/* $OpenBSD: fifo_vnops.c,v 1.72 2020/01/20 23:21:56 claudio Exp $ */ /* $NetBSD: fifo_vnops.c,v 1.18 1996/03/16 23:52:42 christos Exp $ */ /* @@ -64,7 +64,7 @@ struct fifoinfo { long fi_writers; }; -struct vops fifo_vops = { +const struct vops fifo_vops = { .vop_lookup = vop_generic_lookup, .vop_create = fifo_badop, .vop_mknod = fifo_badop, diff --git a/sys/miscfs/fuse/fuse_vnops.c b/sys/miscfs/fuse/fuse_vnops.c index d96daac441f..cb0568bc0a5 100644 --- a/sys/miscfs/fuse/fuse_vnops.c +++ b/sys/miscfs/fuse/fuse_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fuse_vnops.c,v 1.56 2019/12/31 13:48:32 visa Exp $ */ +/* $OpenBSD: fuse_vnops.c,v 1.57 2020/01/20 23:21:56 claudio Exp $ */ /* * Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com> * @@ -74,7 +74,7 @@ int filt_fusefswrite(struct knote *, long); int filt_fusefsvnode(struct knote *, long); void filt_fusefsdetach(struct knote *); -struct vops fusefs_vops = { +const struct vops fusefs_vops = { .vop_lookup = fusefs_lookup, .vop_create = fusefs_create, .vop_mknod = fusefs_mknod, diff --git a/sys/miscfs/fuse/fusefs.h b/sys/miscfs/fuse/fusefs.h index 237ef0578f2..424291c684a 100644 --- a/sys/miscfs/fuse/fusefs.h +++ b/sys/miscfs/fuse/fusefs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: fusefs.h,v 1.13 2018/07/16 13:10:53 helg Exp $ */ +/* $OpenBSD: fusefs.h,v 1.14 2020/01/20 23:21:56 claudio Exp $ */ /* * Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com> * @@ -70,7 +70,7 @@ struct fusefs_mnt { #define UNDEF_FLUSH 1<<11 #define UNDEF_FSYNC 1<<12 -extern struct vops fusefs_vops; +extern const struct vops fusefs_vops; extern struct pool fusefs_fbuf_pool; /* files helpers. */ diff --git a/sys/msdosfs/msdosfs_denode.c b/sys/msdosfs/msdosfs_denode.c index 6bd4ecf4fc6..fff83726424 100644 --- a/sys/msdosfs/msdosfs_denode.c +++ b/sys/msdosfs/msdosfs_denode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msdosfs_denode.c,v 1.64 2019/07/25 01:43:21 cheloha Exp $ */ +/* $OpenBSD: msdosfs_denode.c,v 1.65 2020/01/20 23:21:56 claudio Exp $ */ /* $NetBSD: msdosfs_denode.c,v 1.23 1997/10/17 11:23:58 ws Exp $ */ /*- @@ -183,7 +183,7 @@ deget(struct msdosfsmount *pmp, uint32_t dirclust, uint32_t diroffset, struct denode **depp) { int error; - extern struct vops msdosfs_vops; + extern const struct vops msdosfs_vops; struct direntry *direntptr; struct denode *ldep; struct vnode *nvp; diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c index 1a308023410..56ac3c6ddc4 100644 --- a/sys/msdosfs/msdosfs_vnops.c +++ b/sys/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msdosfs_vnops.c,v 1.127 2019/12/31 13:48:32 visa Exp $ */ +/* $OpenBSD: msdosfs_vnops.c,v 1.128 2020/01/20 23:21:56 claudio Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.63 1997/10/17 11:24:19 ws Exp $ */ /*- @@ -1921,7 +1921,7 @@ fileidhash(uint64_t fileid) } /* Global vfs data structures for msdosfs */ -struct vops msdosfs_vops = { +const struct vops msdosfs_vops = { .vop_lookup = msdosfs_lookup, .vop_create = msdosfs_create, .vop_mknod = msdosfs_mknod, diff --git a/sys/nfs/nfs_node.c b/sys/nfs/nfs_node.c index 155426e3666..81b900e83d2 100644 --- a/sys/nfs/nfs_node.c +++ b/sys/nfs/nfs_node.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_node.c,v 1.70 2018/05/27 06:02:15 visa Exp $ */ +/* $OpenBSD: nfs_node.c,v 1.71 2020/01/20 23:21:56 claudio Exp $ */ /* $NetBSD: nfs_node.c,v 1.16 1996/02/18 11:53:42 fvdl Exp $ */ /* @@ -59,7 +59,7 @@ struct pool nfs_node_pool; extern int prtactive; /* XXX */ -extern struct vops nfs_vops; +extern const struct vops nfs_vops; /* filehandle to node lookup. */ static __inline int diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c index a8feda1905c..1ed9932b703 100644 --- a/sys/nfs/nfs_subs.c +++ b/sys/nfs/nfs_subs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_subs.c,v 1.142 2020/01/14 21:38:02 bluhm Exp $ */ +/* $OpenBSD: nfs_subs.c,v 1.143 2020/01/20 23:21:56 claudio Exp $ */ /* $NetBSD: nfs_subs.c,v 1.27.4.3 1996/07/08 20:34:24 jtc Exp $ */ /* @@ -937,7 +937,7 @@ nfs_loadattrcache(struct vnode **vpp, struct mbuf **mdp, caddr_t *dposp, struct vnode *vp = *vpp; struct vattr *vap; struct nfs_fattr *fp; - extern struct vops nfs_specvops; + extern const struct vops nfs_specvops; struct nfsnode *np; int32_t t1; caddr_t cp2; @@ -994,7 +994,7 @@ nfs_loadattrcache(struct vnode **vpp, struct mbuf **mdp, caddr_t *dposp, #ifndef FIFO return (EOPNOTSUPP); #else - extern struct vops nfs_fifovops; + extern const struct vops nfs_fifovops; vp->v_op = &nfs_fifovops; #endif /* FIFO */ } diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c index 35bef8a1bba..5d78232ac57 100644 --- a/sys/nfs/nfs_vnops.c +++ b/sys/nfs/nfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_vnops.c,v 1.181 2019/07/19 00:54:59 cheloha Exp $ */ +/* $OpenBSD: nfs_vnops.c,v 1.182 2020/01/20 23:21:56 claudio Exp $ */ /* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */ /* @@ -137,7 +137,7 @@ int nfsspec_read(void *); int nfsspec_write(void *); /* Global vfs data structures for nfs. */ -struct vops nfs_vops = { +const struct vops nfs_vops = { .vop_lookup = nfs_lookup, .vop_create = nfs_create, .vop_mknod = nfs_mknod, @@ -176,7 +176,7 @@ struct vops nfs_vops = { }; /* Special device vnode ops. */ -struct vops nfs_specvops = { +const struct vops nfs_specvops = { .vop_close = nfsspec_close, .vop_access = nfsspec_access, .vop_getattr = nfs_getattr, @@ -217,7 +217,7 @@ struct vops nfs_specvops = { }; #ifdef FIFO -struct vops nfs_fifovops = { +const struct vops nfs_fifovops = { .vop_close = nfsfifo_close, .vop_access = nfsspec_access, .vop_getattr = nfs_getattr, diff --git a/sys/ntfs/ntfs.h b/sys/ntfs/ntfs.h index 0e30899d3a4..fff94a32a71 100644 --- a/sys/ntfs/ntfs.h +++ b/sys/ntfs/ntfs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ntfs.h,v 1.17 2013/11/24 16:02:30 jsing Exp $ */ +/* $OpenBSD: ntfs.h,v 1.18 2020/01/20 23:21:56 claudio Exp $ */ /* $NetBSD: ntfs.h,v 1.5 2003/04/24 07:50:19 christos Exp $ */ /*- @@ -311,5 +311,5 @@ extern int ntfs_debug; #define DDPRINTF(x...) #endif -extern struct vops ntfs_vops; +extern const struct vops ntfs_vops; #endif diff --git a/sys/ntfs/ntfs_vnops.c b/sys/ntfs/ntfs_vnops.c index 2510c6d1421..dd83aea37e0 100644 --- a/sys/ntfs/ntfs_vnops.c +++ b/sys/ntfs/ntfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntfs_vnops.c,v 1.44 2018/05/02 02:24:56 visa Exp $ */ +/* $OpenBSD: ntfs_vnops.c,v 1.45 2020/01/20 23:21:56 claudio Exp $ */ /* $NetBSD: ntfs_vnops.c,v 1.6 2003/04/10 21:57:26 jdolecek Exp $ */ /* @@ -664,7 +664,7 @@ ntfs_pathconf(void *v) /* * Global vfs data structures */ -struct vops ntfs_vops = { +const struct vops ntfs_vops = { .vop_getattr = ntfs_getattr, .vop_inactive = ntfs_inactive, .vop_reclaim = ntfs_reclaim, diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 85d654f27cb..b6a53c20436 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vnode.h,v 1.154 2020/01/10 10:33:35 bluhm Exp $ */ +/* $OpenBSD: vnode.h,v 1.155 2020/01/20 23:21:56 claudio Exp $ */ /* $NetBSD: vnode.h,v 1.38 1996/02/29 20:59:05 cgd Exp $ */ /* @@ -88,7 +88,7 @@ RBT_HEAD(namecache_rb_cache, namecache); struct uvm_vnode; struct vnode { struct uvm_vnode *v_uvm; /* uvm data */ - struct vops *v_op; /* vnode operations vector */ + const struct vops *v_op; /* vnode operations vector */ enum vtype v_type; /* vnode type */ enum vtagtype v_tag; /* type of underlying data */ u_int v_flag; /* vnode flags (see below) */ @@ -297,8 +297,8 @@ struct vops { int (*vop_kqfilter)(void *); }; -extern struct vops dead_vops; -extern struct vops spec_vops; +extern const struct vops dead_vops; +extern const struct vops spec_vops; struct vop_generic_args { void *a_garbage; @@ -585,7 +585,7 @@ struct vnode; int bdevvp(dev_t, struct vnode **); int cdevvp(dev_t, struct vnode **); struct vnode *checkalias(struct vnode *, dev_t, struct mount *); -int getnewvnode(enum vtagtype, struct mount *, struct vops *, +int getnewvnode(enum vtagtype, struct mount *, const struct vops *, struct vnode **); int vaccess(enum vtype, mode_t, uid_t, gid_t, mode_t, struct ucred *); int vnoperm(struct vnode *); diff --git a/sys/tmpfs/tmpfs_fifoops.c b/sys/tmpfs/tmpfs_fifoops.c index 269a7261541..0fa47f587e6 100644 --- a/sys/tmpfs/tmpfs_fifoops.c +++ b/sys/tmpfs/tmpfs_fifoops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tmpfs_fifoops.c,v 1.4 2015/01/21 22:26:52 deraadt Exp $ */ +/* $OpenBSD: tmpfs_fifoops.c,v 1.5 2020/01/20 23:21:56 claudio Exp $ */ /* $NetBSD: tmpfs_fifoops.c,v 1.9 2011/05/24 20:17:49 rmind Exp $ */ /* @@ -52,7 +52,7 @@ int tmpfs_fifo_fsync (void *); * vnode operations vector used for fifos stored in a tmpfs file system. */ -struct vops tmpfs_fifovops = { +const struct vops tmpfs_fifovops = { .vop_lookup = vop_generic_lookup, .vop_create = fifo_badop, .vop_mknod = fifo_badop, diff --git a/sys/tmpfs/tmpfs_specops.c b/sys/tmpfs/tmpfs_specops.c index 5fe2c85aa2b..eef2d33d044 100644 --- a/sys/tmpfs/tmpfs_specops.c +++ b/sys/tmpfs/tmpfs_specops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tmpfs_specops.c,v 1.5 2015/01/21 22:26:52 deraadt Exp $ */ +/* $OpenBSD: tmpfs_specops.c,v 1.6 2020/01/20 23:21:56 claudio Exp $ */ /* $NetBSD: tmpfs_specops.c,v 1.10 2011/05/24 20:17:49 rmind Exp $ */ /* @@ -51,7 +51,7 @@ int tmpfs_spec_write (void *); * file system. */ -struct vops tmpfs_specvops = { +const struct vops tmpfs_specvops = { .vop_close = spec_close, .vop_access = tmpfs_access, .vop_getattr = tmpfs_getattr, diff --git a/sys/tmpfs/tmpfs_vnops.c b/sys/tmpfs/tmpfs_vnops.c index ba3963a14ea..cdd43a51313 100644 --- a/sys/tmpfs/tmpfs_vnops.c +++ b/sys/tmpfs/tmpfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tmpfs_vnops.c,v 1.37 2019/12/31 13:48:32 visa Exp $ */ +/* $OpenBSD: tmpfs_vnops.c,v 1.38 2020/01/20 23:21:56 claudio Exp $ */ /* $NetBSD: tmpfs_vnops.c,v 1.100 2012/11/05 17:27:39 dholland Exp $ */ /* @@ -57,7 +57,7 @@ int tmpfs_kqfilter(void *v); /* * vnode operations vector used for files stored in a tmpfs file system. */ -struct vops tmpfs_vops = { +const struct vops tmpfs_vops = { .vop_lookup = tmpfs_lookup, .vop_create = tmpfs_create, .vop_mknod = tmpfs_mknod, diff --git a/sys/tmpfs/tmpfs_vnops.h b/sys/tmpfs/tmpfs_vnops.h index 0048b13b151..9ef283d4da4 100644 --- a/sys/tmpfs/tmpfs_vnops.h +++ b/sys/tmpfs/tmpfs_vnops.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmpfs_vnops.h,v 1.5 2013/12/25 14:04:50 espie Exp $ */ +/* $OpenBSD: tmpfs_vnops.h,v 1.6 2020/01/20 23:21:56 claudio Exp $ */ /* $NetBSD: tmpfs_vnops.h,v 1.13 2011/05/24 20:17:49 rmind Exp $ */ /* @@ -42,7 +42,7 @@ * Declarations for tmpfs_vnops.c. */ -extern struct vops tmpfs_vops, tmpfs_fifovops, tmpfs_specvops; +extern const struct vops tmpfs_vops, tmpfs_fifovops, tmpfs_specvops; int tmpfs_lookup (void *); int tmpfs_create (void *); diff --git a/sys/ufs/ext2fs/ext2fs_extern.h b/sys/ufs/ext2fs/ext2fs_extern.h index 68c71ca1e9e..ca4003a4f40 100644 --- a/sys/ufs/ext2fs/ext2fs_extern.h +++ b/sys/ufs/ext2fs/ext2fs_extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_extern.h,v 1.37 2018/02/10 05:24:23 deraadt Exp $ */ +/* $OpenBSD: ext2fs_extern.h,v 1.38 2020/01/20 23:21:56 claudio Exp $ */ /* $NetBSD: ext2fs_extern.h,v 1.1 1997/06/11 09:33:55 bouyer Exp $ */ /*- @@ -144,8 +144,8 @@ __END_DECLS #define IS_EXT2_VNODE(vp) (vp->v_tag == VT_EXT2FS) -extern struct vops ext2fs_vops; -extern struct vops ext2fs_specvops; +extern const struct vops ext2fs_vops; +extern const struct vops ext2fs_specvops; #ifdef FIFO -extern struct vops ext2fs_fifovops; +extern const struct vops ext2fs_fifovops; #endif diff --git a/sys/ufs/ext2fs/ext2fs_vnops.c b/sys/ufs/ext2fs/ext2fs_vnops.c index f91f6a792b2..273a59d0ffb 100644 --- a/sys/ufs/ext2fs/ext2fs_vnops.c +++ b/sys/ufs/ext2fs/ext2fs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_vnops.c,v 1.85 2018/09/06 11:50:54 jsg Exp $ */ +/* $OpenBSD: ext2fs_vnops.c,v 1.86 2020/01/20 23:21:56 claudio Exp $ */ /* $NetBSD: ext2fs_vnops.c,v 1.1 1997/06/11 09:34:09 bouyer Exp $ */ /* @@ -1267,7 +1267,7 @@ ext2fs_reclaim(void *v) } /* Global vfs data structures for ext2fs. */ -struct vops ext2fs_vops = { +const struct vops ext2fs_vops = { .vop_lookup = ext2fs_lookup, .vop_create = ext2fs_create, .vop_mknod = ext2fs_mknod, @@ -1304,7 +1304,7 @@ struct vops ext2fs_vops = { .vop_bwrite = vop_generic_bwrite }; -struct vops ext2fs_specvops = { +const struct vops ext2fs_specvops = { .vop_close = ufsspec_close, .vop_access = ext2fs_access, .vop_getattr = ext2fs_getattr, @@ -1345,7 +1345,7 @@ struct vops ext2fs_specvops = { }; #ifdef FIFO -struct vops ext2fs_fifovops = { +const struct vops ext2fs_fifovops = { .vop_close = ufsfifo_close, .vop_access = ufsfifo_close, .vop_getattr = ext2fs_getattr, diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index 0abe9d73b59..921f905c1fc 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.44 2018/02/10 05:24:23 deraadt Exp $ */ +/* $OpenBSD: ffs_extern.h,v 1.45 2020/01/20 23:21:56 claudio Exp $ */ /* $NetBSD: ffs_extern.h,v 1.4 1996/02/09 22:22:22 christos Exp $ */ /* @@ -94,9 +94,9 @@ struct mbuf; struct cg; struct vop_vfree_args; -extern struct vops ffs_vops; -extern struct vops ffs_specvops; -extern struct vops ffs_fifovops; +extern const struct vops ffs_vops; +extern const struct vops ffs_specvops; +extern const struct vops ffs_fifovops; /* ffs_alloc.c */ int ffs_alloc(struct inode *, daddr_t, daddr_t , int, struct ucred *, diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index bddcc2aeb9b..58199bf6b36 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_vnops.c,v 1.95 2019/11/27 16:12:13 beck Exp $ */ +/* $OpenBSD: ffs_vnops.c,v 1.96 2020/01/20 23:21:56 claudio Exp $ */ /* $NetBSD: ffs_vnops.c,v 1.7 1996/05/11 18:27:24 mycroft Exp $ */ /* @@ -57,7 +57,7 @@ #include <ufs/ffs/fs.h> #include <ufs/ffs/ffs_extern.h> -struct vops ffs_vops = { +const struct vops ffs_vops = { .vop_lookup = ufs_lookup, .vop_create = ufs_create, .vop_mknod = ufs_mknod, @@ -95,7 +95,7 @@ struct vops ffs_vops = { .vop_bwrite = vop_generic_bwrite }; -struct vops ffs_specvops = { +const struct vops ffs_specvops = { .vop_close = ufsspec_close, .vop_access = ufs_access, .vop_getattr = ufs_getattr, @@ -136,7 +136,7 @@ struct vops ffs_specvops = { }; #ifdef FIFO -struct vops ffs_fifovops = { +const struct vops ffs_fifovops = { .vop_close = ufsfifo_close, .vop_access = ufs_access, .vop_getattr = ufs_getattr, diff --git a/sys/ufs/mfs/mfs_extern.h b/sys/ufs/mfs/mfs_extern.h index 67b2b4dae61..a662a6787ef 100644 --- a/sys/ufs/mfs/mfs_extern.h +++ b/sys/ufs/mfs/mfs_extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mfs_extern.h,v 1.19 2016/04/26 18:37:03 natano Exp $ */ +/* $OpenBSD: mfs_extern.h,v 1.20 2020/01/20 23:21:57 claudio Exp $ */ /* $NetBSD: mfs_extern.h,v 1.4 1996/02/09 22:31:27 christos Exp $ */ /*- @@ -43,7 +43,7 @@ struct vfsconf; struct mbuf; struct mfsnode; -extern struct vops mfs_vops; +extern const struct vops mfs_vops; /* mfs_vfsops.c */ int mfs_mount(struct mount *, const char *, void *, struct nameidata *, diff --git a/sys/ufs/mfs/mfs_vnops.c b/sys/ufs/mfs/mfs_vnops.c index 20bb440da99..f085f1874ca 100644 --- a/sys/ufs/mfs/mfs_vnops.c +++ b/sys/ufs/mfs/mfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mfs_vnops.c,v 1.52 2019/07/25 01:43:21 cheloha Exp $ */ +/* $OpenBSD: mfs_vnops.c,v 1.53 2020/01/20 23:21:57 claudio Exp $ */ /* $NetBSD: mfs_vnops.c,v 1.8 1996/03/17 02:16:32 christos Exp $ */ /* @@ -47,7 +47,7 @@ #include <ufs/mfs/mfs_extern.h> /* mfs vnode operations. */ -struct vops mfs_vops = { +const struct vops mfs_vops = { .vop_lookup = mfs_badop, .vop_create = mfs_badop, .vop_mknod = mfs_badop, diff --git a/sys/uvm/uvm_swap.c b/sys/uvm/uvm_swap.c index d4ffa60678e..52b4dd04ccf 100644 --- a/sys/uvm/uvm_swap.c +++ b/sys/uvm/uvm_swap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_swap.c,v 1.145 2019/12/05 12:46:54 mpi Exp $ */ +/* $OpenBSD: uvm_swap.c,v 1.146 2020/01/20 23:21:57 claudio Exp $ */ /* $NetBSD: uvm_swap.c,v 1.40 2000/11/17 11:39:39 mrg Exp $ */ /* @@ -820,7 +820,7 @@ swap_on(struct proc *p, struct swapdev *sdp) long addr; struct vattr va; #if defined(NFSCLIENT) - extern struct vops nfs_vops; + extern const struct vops nfs_vops; #endif /* defined(NFSCLIENT) */ dev_t dev; |