View | Details | Raw Unified | Return to bug 232676 | Differences between
and this patch

Collapse All | Expand All

(-)b/sys/geom/concat/g_concat.c (+27 lines)
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 425-430 g_concat_check_and_run(struct g_concat_softc *sc) Link Here
425
		if (sc->sc_type == G_CONCAT_TYPE_AUTOMATIC)
449
		if (sc->sc_type == G_CONCAT_TYPE_AUTOMATIC)
426
			disk->d_end -= dp->sectorsize;
450
			disk->d_end -= dp->sectorsize;
427
		start = disk->d_end;
451
		start = disk->d_end;
452
		if (g_getattr("GEOM::candelete", disk->d_consumer,
453
		    &disk->d_candelete) != 0)
454
			disk->d_candelete = 0;
428
		if (no == 0)
455
		if (no == 0)
429
			sectorsize = dp->sectorsize;
456
			sectorsize = dp->sectorsize;
430
		else
457
		else
(-)b/sys/geom/concat/g_concat.h (+1 lines)
Lines 74-79 struct g_concat_disk { Link Here
74
	struct g_concat_softc	*d_softc;
74
	struct g_concat_softc	*d_softc;
75
	off_t			 d_start;
75
	off_t			 d_start;
76
	off_t			 d_end;
76
	off_t			 d_end;
77
	int			 d_candelete;
77
	int			 d_removed;
78
	int			 d_removed;
78
};
79
};
79
80

Return to bug 232676