Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/rump/librump/rumpvfs +VOP_REMOVE
details: https://anonhg.NetBSD.org/src/rev/ec193c5e2963
branches: trunk
changeset: 758630:ec193c5e2963
user: pooka <pooka%NetBSD.org@localhost>
date: Thu Nov 11 17:33:22 2010 +0000
description:
+VOP_REMOVE
diffstat:
sys/rump/librump/rumpvfs/rumpfs.c | 41 +++++++++++++++++++++++++++++++++++---
1 files changed, 37 insertions(+), 4 deletions(-)
diffs (90 lines):
diff -r 40d88b770968 -r ec193c5e2963 sys/rump/librump/rumpvfs/rumpfs.c
--- a/sys/rump/librump/rumpvfs/rumpfs.c Thu Nov 11 17:26:01 2010 +0000
+++ b/sys/rump/librump/rumpvfs/rumpfs.c Thu Nov 11 17:33:22 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rumpfs.c,v 1.71 2010/11/11 17:26:01 pooka Exp $ */
+/* $NetBSD: rumpfs.c,v 1.72 2010/11/11 17:33:22 pooka Exp $ */
/*
* Copyright (c) 2009, 2010 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.71 2010/11/11 17:26:01 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.72 2010/11/11 17:33:22 pooka Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@@ -64,6 +64,7 @@
static int rump_vop_getattr(void *);
static int rump_vop_mkdir(void *);
static int rump_vop_rmdir(void *);
+static int rump_vop_remove(void *);
static int rump_vop_mknod(void *);
static int rump_vop_create(void *);
static int rump_vop_inactive(void *);
@@ -96,6 +97,7 @@
{ &vop_getattr_desc, rump_vop_getattr },
{ &vop_mkdir_desc, rump_vop_mkdir },
{ &vop_rmdir_desc, rump_vop_rmdir },
+ { &vop_remove_desc, rump_vop_remove },
{ &vop_mknod_desc, rump_vop_mknod },
{ &vop_create_desc, rump_vop_create },
{ &vop_symlink_desc, rump_vop_symlink },
@@ -116,7 +118,6 @@
{ &vop_islocked_desc, genfs_islocked },
{ &vop_inactive_desc, rump_vop_inactive },
{ &vop_reclaim_desc, rump_vop_reclaim },
- { &vop_remove_desc, genfs_eopnotsupp },
{ &vop_link_desc, genfs_eopnotsupp },
{ &vop_pathconf_desc, rump_vop_pathconf },
{ &vop_bmap_desc, rump_vop_bmap },
@@ -630,7 +631,7 @@
return 0;
}
- /* we handle only some "non-special" cases */
+ /* we don't do rename */
if (!(((cnp->cn_flags & ISLASTCN) == 0) || (cnp->cn_nameiop != RENAME)))
return EOPNOTSUPP;
@@ -816,6 +817,38 @@
}
static int
+rump_vop_remove(void *v)
+{
+ struct vop_rmdir_args /* {
+ struct vnode *a_dvp;
+ struct vnode *a_vp;
+ struct componentname *a_cnp;
+ }; */ *ap = v;
+ struct vnode *dvp = ap->a_dvp;
+ struct vnode *vp = ap->a_vp;
+ struct componentname *cnp = ap->a_cnp;
+ struct rumpfs_node *rnd = dvp->v_data;
+ struct rumpfs_node *rn = vp->v_data;
+ int rv = 0;
+
+ if (rn->rn_flags & RUMPNODE_ET_PHONE_HOST)
+ return EOPNOTSUPP;
+
+ if (vp->v_type == VREG) {
+ rump_hyperfree(rn->rn_data, rn->rn_dlen);
+ }
+
+ freedir(rnd, cnp);
+ rn->rn_flags |= RUMPNODE_CANRECLAIM;
+
+ PNBUF_PUT(cnp->cn_pnbuf);
+ vput(dvp);
+ vput(vp);
+
+ return rv;
+}
+
+static int
rump_vop_mknod(void *v)
{
struct vop_mknod_args /* {
Home |
Main Index |
Thread Index |
Old Index