summaryrefslogtreecommitdiff
path: root/sys/ntfs
diff options
context:
space:
mode:
authorThordur I. Bjornsson <thib@cvs.openbsd.org>2010-09-07 00:41:06 +0000
committerThordur I. Bjornsson <thib@cvs.openbsd.org>2010-09-07 00:41:06 +0000
commit50e414e8ea506394fa3f997b69f8ac5476dfa0a2 (patch)
treea1d00f02bfd395316b1cd15d4148023e5d624bf0 /sys/ntfs
parent1513675759b43b6bab2d999a28f5fd9dc0cf3522 (diff)
Allow NTFS to compile by cutting it over to the new VOP world order.
Small cleanup while here, nuke the ntfs_bypass function and just use eopnotsupp like every other filesystem, it makes no sense to return ENOTTY for unimplemented VOPs.
Diffstat (limited to 'sys/ntfs')
-rw-r--r--sys/ntfs/ntfs.h6
-rw-r--r--sys/ntfs/ntfs_vfsops.c11
-rw-r--r--sys/ntfs/ntfs_vnops.c152
3 files changed, 68 insertions, 101 deletions
diff --git a/sys/ntfs/ntfs.h b/sys/ntfs/ntfs.h
index 22901e51395..c3fdfa3b7a3 100644
--- a/sys/ntfs/ntfs.h
+++ b/sys/ntfs/ntfs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntfs.h,v 1.9 2010/08/12 04:05:03 tedu Exp $ */
+/* $OpenBSD: ntfs.h,v 1.10 2010/09/07 00:41:05 thib Exp $ */
/* $NetBSD: ntfs.h,v 1.5 2003/04/24 07:50:19 christos Exp $ */
/*-
@@ -282,8 +282,6 @@ struct ntfsmount {
#define ntfs_btocnoff(off) (off_t)((off) % ((ntmp)->ntm_spc * (ntmp)->ntm_bps))
#define ntfs_bntob(bn) (int32_t)((bn) * (ntmp)->ntm_bps)
-typedef int (vop_t)(void *);
-
#if defined(NTFS_DEBUG)
extern int ntfs_debug;
#define DPRINTF(X, Y) do { if(ntfs_debug >= (X)) printf Y; } while(0)
@@ -295,4 +293,4 @@ extern int ntfs_debug;
#define ddprintf(a)
#endif
-extern vop_t **ntfs_vnodeop_p;
+extern struct vops ntfs_vops;
diff --git a/sys/ntfs/ntfs_vfsops.c b/sys/ntfs/ntfs_vfsops.c
index cbc05b179f9..13a75cb1ef4 100644
--- a/sys/ntfs/ntfs_vfsops.c
+++ b/sys/ntfs/ntfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntfs_vfsops.c,v 1.21 2010/09/04 21:35:58 tedu Exp $ */
+/* $OpenBSD: ntfs_vfsops.c,v 1.22 2010/09/07 00:41:05 thib Exp $ */
/* $NetBSD: ntfs_vfsops.c,v 1.7 2003/04/24 07:50:19 christos Exp $ */
/*-
@@ -831,7 +831,7 @@ ntfs_vgetex(
}
}
- error = getnewvnode(VT_NTFS, ntmp->ntm_mountp, ntfs_vnodeop_p, &vp);
+ error = getnewvnode(VT_NTFS, ntmp->ntm_mountp, &ntfs_vops, &vp);
if(error) {
ntfs_frele(fp);
ntfs_ntput(ip, p);
@@ -869,13 +869,6 @@ ntfs_vget(
LK_EXCLUSIVE | LK_RETRY, 0, curproc, vpp); /* XXX */
}
-extern const struct vnodeopv_desc ntfs_vnodeop_opv_desc;
-
-const struct vnodeopv_desc * const ntfs_vnodeopv_descs[] = {
- &ntfs_vnodeop_opv_desc,
- NULL,
-};
-
const struct vfsops ntfs_vfsops = {
ntfs_mount,
ntfs_start,
diff --git a/sys/ntfs/ntfs_vnops.c b/sys/ntfs/ntfs_vnops.c
index 660e1785436..f7a79a80e50 100644
--- a/sys/ntfs/ntfs_vnops.c
+++ b/sys/ntfs/ntfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntfs_vnops.c,v 1.18 2010/08/12 04:05:03 tedu Exp $ */
+/* $OpenBSD: ntfs_vnops.c,v 1.19 2010/09/07 00:41:05 thib Exp $ */
/* $NetBSD: ntfs_vnops.c,v 1.6 2003/04/10 21:57:26 jdolecek Exp $ */
/*
@@ -57,21 +57,20 @@
#include <sys/unistd.h> /* for pathconf(2) constants */
-static int ntfs_bypass(struct vop_generic_args *ap);
-static int ntfs_read(struct vop_read_args *);
-static int ntfs_write(struct vop_write_args *ap);
-static int ntfs_getattr(struct vop_getattr_args *ap);
-static int ntfs_inactive(struct vop_inactive_args *ap);
-static int ntfs_print(struct vop_print_args *ap);
-static int ntfs_reclaim(struct vop_reclaim_args *ap);
-static int ntfs_strategy(struct vop_strategy_args *ap);
-static int ntfs_access(struct vop_access_args *ap);
-static int ntfs_open(struct vop_open_args *ap);
-static int ntfs_close(struct vop_close_args *ap);
-static int ntfs_readdir(struct vop_readdir_args *ap);
-static int ntfs_lookup(struct vop_lookup_args *ap);
-static int ntfs_bmap(struct vop_bmap_args *ap);
-static int ntfs_fsync(struct vop_fsync_args *ap);
+static int ntfs_read(void *);
+static int ntfs_write(void *);
+static int ntfs_getattr(void *);
+static int ntfs_inactive(void *);
+static int ntfs_print(void *);
+static int ntfs_reclaim(void *);
+static int ntfs_strategy(void *);
+static int ntfs_access(void *);
+static int ntfs_open(void *);
+static int ntfs_close(void *);
+static int ntfs_readdir(void *);
+static int ntfs_lookup(void *);
+static int ntfs_bmap(void *);
+static int ntfs_fsync(void *);
static int ntfs_pathconf(void *);
int ntfs_prtactive = 1; /* 1 => print out reclaim of active vnodes */
@@ -80,9 +79,9 @@ int ntfs_prtactive = 1; /* 1 => print out reclaim of active vnodes */
* This is a noop, simply returning what one has been given.
*/
int
-ntfs_bmap(ap)
- struct vop_bmap_args *ap;
+ntfs_bmap(void *v)
{
+ struct vop_bmap_args *ap = v;
dprintf(("ntfs_bmap: vn: %p, blk: %d\n", ap->a_vp,(u_int32_t)ap->a_bn));
if (ap->a_vpp != NULL)
*ap->a_vpp = ap->a_vp;
@@ -94,9 +93,9 @@ ntfs_bmap(ap)
}
static int
-ntfs_read(ap)
- struct vop_read_args *ap;
+ntfs_read(void *v)
{
+ struct vop_read_args *ap = v;
struct vnode *vp = ap->a_vp;
struct fnode *fp = VTOF(vp);
struct ntnode *ip = FTONT(fp);
@@ -131,19 +130,9 @@ ntfs_read(ap)
}
static int
-ntfs_bypass(ap)
- struct vop_generic_args *ap;
-{
- int error = ENOTTY;
- dprintf(("ntfs_bypass: %s\n", ap->a_desc->vdesc_name));
- return (error);
-}
-
-
-static int
-ntfs_getattr(ap)
- struct vop_getattr_args *ap;
+ntfs_getattr(void *v)
{
+ struct vop_getattr_args *ap = v;
struct vnode *vp = ap->a_vp;
struct fnode *fp = VTOF(vp);
struct ntnode *ip = FTONT(fp);
@@ -176,9 +165,9 @@ ntfs_getattr(ap)
* Last reference to an ntnode. If necessary, write or delete it.
*/
int
-ntfs_inactive(ap)
- struct vop_inactive_args *ap;
+ntfs_inactive(void *v)
{
+ struct vop_inactive_args *ap = v;
struct vnode *vp = ap->a_vp;
struct proc *p = ap->a_p;
#ifdef NTFS_DEBUG
@@ -204,9 +193,9 @@ ntfs_inactive(ap)
* Reclaim an fnode/ntnode so that it can be used for other purposes.
*/
int
-ntfs_reclaim(ap)
- struct vop_reclaim_args *ap;
+ntfs_reclaim(void *v)
{
+ struct vop_reclaim_args *ap = v;
struct vnode *vp = ap->a_vp;
struct fnode *fp = VTOF(vp);
struct ntnode *ip = FTONT(fp);
@@ -235,9 +224,9 @@ ntfs_reclaim(ap)
}
static int
-ntfs_print(ap)
- struct vop_print_args *ap;
+ntfs_print(void *v)
{
+ struct vop_print_args *ap = v;
struct ntnode *ip = VTONT(ap->a_vp);
printf("tag VT_NTFS, ino %u, flag %#x, usecount %d, nlink %ld\n",
@@ -251,9 +240,9 @@ ntfs_print(ap)
* then call the device strategy routine.
*/
int
-ntfs_strategy(ap)
- struct vop_strategy_args *ap;
+ntfs_strategy(void *v)
{
+ struct vop_strategy_args *ap = v;
struct buf *bp = ap->a_bp;
struct vnode *vp = bp->b_vp;
struct fnode *fp = VTOF(vp);
@@ -324,9 +313,9 @@ ntfs_strategy(ap)
}
static int
-ntfs_write(ap)
- struct vop_write_args *ap;
+ntfs_write(void *v)
{
+ struct vop_write_args *ap = v;
struct vnode *vp = ap->a_vp;
struct fnode *fp = VTOF(vp);
struct ntnode *ip = FTONT(fp);
@@ -359,9 +348,9 @@ ntfs_write(ap)
}
int
-ntfs_access(ap)
- struct vop_access_args *ap;
+ntfs_access(void *v)
{
+ struct vop_access_args *ap = v;
struct vnode *vp = ap->a_vp;
struct ntnode *ip = VTONT(vp);
struct ucred *cred = ap->a_cred;
@@ -433,10 +422,10 @@ ntfs_access(ap)
*/
/* ARGSUSED */
static int
-ntfs_open(ap)
- struct vop_open_args *ap;
+ntfs_open(void *v)
{
#if NTFS_DEBUG
+ struct vop_open_args *ap = v;
struct vnode *vp = ap->a_vp;
struct ntnode *ip = VTONT(vp);
@@ -457,10 +446,10 @@ ntfs_open(ap)
*/
/* ARGSUSED */
static int
-ntfs_close(ap)
- struct vop_close_args *ap;
+ntfs_close(void *v)
{
#if NTFS_DEBUG
+ struct vop_close_args *ap = v;
struct vnode *vp = ap->a_vp;
struct ntnode *ip = VTONT(vp);
@@ -471,9 +460,9 @@ ntfs_close(ap)
}
int
-ntfs_readdir(ap)
- struct vop_readdir_args *ap;
+ntfs_readdir(void *v)
{
+ struct vop_readdir_args *ap = v;
struct vnode *vp = ap->a_vp;
struct fnode *fp = VTOF(vp);
struct ntnode *ip = FTONT(fp);
@@ -607,9 +596,9 @@ ntfs_readdir(ap)
}
int
-ntfs_lookup(ap)
- struct vop_lookup_args *ap;
+ntfs_lookup(void *v)
{
+ struct vop_lookup_args *ap = v;
struct vnode *dvp = ap->a_dvp;
struct ntnode *dip = VTONT(dvp);
struct ntfsmount *ntmp = dip->i_mp;
@@ -713,8 +702,7 @@ ntfs_lookup(ap)
* could just do a sync if they try an fsync on a directory file.
*/
static int
-ntfs_fsync(ap)
- struct vop_fsync_args *ap;
+ntfs_fsync(void *v)
{
return (0);
}
@@ -723,8 +711,7 @@ ntfs_fsync(ap)
* Return POSIX pathconf information applicable to NTFS filesystem
*/
static int
-ntfs_pathconf(v)
- void *v;
+ntfs_pathconf(void *v)
{
struct vop_pathconf_args *ap = v;
@@ -753,36 +740,25 @@ 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 *)ntfs_bypass },
-
- { &vop_getattr_desc, (vop_t *)ntfs_getattr },
- { &vop_inactive_desc, (vop_t *)ntfs_inactive },
- { &vop_reclaim_desc, (vop_t *)ntfs_reclaim },
- { &vop_print_desc, (vop_t *)ntfs_print },
- { &vop_pathconf_desc, ntfs_pathconf },
-
- { &vop_islocked_desc, (vop_t *)vop_generic_islocked },
- { &vop_unlock_desc, (vop_t *)vop_generic_unlock },
- { &vop_lock_desc, (vop_t *)vop_generic_lock },
- { &vop_lookup_desc, (vop_t *)ntfs_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_bwrite_desc, (vop_t *)vop_generic_bwrite },
- { &vop_read_desc, (vop_t *)ntfs_read },
- { &vop_write_desc, (vop_t *)ntfs_write },
-
- { NULL, NULL }
+struct vops ntfs_vops = {
+ .vop_default = eopnotsupp,
+ .vop_getattr = ntfs_getattr,
+ .vop_inactive = ntfs_inactive,
+ .vop_reclaim = ntfs_reclaim,
+ .vop_print = ntfs_print,
+ .vop_pathconf = ntfs_pathconf,
+ .vop_islocked = vop_generic_islocked,
+ .vop_unlock = vop_generic_unlock,
+ .vop_lock = vop_generic_lock,
+ .vop_lookup = ntfs_lookup,
+ .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_bwrite = vop_generic_bwrite,
+ .vop_read = ntfs_read,
+ .vop_write = ntfs_write,
};
-
-const struct vnodeopv_desc ntfs_vnodeop_opv_desc =
- { &ntfs_vnodeop_p, ntfs_vnodeop_entries };