add advlock to puffs. ok pooka@

should fix kern/43321
This commit is contained in:
kefren 2011-01-11 14:04:54 +00:00
parent eea5c39883
commit 2f07b81209
2 changed files with 9 additions and 25 deletions

View File

@ -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 @@ struct puffs_node {
voff_t pn_serversize;
struct lockf * pn_lockf;
LIST_ENTRY(puffs_node) pn_hashent;
};

View File

@ -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 @@ const struct vnodeopv_entry_desc puffs_vnodeop_entries[] = {
{ &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 @@ const struct vnodeopv_entry_desc puffs_msgop_entries[] = {
{ &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 @@ puffs_vnop_checkop(void *v)
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 @@ puffs_vnop_advlock(void *v)
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;
struct puffs_node *pn = VPTOPP(vp);
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;
return lf_advlock(ap, &pn->pn_lockf, vp->v_size);
}
int