Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/fs/puffs Transmit VOP_ABORTOP() to the server.



details:   https://anonhg.NetBSD.org/src/rev/067a18ad5f47
branches:  trunk
changeset: 748233:067a18ad5f47
user:      pooka <pooka%NetBSD.org@localhost>
date:      Sat Oct 17 23:16:05 2009 +0000

description:
Transmit VOP_ABORTOP() to the server.

diffstat:

 sys/fs/puffs/puffs_msgif.h |  11 +++++++++--
 sys/fs/puffs/puffs_vnops.c |  34 +++++++++++++++++++++++++++++++---
 2 files changed, 40 insertions(+), 5 deletions(-)

diffs (101 lines):

diff -r 72c889f79bce -r 067a18ad5f47 sys/fs/puffs/puffs_msgif.h
--- a/sys/fs/puffs/puffs_msgif.h        Sat Oct 17 23:05:32 2009 +0000
+++ b/sys/fs/puffs/puffs_msgif.h        Sat Oct 17 23:16:05 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: puffs_msgif.h,v 1.66 2009/01/12 18:48:35 pooka Exp $   */
+/*     $NetBSD: puffs_msgif.h,v 1.67 2009/10/17 23:16:05 pooka Exp $   */
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -102,7 +102,7 @@
 #define PUFFS_ERR_MAX PUFFS_ERR_VPTOFH
 
 #define PUFFSDEVELVERS 0x80000000
-#define PUFFSVERSION   27
+#define PUFFSVERSION   28
 #define PUFFSNAMESIZE  32
 
 #define PUFFS_TYPEPREFIX "puffs|"
@@ -563,6 +563,13 @@
        struct puffs_kcred      pvnr_cred;              /* OUT  */
 };
 
+struct puffs_vnmsg_abortop {
+       struct puffs_req        pvn_pr;
+
+       struct puffs_kcn        pvnr_cn;                /* OUT  */
+       struct puffs_kcred      pvnr_cn_cred;           /* OUT  */
+};
+
 
 /*
  * For cache reports.  Everything is always out-out-out, no replies
diff -r 72c889f79bce -r 067a18ad5f47 sys/fs/puffs/puffs_vnops.c
--- a/sys/fs/puffs/puffs_vnops.c        Sat Oct 17 23:05:32 2009 +0000
+++ b/sys/fs/puffs/puffs_vnops.c        Sat Oct 17 23:16:05 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: puffs_vnops.c,v 1.135 2009/09/30 18:22:29 pooka Exp $  */
+/*     $NetBSD: puffs_vnops.c,v 1.136 2009/10/17 23:16:05 pooka Exp $  */
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.135 2009/09/30 18:22:29 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.136 2009/10/17 23:16:05 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -82,6 +82,7 @@
 int    puffs_vnop_bmap(void *);
 int    puffs_vnop_mmap(void *);
 int    puffs_vnop_getpages(void *);
+int    puffs_vnop_abortop(void *);
 
 int    puffs_vnop_spec_read(void *);
 int    puffs_vnop_spec_write(void *);
@@ -130,7 +131,7 @@
         { &vop_advlock_desc, puffs_vnop_checkop },     /* advlock */
         { &vop_strategy_desc, puffs_vnop_strategy },   /* REAL strategy */
         { &vop_revoke_desc, genfs_revoke },            /* REAL revoke */
-        { &vop_abortop_desc, genfs_abortop },          /* REAL abortop */
+        { &vop_abortop_desc, puffs_vnop_abortop },     /* REAL abortop */
         { &vop_inactive_desc, puffs_vnop_inactive },   /* REAL inactive */
         { &vop_reclaim_desc, puffs_vnop_reclaim },     /* REAL reclaim */
         { &vop_lock_desc, puffs_vnop_lock },           /* REAL lock */
@@ -2106,6 +2107,33 @@
        return error;
 }
 
+int
+puffs_vnop_abortop(void *v)
+{
+       struct vop_abortop_args /* {
+               struct vnode *a_dvp;
+               struct componentname *a_cnp;
+       }; */ *ap = v;
+       PUFFS_MSG_VARS(vn, abortop);
+       struct vnode *dvp = ap->a_dvp;
+       struct puffs_mount *pmp = MPTOPUFFSMP(dvp->v_mount);
+       struct componentname *cnp = ap->a_cnp;
+       int error;
+
+       if (EXISTSOP(pmp, ABORTOP)) {
+               PUFFS_MSG_ALLOC(vn, abortop);
+               puffs_makecn(&abortop_msg->pvnr_cn, &abortop_msg->pvnr_cn_cred,
+                   cnp, PUFFS_USE_FULLPNBUF(pmp));
+               puffs_msg_setinfo(park_abortop, PUFFSOP_VN,
+                   PUFFS_VN_ABORTOP, VPTOPNC(dvp));
+
+               PUFFS_MSG_ENQUEUEWAIT(pmp, park_abortop, error);
+               PUFFS_MSG_RELEASE(abortop);
+       }
+
+       return genfs_abortop(v);
+}
+
 #define BIOASYNC(bp) (bp->b_flags & B_ASYNC)
 
 /*



Home | Main Index | Thread Index | Old Index