From owner-svn-src-all@FreeBSD.ORG Wed Nov 19 16:20:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EEFE44A4 for ; Wed, 19 Nov 2014 16:20:35 +0000 (UTC) Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com [209.85.220.53]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA0A0DA9 for ; Wed, 19 Nov 2014 16:20:34 +0000 (UTC) Received: by mail-pa0-f53.google.com with SMTP id kq14so542375pab.12 for ; Wed, 19 Nov 2014 08:20:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=h5IpmmFAc+yGJAbWOnlwdwRLNn5o/hjmkGFiLpFCoIQ=; b=jPu06wudtvbvKDXP0o2Dr9F+8U86er0N1TKGXRgvgxHU+Ac0XwTYkzAFUymuKoj8kf PdZgCf0kJ0IeYuioqO7XgClgOe0aE5JIfcndDvn+uBROTJKo9y/vNeCePi06J76UF3OL VhyTa1+T52CazXOxoe9Z5v3TykAA+or7n/QX9n7ajr1m0/jtD0LzK5PWQv09eMdoBHvA cRd2WjCfWIAAor3dqN8fZKLTj+Y8r11o01YcZGEfLX2o4hYRmWRdjvgcS10sEBWLIqE/ UVGUCWhNTRl/3c/JrKGvIUgh+NtlrIlriFUgCdi5rFTDcpNI9Yaq9pz3G3ExhLv0ifst Ytsg== X-Gm-Message-State: ALoCoQkVOUFThbcVQsLZBkAwov/qxM0iGrxXkLcAqGkmosuSlZuiQ4UJmr7vGphGdWR2iwqz2tl8 X-Received: by 10.68.98.196 with SMTP id ek4mr21982933pbb.150.1416414028674; Wed, 19 Nov 2014 08:20:28 -0800 (PST) Received: from [10.64.24.117] ([69.53.236.236]) by mx.google.com with ESMTPSA id q1sm2194905pdq.67.2014.11.19.08.20.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Nov 2014 08:20:28 -0800 (PST) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_5C7C2E36-A9DA-4759-B579-0E76A4E000EF"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r274661 - in head/sys: conf geom/part modules/geom/geom_part/geom_part_bsd From: Warner Losh In-Reply-To: <546CC245.3070700@FreeBSD.org> Date: Wed, 19 Nov 2014 09:20:24 -0700 Message-Id: References: <201411181706.sAIH6eS9051888@svn.freebsd.org> <546CC245.3070700@FreeBSD.org> To: "Andrey V. Elsukov" X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2014 16:20:36 -0000 --Apple-Mail=_5C7C2E36-A9DA-4759-B579-0E76A4E000EF Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On Nov 19, 2014, at 9:16 AM, Andrey V. Elsukov wrote: > On 18.11.2014 20:06, Warner Losh wrote: >> Author: imp >> Date: Tue Nov 18 17:06:40 2014 >> New Revision: 274661 >> URL: https://svnweb.freebsd.org/changeset/base/274661 >>=20 >> Log: >> 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. >=20 >> + */ >> +static int >> +g_part_bsd_ioctl(struct g_part_table *basetable, struct g_provider = *pp, >> + u_long cmd, void *data, int fflag, struct thread *td) >> +{ >> + >> + switch (cmd) >> + { >> + case DIOCGDINFO: >> + { >> + struct g_part_bsd_table *table; >> + u_char *p; >> + >> + table =3D (struct g_part_bsd_table *)basetable; >> + p =3D table->bbarea + pp->sectorsize; >> + return (bsd_disklabel_le_dec(p, data, MAXPARTITIONS)); >=20 > Probably you need to use basetable->gpt_entries here instead of > MAXPARTITIONS. I=92m having trouble connecting the dots between GPT and BSDlabels. Why = would this field be relevant? Is it just poorly named? MAXPARTITIONS is = the number of partitions we support. It=92s always a constant. While = there are other BSD label formats that have differing numbers, I don=92t = think gpart supports those. But as always, I=92m always on the lookout = for code improvements. Warner --Apple-Mail=_5C7C2E36-A9DA-4759-B579-0E76A4E000EF Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJUbMNIAAoJEGwc0Sh9sBEAw+oP/2h9WDBUPHiDd4GL8RrgXFkk 9elPy5nHAiYzsHe/56pzUGCMTBpCLKkgZn5ilgmhGeGs5jNPCbhCZjir1vJ6Wtmi 189+DqrUUFTqLcxW9KoL5guGZsXwEc5xl9WkG7TyPf7pkXg7LVVcVHsBcXiWM5RO upwHnAaOj+I72NhP0OFifSTxXObqpMDHK7OY8ddYRiYCEOwAdE8Kzk72rif7sADy 3Z64V4yweoouVkAZTGNlI9Zh/KE88H2aUB6xy/rzAJPuEVs0sA+Soh+SjVhRrOC3 TpievCULrQ3fyv5PutIqOFMgdiH8TMCDCnTZ4smxn1X32covzRXZCPNBYOQBfPcK U+exl6kVe7bKIg4Jla1HkcOcmFXHN0hYsPxtcR6OX4tQTlZ9F9m8Y5VAKYZ5Z4UE F8Vt7UIAzW6QCzWvQZT1yfvNzLPYhI2NRaSc6Ln/CS1YHo2HpSEmHWB/nLrQvWwD tgWQ4fS4LrtZYY05C9KPvnJkxPTYyjv/VF8ER5vtGzILbOmZSuAjefLIV1dbdF53 vUeQVdc0jI65ZhhBO7dfTh8IPqJT7U9VMt9EW8fCZH+IeZvFHfOf/ZQ0RuB0NyEQ cPfJwwfsrgQyK+qPxS+3wjQVlsgujTxCEwwTA5NiiY//4Xdl7WvyAi8kYVtTI/Eg adiIs5Bc+2WtYT67GIxQ =nVij -----END PGP SIGNATURE----- --Apple-Mail=_5C7C2E36-A9DA-4759-B579-0E76A4E000EF--