From 099a431e7fa16c57e47f80ce5b4b0bc73c99e3e3 Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 28 Aug 2012 19:28:31 +0000 Subject: [PATCH] Remove unneeded G_PF_CANDELETE flag. This flag is only used by GEOM so it can be propagated to the character device's SI_CANDELETE. Unfortunately, SI_CANDELETE seems to do nothing. --- sys/geom/bde/g_bde.c | 8 -------- sys/geom/geom.h | 1 - sys/geom/geom_dev.c | 4 ---- sys/geom/geom_disk.c | 6 ------ sys/geom/geom_slice.c | 1 - sys/geom/geom_subr.c | 1 - sys/geom/part/g_part.c | 1 - sys/geom/uncompress/g_uncompress.c | 1 - sys/geom/uzip/g_uzip.c | 1 - 9 files changed, 24 deletions(-) diff --git a/sys/geom/bde/g_bde.c b/sys/geom/bde/g_bde.c index 99064f4505d5..a6fcf2a0a30c 100644 --- a/sys/geom/bde/g_bde.c +++ b/sys/geom/bde/g_bde.c @@ -185,14 +185,6 @@ g_bde_create_geom(struct gctl_req *req, struct g_class *mp, struct g_provider *p kproc_create(g_bde_worker, gp, &sc->thread, 0, 0, "g_bde %s", gp->name); pp = g_new_providerf(gp, gp->name); -#if 0 - /* - * XXX: Disable this for now. Appearantly UFS no longer - * XXX: issues BIO_DELETE requests correctly, with the obvious - * XXX: outcome that userdata is trashed. - */ - pp->flags |= G_PF_CANDELETE; -#endif pp->stripesize = kp->zone_cont; pp->stripeoffset = 0; pp->mediasize = sc->mediasize; diff --git a/sys/geom/geom.h b/sys/geom/geom.h index 6a447aee4c88..75bfcc2e267b 100644 --- a/sys/geom/geom.h +++ b/sys/geom/geom.h @@ -203,7 +203,6 @@ struct g_provider { struct devstat *stat; u_int nstart, nend; u_int flags; -#define G_PF_CANDELETE 0x1 #define G_PF_WITHER 0x2 #define G_PF_ORPHAN 0x4 diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c index 793674098da4..fcec13410bf9 100644 --- a/sys/geom/geom_dev.c +++ b/sys/geom/geom_dev.c @@ -208,15 +208,11 @@ g_dev_taste(struct g_class *mp, struct g_provider *pp, int insist __unused) } } - if (pp->flags & G_PF_CANDELETE) - dev->si_flags |= SI_CANDELETE; dev->si_iosize_max = MAXPHYS; gp->softc = dev; dev->si_drv1 = gp; dev->si_drv2 = cp; if (adev != NULL) { - if (pp->flags & G_PF_CANDELETE) - adev->si_flags |= SI_CANDELETE; adev->si_iosize_max = MAXPHYS; adev->si_drv1 = gp; adev->si_drv2 = cp; diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c index f863b2cfac42..445055a85333 100644 --- a/sys/geom/geom_disk.c +++ b/sys/geom/geom_disk.c @@ -162,10 +162,6 @@ g_disk_access(struct g_provider *pp, int r, int w, int e) } pp->mediasize = dp->d_mediasize; pp->sectorsize = dp->d_sectorsize; - if (dp->d_flags & DISKFLAG_CANDELETE) - pp->flags |= G_PF_CANDELETE; - else - pp->flags &= ~G_PF_CANDELETE; pp->stripeoffset = dp->d_stripeoffset; pp->stripesize = dp->d_stripesize; dp->d_flags |= DISKFLAG_OPEN; @@ -487,8 +483,6 @@ g_disk_create(void *arg, int flag) pp = g_new_providerf(gp, "%s", gp->name); pp->mediasize = dp->d_mediasize; pp->sectorsize = dp->d_sectorsize; - if (dp->d_flags & DISKFLAG_CANDELETE) - pp->flags |= G_PF_CANDELETE; pp->stripeoffset = dp->d_stripeoffset; pp->stripesize = dp->d_stripesize; if (bootverbose) diff --git a/sys/geom/geom_slice.c b/sys/geom/geom_slice.c index 110085497acb..74b8983172d4 100644 --- a/sys/geom/geom_slice.c +++ b/sys/geom/geom_slice.c @@ -392,7 +392,6 @@ g_slice_config(struct g_geom *gp, u_int idx, int how, off_t offset, off_t length sbuf_finish(sb); pp = g_new_providerf(gp, sbuf_data(sb)); pp2 = LIST_FIRST(&gp->consumer)->provider; - pp->flags = pp2->flags & G_PF_CANDELETE; pp->stripesize = pp2->stripesize; pp->stripeoffset = pp2->stripeoffset + offset; if (pp->stripesize > 0) diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c index 4d8623fc91f3..2126ed749658 100644 --- a/sys/geom/geom_subr.c +++ b/sys/geom/geom_subr.c @@ -1261,7 +1261,6 @@ provider_flags_to_string(struct g_provider *pp, char *str, size_t size) strlcpy(str, "NONE", size); return (str); } - ADDFLAG(pp, G_PF_CANDELETE, "G_PF_CANDELETE"); ADDFLAG(pp, G_PF_WITHER, "G_PF_WITHER"); ADDFLAG(pp, G_PF_ORPHAN, "G_PF_ORPHAN"); return (str); diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c index 48ae931e4940..859b2f1e575b 100644 --- a/sys/geom/part/g_part.c +++ b/sys/geom/part/g_part.c @@ -423,7 +423,6 @@ g_part_new_provider(struct g_geom *gp, struct g_part_table *table, pp->sectorsize; entry->gpe_pp->mediasize -= entry->gpe_offset - offset; entry->gpe_pp->sectorsize = pp->sectorsize; - entry->gpe_pp->flags = pp->flags & G_PF_CANDELETE; entry->gpe_pp->stripesize = pp->stripesize; entry->gpe_pp->stripeoffset = pp->stripeoffset + entry->gpe_offset; if (pp->stripesize > 0) diff --git a/sys/geom/uncompress/g_uncompress.c b/sys/geom/uncompress/g_uncompress.c index f8227029e703..d2948ef0c28e 100644 --- a/sys/geom/uncompress/g_uncompress.c +++ b/sys/geom/uncompress/g_uncompress.c @@ -594,7 +594,6 @@ g_uncompress_taste(struct g_class *mp, struct g_provider *pp, int flags) pp2 = g_new_providerf(gp, "%s", gp->name); pp2->sectorsize = 512; pp2->mediasize = (off_t)sc->nblocks * sc->blksz; - pp2->flags = pp->flags & G_PF_CANDELETE; if (pp->stripesize > 0) { pp2->stripesize = pp->stripesize; pp2->stripeoffset = pp->stripeoffset; diff --git a/sys/geom/uzip/g_uzip.c b/sys/geom/uzip/g_uzip.c index 03272115edb9..917789f2ed51 100644 --- a/sys/geom/uzip/g_uzip.c +++ b/sys/geom/uzip/g_uzip.c @@ -467,7 +467,6 @@ g_uzip_taste(struct g_class *mp, struct g_provider *pp, int flags) pp2 = g_new_providerf(gp, "%s", gp->name); pp2->sectorsize = 512; pp2->mediasize = (off_t)sc->nblocks * sc->blksz; - pp2->flags = pp->flags & G_PF_CANDELETE; pp2->stripesize = pp->stripesize; pp2->stripeoffset = pp->stripeoffset; g_error_provider(pp2, 0);