Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Nov 2014 09:20:24 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        "Andrey V. Elsukov" <ae@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers <src-committers@freebsd.org>, Warner Losh <imp@FreeBSD.org>
Subject:   Re: svn commit: r274661 - in head/sys: conf geom/part modules/geom/geom_part/geom_part_bsd
Message-ID:  <B523D699-9766-4806-9499-68FD9FF84437@bsdimp.com>
In-Reply-To: <546CC245.3070700@FreeBSD.org>
References:  <201411181706.sAIH6eS9051888@svn.freebsd.org> <546CC245.3070700@FreeBSD.org>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]

On Nov 19, 2014, at 9:16 AM, Andrey V. Elsukov <ae@FreeBSD.org> 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
>> 
>> 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.
> 
>> + */
>> +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 = (struct g_part_bsd_table *)basetable;
>> +		p = table->bbarea + pp->sectorsize;
>> +		return (bsd_disklabel_le_dec(p, data, MAXPARTITIONS));
> 
> Probably you need to use basetable->gpt_entries here instead of
> MAXPARTITIONS.

I’m 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’s always a constant. While there are other BSD label formats that have differing numbers, I don’t think gpart supports those. But as always, I’m always on the lookout for code improvements.

Warner

[-- Attachment #2 --]
-----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-----
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B523D699-9766-4806-9499-68FD9FF84437>