summaryrefslogtreecommitdiffstats
path: root/sys/fs/umapfs
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-12-01 23:16:38 +0000
committerphk <phk@FreeBSD.org>2004-12-01 23:16:38 +0000
commit59f305606cbc120b44978581149ef1a3e62bf3b4 (patch)
treef548d86b8998e8d581602fc54079bbb1534e7c18 /sys/fs/umapfs
parent350be3accf1712e54ae2732ca42ad409bbf20df7 (diff)
downloadFreeBSD-src-59f305606cbc120b44978581149ef1a3e62bf3b4.zip
FreeBSD-src-59f305606cbc120b44978581149ef1a3e62bf3b4.tar.gz
Back when VOP_* was introduced, we did not have new-style struct
initializations but we did have lofty goals and big ideals. Adjust to more contemporary circumstances and gain type checking. Replace the entire vop_t frobbing thing with properly typed structures. The only casualty is that we can not add a new VOP_ method with a loadable module. History has not given us reason to belive this would ever be feasible in the the first place. Eliminate in toto VOCALL(), vop_t, VNODEOP_SET() etc. Give coda correct prototypes and function definitions for all vop_()s. Generate a bit more data from the vnode_if.src file: a struct vop_vector and protype typedefs for all vop methods. Add a new vop_bypass() and make vop_default be a pointer to another struct vop_vector. Remove a lot of vfs_init since vop_vector is ready to use from the compiler. Cast various vop_mumble() to void * with uppercase name, for instance VOP_PANIC, VOP_NULL etc. Implement VCALL() by making vdesc_offset the offsetof() the relevant function pointer in vop_vector. This is disgusting but since the code is generated by a script comparatively safe. The alternative for nullfs etc. would be much worse. Fix up all vnode method vectors to remove casts so they become typesafe. (The bulk of this is generated by scripts)
Diffstat (limited to 'sys/fs/umapfs')
-rw-r--r--sys/fs/umapfs/umap.h1
-rw-r--r--sys/fs/umapfs/umap_vnops.c24
2 files changed, 9 insertions, 16 deletions
diff --git a/sys/fs/umapfs/umap.h b/sys/fs/umapfs/umap.h
index 10af870..4b74579 100644
--- a/sys/fs/umapfs/umap.h
+++ b/sys/fs/umapfs/umap.h
@@ -83,5 +83,4 @@ extern struct vnode *umap_checkvp(struct vnode *vp, char *fil, int lno);
#define UMAPVPTOLOWERVP(vp) (VTOUMAP(vp)->umap_lowervp)
#endif
-extern vop_t **umap_vnodeop_p;
#endif /* _KERNEL */
diff --git a/sys/fs/umapfs/umap_vnops.c b/sys/fs/umapfs/umap_vnops.c
index 1b56007..2aa4b9e 100644
--- a/sys/fs/umapfs/umap_vnops.c
+++ b/sys/fs/umapfs/umap_vnops.c
@@ -506,19 +506,13 @@ umap_rename(ap)
* go away with a merged buffer/block cache.
*
*/
-vop_t **umap_vnodeop_p;
-static struct vnodeopv_entry_desc umap_vnodeop_entries[] = {
- { &vop_default_desc, (vop_t *) umap_bypass },
- { &vop_getattr_desc, (vop_t *) umap_getattr },
- { &vop_inactive_desc, (vop_t *) umap_inactive },
- { &vop_lock_desc, (vop_t *) umap_lock },
- { &vop_print_desc, (vop_t *) umap_print },
- { &vop_reclaim_desc, (vop_t *) umap_reclaim },
- { &vop_rename_desc, (vop_t *) umap_rename },
- { &vop_unlock_desc, (vop_t *) umap_unlock },
- { NULL, NULL }
+static struct vop_vector umap_vnodeops = {
+ .vop_default = umap_bypass,
+ .vop_getattr = umap_getattr,
+ .vop_inactive = umap_inactive,
+ .vop_lock = umap_lock,
+ .vop_print = umap_print,
+ .vop_reclaim = umap_reclaim,
+ .vop_rename = umap_rename,
+ .vop_unlock = umap_unlock,
};
-static struct vnodeopv_desc umap_vnodeop_opv_desc =
- { &umap_vnodeop_p, umap_vnodeop_entries };
-
-VNODEOP_SET(umap_vnodeop_opv_desc);
OpenPOWER on IntegriCloud