summaryrefslogtreecommitdiffstats
path: root/sys/fs/ntfs/ntfs_vnops.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/fs/ntfs/ntfs_vnops.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/fs/ntfs/ntfs_vnops.c')
-rw-r--r--sys/fs/ntfs/ntfs_vnops.c66
1 files changed, 26 insertions, 40 deletions
diff --git a/sys/fs/ntfs/ntfs_vnops.c b/sys/fs/ntfs/ntfs_vnops.c
index e578a717..700fd1a 100644
--- a/sys/fs/ntfs/ntfs_vnops.c
+++ b/sys/fs/ntfs/ntfs_vnops.c
@@ -77,9 +77,9 @@ static vop_access_t ntfs_access;
static vop_open_t ntfs_open;
static vop_close_t ntfs_close;
static vop_readdir_t ntfs_readdir;
-static vop_lookup_t ntfs_lookup;
+static vop_cachedlookup_t ntfs_lookup;
static vop_fsync_t ntfs_fsync;
-static int ntfs_pathconf(void *);
+static vop_pathconf_t ntfs_pathconf;
int ntfs_prtactive = 1; /* 1 => print out reclaim of active vnodes */
@@ -607,7 +607,7 @@ ntfs_readdir(ap)
int
ntfs_lookup(ap)
- struct vop_lookup_args /* {
+ struct vop_cachedlookup_args /* {
struct vnode *a_dvp;
struct vnode **a_vpp;
struct componentname *a_cnp;
@@ -717,14 +717,9 @@ ntfs_fsync(ap)
* Return POSIX pathconf information applicable to NTFS filesystem
*/
int
-ntfs_pathconf(v)
- void *v;
+ntfs_pathconf(ap)
+ struct vop_pathconf_args *ap;
{
- struct vop_pathconf_args /* {
- struct vnode *a_vp;
- int a_name;
- register_t *a_retval;
- } */ *ap = v;
switch (ap->a_name) {
case _PC_LINK_MAX:
@@ -751,35 +746,26 @@ ntfs_pathconf(v)
/*
* Global vfs data structures
*/
-vop_t **ntfs_vnodeop_p;
-static
-struct vnodeopv_entry_desc ntfs_vnodeop_entries[] = {
- { &vop_default_desc, (vop_t *)vop_defaultop },
-
- { &vop_getattr_desc, (vop_t *)ntfs_getattr },
- { &vop_inactive_desc, (vop_t *)ntfs_inactive },
- { &vop_reclaim_desc, (vop_t *)ntfs_reclaim },
- { &vop_pathconf_desc, ntfs_pathconf },
-
- { &vop_cachedlookup_desc, (vop_t *)ntfs_lookup },
- { &vop_lookup_desc, (vop_t *)vfs_cache_lookup },
-
- { &vop_access_desc, (vop_t *)ntfs_access },
- { &vop_close_desc, (vop_t *)ntfs_close },
- { &vop_open_desc, (vop_t *)ntfs_open },
- { &vop_readdir_desc, (vop_t *)ntfs_readdir },
- { &vop_fsync_desc, (vop_t *)ntfs_fsync },
-
- { &vop_bmap_desc, (vop_t *)ntfs_bmap },
- { &vop_strategy_desc, (vop_t *)ntfs_strategy },
- { &vop_read_desc, (vop_t *)ntfs_read },
- { &vop_write_desc, (vop_t *)ntfs_write },
-
- { NULL, NULL }
-};
+struct vop_vector ntfs_vnodeops = {
+ .vop_default = &default_vnodeops,
+
+ .vop_getattr = ntfs_getattr,
+ .vop_inactive = ntfs_inactive,
+ .vop_reclaim = ntfs_reclaim,
+ .vop_pathconf = ntfs_pathconf,
-static
-struct vnodeopv_desc ntfs_vnodeop_opv_desc =
- { &ntfs_vnodeop_p, ntfs_vnodeop_entries };
+ .vop_cachedlookup = ntfs_lookup,
+ .vop_lookup = vfs_cache_lookup,
-VNODEOP_SET(ntfs_vnodeop_opv_desc);
+ .vop_access = ntfs_access,
+ .vop_close = ntfs_close,
+ .vop_open = ntfs_open,
+ .vop_readdir = ntfs_readdir,
+ .vop_fsync = ntfs_fsync,
+
+ .vop_bmap = ntfs_bmap,
+ .vop_strategy = ntfs_strategy,
+ .vop_read = ntfs_read,
+ .vop_write = ntfs_write,
+
+};
OpenPOWER on IntegriCloud