Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Call advlock method if supplied
details: https://anonhg.NetBSD.org/src/rev/b62ca124709a
branches: trunk
changeset: 764767:b62ca124709a
user: manu <manu%NetBSD.org@localhost>
date: Tue May 03 13:16:47 2011 +0000
description:
Call advlock method if supplied
diffstat:
lib/libpuffs/puffs.c | 5 +++--
sys/fs/puffs/puffs_vnops.c | 28 +++++++++++++++++++++++-----
2 files changed, 26 insertions(+), 7 deletions(-)
diffs (84 lines):
diff -r ab3a69168a51 -r b62ca124709a lib/libpuffs/puffs.c
--- a/lib/libpuffs/puffs.c Tue May 03 13:14:09 2011 +0000
+++ b/lib/libpuffs/puffs.c Tue May 03 13:16:47 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: puffs.c,v 1.115 2010/12/06 14:50:34 pooka Exp $ */
+/* $NetBSD: puffs.c,v 1.116 2011/05/03 13:16:47 manu Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#if !defined(lint)
-__RCSID("$NetBSD: puffs.c,v 1.115 2010/12/06 14:50:34 pooka Exp $");
+__RCSID("$NetBSD: puffs.c,v 1.116 2011/05/03 13:16:47 manu Exp $");
#endif /* !lint */
#include <sys/param.h>
@@ -98,6 +98,7 @@
FILLOP(print, PRINT);
FILLOP(read, READ);
FILLOP(write, WRITE);
+ FILLOP(advlock, ADVLOCK);
FILLOP(abortop, ABORTOP);
FILLOP(pathconf, PATHCONF);
diff -r ab3a69168a51 -r b62ca124709a sys/fs/puffs/puffs_vnops.c
--- a/sys/fs/puffs/puffs_vnops.c Tue May 03 13:14:09 2011 +0000
+++ b/sys/fs/puffs/puffs_vnops.c Tue May 03 13:16:47 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: puffs_vnops.c,v 1.150 2011/01/11 14:04:54 kefren Exp $ */
+/* $NetBSD: puffs_vnops.c,v 1.151 2011/05/03 13:16:47 manu 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.150 2011/01/11 14:04:54 kefren Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.151 2011/05/03 13:16:47 manu Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@@ -125,7 +125,7 @@
{ &vop_getpages_desc, puffs_vnop_checkop }, /* getpages */
{ &vop_putpages_desc, genfs_putpages }, /* REAL putpages */
{ &vop_pathconf_desc, puffs_vnop_checkop }, /* pathconf */
- { &vop_advlock_desc, puffs_vnop_advlock }, /* REAL advlock */
+ { &vop_advlock_desc, puffs_vnop_advlock }, /* advlock */
{ &vop_strategy_desc, puffs_vnop_strategy }, /* REAL strategy */
{ &vop_revoke_desc, genfs_revoke }, /* REAL revoke */
{ &vop_abortop_desc, puffs_vnop_abortop }, /* REAL abortop */
@@ -2108,10 +2108,28 @@
struct flock *a_fl;
int a_flags;
} */ *ap = v;
+ PUFFS_MSG_VARS(vn, advlock);
struct vnode *vp = ap->a_vp;
struct puffs_node *pn = VPTOPP(vp);
-
- return lf_advlock(ap, &pn->pn_lockf, vp->v_size);
+ struct puffs_mount *pmp = MPTOPUFFSMP(vp->v_mount);
+ int error;
+
+ if (!EXISTSOP(pmp, ADVLOCK))
+ return lf_advlock(ap, &pn->pn_lockf, vp->v_size);
+
+ PUFFS_MSG_ALLOC(vn, advlock);
+ (void)memcpy(&advlock_msg->pvnr_fl, ap->a_fl,
+ sizeof(advlock_msg->pvnr_fl));
+ advlock_msg->pvnr_id = ap->a_id;
+ advlock_msg->pvnr_op = ap->a_op;
+ advlock_msg->pvnr_flags = ap->a_flags;
+ puffs_msg_setinfo(park_advlock, PUFFSOP_VN,
+ PUFFS_VN_ADVLOCK, VPTOPNC(vp));
+ PUFFS_MSG_ENQUEUEWAIT2(pmp, park_advlock, vp->v_data, NULL, error);
+ error = checkerr(pmp, error, __func__);
+ PUFFS_MSG_RELEASE(advlock);
+
+ return error;
}
int
Home |
Main Index |
Thread Index |
Old Index