mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
g_vfs_close_unlocked(9): wrapper around g_vfs_close(9)
that locks both bo vnode and topology. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D59932
This commit is contained in:
1 parent
fc544d3b57
commit
87962e08fa
2 files changed
+16
-1
No files matched your search
@@ -338,3 +338,16 @@ g_vfs_close(struct g_consumer *cp)
|
|||||||
KASSERT(sc->sc_event == NULL, ("g_vfs %p event is non-NULL", sc));
|
KASSERT(sc->sc_event == NULL, ("g_vfs %p event is non-NULL", sc));
|
||||||
g_free(sc);
|
g_free(sc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
g_vfs_close_unlocked(struct g_consumer *cp)
|
||||||
|
{
|
||||||
|
struct vnode *vp;
|
||||||
|
|
||||||
|
vp = cp->private;
|
||||||
|
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
|
||||||
|
g_topology_lock();
|
||||||
|
g_vfs_close(cp);
|
||||||
|
g_topology_unlock();
|
||||||
|
VOP_UNLOCK(vp);
|
||||||
|
}
|
||||||
+3
-1
@@ -36,7 +36,9 @@ struct buf;
|
|||||||
extern struct buf_ops *g_vfs_bufops;
|
extern struct buf_ops *g_vfs_bufops;
|
||||||
|
|
||||||
void g_vfs_strategy(struct bufobj *bo, struct buf *bp);
|
void g_vfs_strategy(struct bufobj *bo, struct buf *bp);
|
||||||
int g_vfs_open(struct vnode *vp, struct g_consumer **cpp, const char *fsname, int wr);
|
int g_vfs_open(struct vnode *vp, struct g_consumer **cpp,
|
||||||
|
const char *fsname, int wr);
|
||||||
void g_vfs_close(struct g_consumer *cp);
|
void g_vfs_close(struct g_consumer *cp);
|
||||||
|
void g_vfs_close_unlocked(struct g_consumer *cp);
|
||||||
|
|
||||||
#endif /* _GEOM_GEOM_VFS_H_ */
|
#endif /* _GEOM_GEOM_VFS_H_ */
|
||||||
Reference in new issue
Block a user