Changeset View
Changeset View
Standalone View
Standalone View
sys/geom/geom_vfs.c
Show First 20 Lines • Show All 241 Lines • ▼ Show 20 Lines | g_vfs_open(struct vnode *vp, struct g_consumer **cpp, const char *fsname, int wr) | ||||
struct g_consumer *cp; | struct g_consumer *cp; | ||||
struct g_vfs_softc *sc; | struct g_vfs_softc *sc; | ||||
struct bufobj *bo; | struct bufobj *bo; | ||||
int error; | int error; | ||||
g_topology_assert(); | g_topology_assert(); | ||||
*cpp = NULL; | *cpp = NULL; | ||||
bo = &vp->v_bufobj; | bo = vp2bo(vp); | ||||
if (bo->bo_private != vp) | if (bo->bo_private != vp) | ||||
return (EBUSY); | return (EBUSY); | ||||
pp = g_dev_getprovider(vp->v_rdev); | pp = g_dev_getprovider(vp->v_rdev); | ||||
if (pp == NULL) | if (pp == NULL) | ||||
return (ENOENT); | return (ENOENT); | ||||
gp = g_new_geomf(&g_vfs_class, "%s.%s", fsname, pp->name); | gp = g_new_geomf(&g_vfs_class, "%s.%s", fsname, pp->name); | ||||
sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO); | sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO); | ||||
Show All 27 Lines | |||||
{ | { | ||||
struct g_geom *gp; | struct g_geom *gp; | ||||
struct g_vfs_softc *sc; | struct g_vfs_softc *sc; | ||||
g_topology_assert(); | g_topology_assert(); | ||||
gp = cp->geom; | gp = cp->geom; | ||||
sc = gp->softc; | sc = gp->softc; | ||||
bufobj_invalbuf(sc->sc_bo, V_SAVE, 0, 0); | bufobj_invalbuf(NULL /* XXXKIB */, sc->sc_bo, V_SAVE, 0, 0); | ||||
mckusick: Why can you pass NULL here and not have to come up with vm_object? You will fail to clear the… | |||||
Done Inline ActionsI do not think we could ever dirty a page for devvp, because we cannot mmap cdevs. The dirtyness for devvp is always tracked by devvp-owned buffers. But I fixed this place nonetheless, using bo2vnode(). kib: I do not think we could ever dirty a page for devvp, because we cannot mmap cdevs. The… | |||||
sc->sc_bo->bo_private = cp->private; | sc->sc_bo->bo_private = cp->private; | ||||
gp->softc = NULL; | gp->softc = NULL; | ||||
mtx_destroy(&sc->sc_mtx); | mtx_destroy(&sc->sc_mtx); | ||||
if (!sc->sc_orphaned || cp->provider == NULL) | if (!sc->sc_orphaned || cp->provider == NULL) | ||||
g_wither_geom_close(gp, ENXIO); | g_wither_geom_close(gp, ENXIO); | ||||
g_free(sc); | g_free(sc); | ||||
} | } |
Why can you pass NULL here and not have to come up with vm_object? You will fail to clear the VM cache which it should since flags & (V_ALT | V_NORMAL | V_CLEANONLY | V_VMIO)) == 0