summaryrefslogtreecommitdiffstats
path: root/sys/gnu/ext2fs/ext2_vfsops.c
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/gnu/ext2fs/ext2_vfsops.c
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/gnu/ext2fs/ext2_vfsops.c')
-rw-r--r--sys/gnu/ext2fs/ext2_vfsops.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/gnu/ext2fs/ext2_vfsops.c b/sys/gnu/ext2fs/ext2_vfsops.c
index 905e7f7..0519c59 100644
--- a/sys/gnu/ext2fs/ext2_vfsops.c
+++ b/sys/gnu/ext2fs/ext2_vfsops.c
@@ -1026,7 +1026,7 @@ restart:
MALLOC(ip, struct inode *, sizeof(struct inode), M_EXT2NODE, M_WAITOK);
/* Allocate a new vnode/inode. */
- if ((error = getnewvnode("ext2fs", mp, ext2_vnodeop_p, &vp)) != 0) {
+ if ((error = getnewvnode("ext2fs", mp, &ext2_vnodeops, &vp)) != 0) {
if (ext2fs_inode_hash_lock < 0)
wakeup(&ext2fs_inode_hash_lock);
ext2fs_inode_hash_lock = 0;
@@ -1095,7 +1095,7 @@ printf("ext2_vget(%d) dbn= %d ", ino, fsbtodb(fs, ino_to_fsba(fs, ino)));
* Initialize the vnode from the inode, check for aliases.
* Note that the underlying vnode may have changed.
*/
- if ((error = ext2_vinit(mp, ext2_fifoop_p, &vp)) != 0) {
+ if ((error = ext2_vinit(mp, &ext2_fifoops, &vp)) != 0) {
vput(vp);
*vpp = NULL;
return (error);
OpenPOWER on IntegriCloud