Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/fs/puffs add advlock to puffs. ok pooka@
details: https://anonhg.NetBSD.org/src/rev/b064fe3470e8
branches: trunk
changeset: 760712:b064fe3470e8
user: kefren <kefren%NetBSD.org@localhost>
date: Tue Jan 11 14:04:54 2011 +0000
description:
add advlock to puffs. ok pooka@
should fix kern/43321
diffstat:
sys/fs/puffs/puffs_sys.h | 4 +++-
sys/fs/puffs/puffs_vnops.c | 32 +++++++-------------------------
2 files changed, 10 insertions(+), 26 deletions(-)
diffs (96 lines):
diff -r 11372644ccab -r b064fe3470e8 sys/fs/puffs/puffs_sys.h
--- a/sys/fs/puffs/puffs_sys.h Tue Jan 11 14:03:38 2011 +0000
+++ b/sys/fs/puffs/puffs_sys.h Tue Jan 11 14:04:54 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: puffs_sys.h,v 1.76 2010/07/06 13:47:47 pooka Exp $ */
+/* $NetBSD: puffs_sys.h,v 1.77 2011/01/11 14:04:54 kefren Exp $ */
/*
* Copyright (c) 2005, 2006 Antti Kantee. All Rights Reserved.
@@ -207,6 +207,8 @@
voff_t pn_serversize;
+ struct lockf * pn_lockf;
+
LIST_ENTRY(puffs_node) pn_hashent;
};
diff -r 11372644ccab -r b064fe3470e8 sys/fs/puffs/puffs_vnops.c
--- a/sys/fs/puffs/puffs_vnops.c Tue Jan 11 14:03:38 2011 +0000
+++ b/sys/fs/puffs/puffs_vnops.c Tue Jan 11 14:04:54 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: puffs_vnops.c,v 1.149 2010/11/30 10:43:03 dholland Exp $ */
+/* $NetBSD: puffs_vnops.c,v 1.150 2011/01/11 14:04:54 kefren Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved.
@@ -30,10 +30,11 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.149 2010/11/30 10:43:03 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.150 2011/01/11 14:04:54 kefren Exp $");
#include <sys/param.h>
#include <sys/buf.h>
+#include <sys/lockf.h>
#include <sys/malloc.h>
#include <sys/mount.h>
#include <sys/namei.h>
@@ -124,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_checkop }, /* advlock */
+ { &vop_advlock_desc, puffs_vnop_advlock }, /* REAL advlock */
{ &vop_strategy_desc, puffs_vnop_strategy }, /* REAL strategy */
{ &vop_revoke_desc, genfs_revoke }, /* REAL revoke */
{ &vop_abortop_desc, puffs_vnop_abortop }, /* REAL abortop */
@@ -291,7 +292,6 @@
{ &vop_print_desc, puffs_vnop_print }, /* print */
{ &vop_islocked_desc, puffs_vnop_islocked }, /* islocked */
{ &vop_pathconf_desc, puffs_vnop_pathconf }, /* pathconf */
- { &vop_advlock_desc, puffs_vnop_advlock }, /* advlock */
{ &vop_getpages_desc, puffs_vnop_getpages }, /* getpages */
{ NULL, NULL }
};
@@ -375,7 +375,6 @@
CHECKOP_NOTSUPP(READLINK);
CHECKOP_NOTSUPP(PRINT);
CHECKOP_NOTSUPP(PATHCONF);
- CHECKOP_NOTSUPP(ADVLOCK);
CHECKOP_NOTSUPP(GETEXTATTR);
CHECKOP_NOTSUPP(SETEXTATTR);
CHECKOP_NOTSUPP(LISTEXTATTR);
@@ -2109,27 +2108,10 @@
struct flock *a_fl;
int a_flags;
} */ *ap = v;
- PUFFS_MSG_VARS(vn, advlock);
struct vnode *vp = ap->a_vp;
- struct puffs_mount *pmp = MPTOPUFFSMP(vp->v_mount);
- int error;
-
- PUFFS_MSG_ALLOC(vn, advlock);
- error = copyin(ap->a_fl, &advlock_msg->pvnr_fl, sizeof(struct flock));
- if (error)
- goto out;
- 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__);
-
- out:
- PUFFS_MSG_RELEASE(advlock);
- return error;
+ struct puffs_node *pn = VPTOPP(vp);
+
+ return lf_advlock(ap, &pn->pn_lockf, vp->v_size);
}
int
Home |
Main Index |
Thread Index |
Old Index