Add genfs_node_rdtrylock().

This commit is contained in:
uebayasi 2010-01-27 15:18:40 +00:00
parent 6cbc5cbff1
commit b9bfa07443
2 changed files with 12 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: genfs_node.h,v 1.17 2008/05/14 16:49:47 reinoud Exp $ */
/* $NetBSD: genfs_node.h,v 1.18 2010/01/27 15:18:40 uebayasi Exp $ */
/*
* Copyright (c) 2001 Chuck Silvers.
@ -91,6 +91,7 @@ void genfs_directio(struct vnode *, struct uio *, int);
void genfs_node_wrlock(struct vnode *);
void genfs_node_rdlock(struct vnode *);
void genfs_node_rdtrylock(struct vnode *);
void genfs_node_unlock(struct vnode *);
#endif /* _MISCFS_GENFS_GENFS_NODE_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: genfs_vnops.c,v 1.174 2009/11/20 13:42:43 roy Exp $ */
/* $NetBSD: genfs_vnops.c,v 1.175 2010/01/27 15:18:40 uebayasi Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@ -57,7 +57,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: genfs_vnops.c,v 1.174 2009/11/20 13:42:43 roy Exp $");
__KERNEL_RCSID(0, "$NetBSD: genfs_vnops.c,v 1.175 2010/01/27 15:18:40 uebayasi Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -514,6 +514,14 @@ genfs_node_rdlock(struct vnode *vp)
rw_enter(&gp->g_glock, RW_READER);
}
void
genfs_node_rdtrylock(struct vnode *vp)
{
struct genfs_node *gp = VTOG(vp);
rw_tryenter(&gp->g_glock, RW_READER);
}
void
genfs_node_unlock(struct vnode *vp)
{