Lines 205-210
g_concat_access(struct g_provider *pp, int dr, int dw, int de)
Link Here
|
205 |
return (error); |
205 |
return (error); |
206 |
} |
206 |
} |
207 |
|
207 |
|
|
|
208 |
static void |
209 |
g_concat_can_delete(struct bio *bp) |
210 |
{ |
211 |
struct g_concat_softc *sc; |
212 |
struct g_concat_disk *disk; |
213 |
int i, *val; |
214 |
|
215 |
val = (int *)bp->bio_data; |
216 |
*val = 0; |
217 |
|
218 |
sc = bp->bio_to->geom->softc; |
219 |
for (i = 0; i < sc->sc_ndisks; i++) { |
220 |
disk = &sc->sc_disks[i]; |
221 |
if (!disk->d_removed && disk->d_candelete) { |
222 |
*val = 1; |
223 |
break; |
224 |
} |
225 |
} |
226 |
g_io_deliver(bp, 0); |
227 |
} |
228 |
|
208 |
static void |
229 |
static void |
209 |
g_concat_kernel_dump(struct bio *bp) |
230 |
g_concat_kernel_dump(struct bio *bp) |
210 |
{ |
231 |
{ |
Lines 327-332
g_concat_start(struct bio *bp)
Link Here
|
327 |
if (strcmp("GEOM::kerneldump", bp->bio_attribute) == 0) { |
348 |
if (strcmp("GEOM::kerneldump", bp->bio_attribute) == 0) { |
328 |
g_concat_kernel_dump(bp); |
349 |
g_concat_kernel_dump(bp); |
329 |
return; |
350 |
return; |
|
|
351 |
} else if (strcmp("GEOM::candelete", bp->bio_attribute) == 0) { |
352 |
g_concat_can_delete(bp); |
353 |
return; |
330 |
} |
354 |
} |
331 |
/* To which provider it should be delivered? */ |
355 |
/* To which provider it should be delivered? */ |
332 |
/* FALLTHROUGH */ |
356 |
/* FALLTHROUGH */ |
Lines 408-413
g_concat_check_and_run(struct g_concat_softc *sc)
Link Here
|
408 |
struct g_provider *dp, *pp; |
432 |
struct g_provider *dp, *pp; |
409 |
u_int no, sectorsize = 0; |
433 |
u_int no, sectorsize = 0; |
410 |
off_t start; |
434 |
off_t start; |
|
|
435 |
int error; |
411 |
|
436 |
|
412 |
g_topology_assert(); |
437 |
g_topology_assert(); |
413 |
if (g_concat_nvalid(sc) != sc->sc_ndisks) |
438 |
if (g_concat_nvalid(sc) != sc->sc_ndisks) |
Lines 425-430
g_concat_check_and_run(struct g_concat_softc *sc)
Link Here
|
425 |
if (sc->sc_type == G_CONCAT_TYPE_AUTOMATIC) |
450 |
if (sc->sc_type == G_CONCAT_TYPE_AUTOMATIC) |
426 |
disk->d_end -= dp->sectorsize; |
451 |
disk->d_end -= dp->sectorsize; |
427 |
start = disk->d_end; |
452 |
start = disk->d_end; |
|
|
453 |
if (g_access(disk->d_consumer, 1, 0, 0) == 0) { |
454 |
error = g_getattr("GEOM::candelete", disk->d_consumer, |
455 |
&disk->d_candelete); |
456 |
if (error != 0) |
457 |
disk->d_candelete = 0; |
458 |
(void)g_access(disk->d_consumer, -1, 0, 0); |
459 |
} |
428 |
if (no == 0) |
460 |
if (no == 0) |
429 |
sectorsize = dp->sectorsize; |
461 |
sectorsize = dp->sectorsize; |
430 |
else |
462 |
else |