diff --git a/sys/miscfs/genfs/genfs_node.h b/sys/miscfs/genfs/genfs_node.h index 2d379bd131ec..102124fe2723 100644 --- a/sys/miscfs/genfs/genfs_node.h +++ b/sys/miscfs/genfs/genfs_node.h @@ -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_ */ diff --git a/sys/miscfs/genfs/genfs_vnops.c b/sys/miscfs/genfs/genfs_vnops.c index 43ddd234506e..a6d41af7b06a 100644 --- a/sys/miscfs/genfs/genfs_vnops.c +++ b/sys/miscfs/genfs/genfs_vnops.c @@ -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 -__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 #include @@ -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) {