summaryrefslogtreecommitdiffstats
path: root/sys/geom/part/g_part.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2014-11-18 17:06:40 +0000
committerimp <imp@FreeBSD.org>2014-11-18 17:06:40 +0000
commit3c75037f3e1c19fb43fc3d662c253fe3c772ba05 (patch)
tree8dde40502b11a9a0ef847a1c8a7f75b182e47845 /sys/geom/part/g_part.c
parentf64af8af37042a49bb9d67a03ba65da156be79ae (diff)
downloadFreeBSD-src-3c75037f3e1c19fb43fc3d662c253fe3c772ba05.zip
FreeBSD-src-3c75037f3e1c19fb43fc3d662c253fe3c772ba05.tar.gz
Implement the historic DIOCGDINFO ioctl for gpart on BSD
partitions. Several utilities still use this interface and require additional information since gpart was activated than before. This allows fsck of a UFS partition without having to specify it is UFS, per historic behavior.
Diffstat (limited to 'sys/geom/part/g_part.c')
-rw-r--r--sys/geom/part/g_part.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c
index 9a1730b..5808236 100644
--- a/sys/geom/part/g_part.c
+++ b/sys/geom/part/g_part.c
@@ -143,6 +143,7 @@ static g_orphan_t g_part_orphan;
static g_spoiled_t g_part_spoiled;
static g_start_t g_part_start;
static g_resize_t g_part_resize;
+static g_ioctl_t g_part_ioctl;
static struct g_class g_part_class = {
.name = "PART",
@@ -159,7 +160,8 @@ static struct g_class g_part_class = {
.orphan = g_part_orphan,
.spoiled = g_part_spoiled,
.start = g_part_start,
- .resize = g_part_resize
+ .resize = g_part_resize,
+ .ioctl = g_part_ioctl,
};
DECLARE_GEOM_CLASS(g_part_class, g_part);
@@ -2059,6 +2061,25 @@ g_part_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp,
}
}
+/*-
+ * This start routine is only called for non-trivial requests, all the
+ * trivial ones are handled autonomously by the slice code.
+ * For requests we handle here, we must call the g_io_deliver() on the
+ * bio, and return non-zero to indicate to the slice code that we did so.
+ * This code executes in the "DOWN" I/O path, this means:
+ * * No sleeping.
+ * * Don't grab the topology lock.
+ * * Don't call biowait, g_getattr(), g_setattr() or g_read_data()
+ */
+static int
+g_part_ioctl(struct g_provider *pp, u_long cmd, void *data, int fflag, struct thread *td)
+{
+ struct g_part_table *table;
+
+ table = pp->geom->softc;
+ return G_PART_IOCTL(table, pp, cmd, data, fflag, td);
+}
+
static void
g_part_resize(struct g_consumer *cp)
{
OpenPOWER on IntegriCloud