FreeBSD Bugzilla – Attachment 198680 Details for
Bug 232676
gconcat fails to advertise delete capability
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
candidate patch
g_concat_delete.diff (text/plain), 1.70 KB, created by
Mark Johnston
on 2018-10-26 21:06:46 UTC
(
hide
)
Description:
candidate patch
Filename:
MIME Type:
Creator:
Mark Johnston
Created:
2018-10-26 21:06:46 UTC
Size:
1.70 KB
patch
obsolete
>diff --git a/sys/geom/concat/g_concat.c b/sys/geom/concat/g_concat.c >index 8e1a5dd60698..1a992e26847a 100644 >--- a/sys/geom/concat/g_concat.c >+++ b/sys/geom/concat/g_concat.c >@@ -205,6 +205,27 @@ g_concat_access(struct g_provider *pp, int dr, int dw, int de) > return (error); > } > >+static void >+g_concat_can_delete(struct bio *bp) >+{ >+ struct g_concat_softc *sc; >+ struct g_concat_disk *disk; >+ int i, *val; >+ >+ val = (int *)bp->bio_data; >+ *val = 0; >+ >+ sc = bp->bio_to->geom->softc; >+ for (i = 0; i < sc->sc_ndisks; i++) { >+ disk = &sc->sc_disks[i]; >+ if (!disk->d_removed && disk->d_candelete) { >+ *val = 1; >+ break; >+ } >+ } >+ g_io_deliver(bp, 0); >+} >+ > static void > g_concat_kernel_dump(struct bio *bp) > { >@@ -327,6 +348,9 @@ g_concat_start(struct bio *bp) > if (strcmp("GEOM::kerneldump", bp->bio_attribute) == 0) { > g_concat_kernel_dump(bp); > return; >+ } else if (strcmp("GEOM::candelete", bp->bio_attribute) == 0) { >+ g_concat_can_delete(bp); >+ return; > } > /* To which provider it should be delivered? */ > /* FALLTHROUGH */ >@@ -425,6 +449,9 @@ g_concat_check_and_run(struct g_concat_softc *sc) > if (sc->sc_type == G_CONCAT_TYPE_AUTOMATIC) > disk->d_end -= dp->sectorsize; > start = disk->d_end; >+ if (g_getattr("GEOM::candelete", disk->d_consumer, >+ &disk->d_candelete) != 0) >+ disk->d_candelete = 0; > if (no == 0) > sectorsize = dp->sectorsize; > else >diff --git a/sys/geom/concat/g_concat.h b/sys/geom/concat/g_concat.h >index 09cc554b1968..da7b6ff72202 100644 >--- a/sys/geom/concat/g_concat.h >+++ b/sys/geom/concat/g_concat.h >@@ -74,6 +74,7 @@ struct g_concat_disk { > struct g_concat_softc *d_softc; > off_t d_start; > off_t d_end; >+ int d_candelete; > int d_removed; > }; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 232676
:
198680
|
198757
|
200534
|
200535