svn commit: r190849 - head/sys/geom/part
Marcel Moolenaar
xcllnt at mac.com
Wed Apr 8 10:36:00 PDT 2009
On Apr 8, 2009, at 10:12 AM, Max Laier wrote:
> On Wednesday 08 April 2009 18:18:17 Marcel Moolenaar wrote:
>> Author: marcel
>> Date: Wed Apr 8 16:18:16 2009
>> New Revision: 190849
>> URL: http://svn.freebsd.org/changeset/base/190849
>>
>> Log:
>> Don't use hexadecimal in the EBR partition names, because 'a'..'f'
>> are more commonly known as BSD partition names.
>>
>> Discussed with: ivoras@
>>
>> Modified:
>> head/sys/geom/part/g_part_ebr.c
>>
>> Modified: head/sys/geom/part/g_part_ebr.c
>> =
>> =
>> =
>> =
>> =
>> =
>> =====================================================================
>> === --- head/sys/geom/part/g_part_ebr.c Wed Apr 8 16:12:28 2009
>> (r190848)
>> +++ head/sys/geom/part/g_part_ebr.c Wed Apr 8 16:18:16 2009
>> (r190849) @@
>> -344,7 +344,7 @@ g_part_ebr_name(struct g_part_table *tab
>> char *buf, size_t bufsz)
>> {
>>
>> - snprintf(buf, bufsz, "+%08x", entry->gpe_index);
>
> Not to bikeshed, but why not use "+%08X" instead?
"gpart show" prints the index in decimal. By using decimal
in the device name, you don't have to convert between dec
and hex when you need to derive the device name from the
index:
fbsdvm% gpart show md0s1
=> 0 262134 md0s1 EBR (128M)
0 131067 1 freebsd (64M)
131067 131067 14564 freebsd (64M)
fbsdvm% ls /dev/md0s1* | cat
/dev/md0s1
/dev/md0s1+00000001
/dev/md0s1+00014564
The leading zeroes are annoying in this respect. I think
it's more readable to have:
not-real% ls /dev/md0s1* | cat
/dev/md0s1
/dev/md0s1+1
/dev/md0s1+14564
But this affects alphabetical ordering, as in:
/dev/md0s1+100
/dev/md0s1+2
Ah well...
--
Marcel Moolenaar
xcllnt at mac.com
More information about the svn-src-all
mailing list