OpenBSD CVS

CVS log for src/sbin/pdisk/partition_map.h


[BACK] Up to [local] / src / sbin / pdisk

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.42 / (download) - annotate - [select for diffs], Sun Jan 31 23:00:11 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9, HEAD
Changes since 1.41: +1 -2 lines
Diff to previous 1.41 (colored)

Nuke pointless map field 'physical_block' and just use 'sbBlkSize' which is
set to the same value.

Revision 1.41 / (download) - annotate - [select for diffs], Sun Jan 31 15:28:56 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.40: +2 -2 lines
Diff to previous 1.40 (colored)

Just call contains_driver() when you need to know rather than carrying a
flag around. More obviously current data. Nuke unnecessary variables
when displaying a partition.

Revision 1.40 / (download) - annotate - [select for diffs], Sun Jan 31 14:55:41 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.39: +1 -3 lines
Diff to previous 1.39 (colored)

Move dump_block() declaration from io.h to io.c since it is not
used anywhere else.

Remove declarations of non-existant kPatchType and init_partition_map().

Revision 1.39 / (download) - annotate - [select for diffs], Sat Jan 30 17:28:34 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.38: +1 -3 lines
Diff to previous 1.38 (colored)

Zap a couple of declarations for non-existant variable and function.

Revision 1.38 / (download) - annotate - [select for diffs], Sat Jan 30 17:21:10 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.37: +6 -1 lines
Diff to previous 1.37 (colored)

Move last three lines (#define's) from dpme.h to partition_map.h and
tweak #include's as necessary.

Revision 1.37 / (download) - annotate - [select for diffs], Sat Jan 30 17:09:11 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.36: +32 -4 lines
Diff to previous 1.36 (colored)

Fold struct dpme into struct entry. Same reasons as for folding
struct block0 into struct partition_map. Easier to read code.

Revision 1.36 / (download) - annotate - [select for diffs], Fri Jan 29 22:51:43 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.35: +18 -2 lines
Diff to previous 1.35 (colored)

Fold struct block0 into struct partition map. There can be only one
and read/write_block0() can move the data from/to disk to/from
appropriate fields anywhere. Removes a bunch of dereferencing,
malloc'ing and pointer checking.

Revision 1.35 / (download) - annotate - [select for diffs], Fri Jan 29 15:06:37 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.34: +13 -17 lines
Diff to previous 1.34 (colored)

Shorter names means a few whitespace adjustments.

Revision 1.34 / (download) - annotate - [select for diffs], Fri Jan 29 14:54:38 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.33: +15 -15 lines
Diff to previous 1.33 (colored)

Rename struct partition_map_header to struct partition_map. No change to
.o files.

Revision 1.33 / (download) - annotate - [select for diffs], Fri Jan 29 14:48:20 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.32: +19 -19 lines
Diff to previous 1.32 (colored)

Rename struct partition_map to struct entry. No change to .o files.

Revision 1.32 / (download) - annotate - [select for diffs], Thu Jan 28 22:09:56 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.31: +3 -4 lines
Diff to previous 1.31 (colored)

Flip base_order to a LIST().

Revision 1.31 / (download) - annotate - [select for diffs], Thu Jan 28 19:07:45 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.30: +5 -4 lines
Diff to previous 1.30 (colored)

Hand rolled lists suck. First, replace disk_order with an LIST.

Revision 1.30 / (download) - annotate - [select for diffs], Wed Jan 27 14:47:53 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.29: +3 -4 lines
Diff to previous 1.29 (colored)

We do not support logical_block != physical_block. Remove logical_block
field and left over code that checks for logical != physical.

Removes confusion with dmpe fields lblock_start and lblocks, which
have nothing to do with block sizes! lblock_start is the block
offset within the partition where the data actually starts. and
lblocks is the number of blocks of data within the partition. Both
are in units of *physical blocks*, a.k.a. disk sectors.

Revision 1.29 / (download) - annotate - [select for diffs], Sun Jan 24 01:38:32 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.28: +21 -15 lines
Diff to previous 1.28 (colored)

Whitespace fixes.

Revision 1.28 / (download) - annotate - [select for diffs], Sat Jan 23 23:25:58 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.27: +1 -4 lines
Diff to previous 1.27 (colored)

Nuke unused kPatchType. Nuke kStringNot and use " not' where needed.
Nuke kStringEmpty and use "" where needed. Nuke unused static 'g'.

Eliminate #include's in *.h files.

Some whitespace fixes.

Revision 1.27 / (download) - annotate - [select for diffs], Sat Jan 23 15:05:52 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.26: +5 -3 lines
Diff to previous 1.26 (colored)

Pass the disk sector size to open_partition_map(), eliminating it's
internal need for DEV_BSIZE. Ditto create_partition_map().

malloc((sizeof(struct [block0|dpme])) instead of malloc(DEV_BSIZE).

Remove another #include <param.h>.

Revision 1.26 / (download) - annotate - [select for diffs], Fri Jan 22 18:57:42 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.25: +2 -2 lines
Diff to previous 1.25 (colored)

Change partition map field 'data' to 'dmpe'. Change 'create_data'
to 'create_dmpe'. Sweep up some 'struct dpme *data' to struct dpme
*dpme'.

Revision 1.25 / (download) - annotate - [select for diffs], Fri Jan 22 17:35:16 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored)

Rename map field 'misc' to 'block0' since that's what it is.

Revision 1.24 / (download) - annotate - [select for diffs], Fri Jan 22 17:29:37 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.23: +26 -26 lines
Diff to previous 1.23 (colored)

Whitespace fixes.

Revision 1.23 / (download) - annotate - [select for diffs], Fri Jan 22 04:16:25 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored)

Repair creation of initial partition table on a blank disk, broken
when hoisting file operations and ioctl to main(). Pass media size
to open_partition_map() and create_partition_map() so they can
properly initialize a map.

Revision 1.22 / (download) - annotate - [select for diffs], Fri Jan 22 01:25:56 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.21: +1 -2 lines
Diff to previous 1.21 (colored)

In the "why use two variables when one would do" category, eliminate
the 'written' field and just use the 'changed' field to mediate
when it is appropriate to ask whether changes should be discarded.

Revision 1.21 / (download) - annotate - [select for diffs], Thu Jan 21 15:33:21 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.20: +8 -6 lines
Diff to previous 1.20 (colored)

Hoist all file opening and ioctl calls into main(), passing a pointer to
a valid map to edit(). Should enable pledging a la fdisk at some point.

Since edit() always gets a valid map (and maintains its validity even when
'I'nitializing a new one) many checks for (map == NULL) are junked.

Remove some dances around block sizes by using DEV_BSIZE everywhere
since we don't support non-DEV_BSIZE (a.k.a. 512-byte) sectors.

Remove many superfluous #include statements.

Revision 1.20 / (download) - annotate - [select for diffs], Thu Jan 21 02:52:52 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.19: +1 -2 lines
Diff to previous 1.19 (colored)

Nuke 'writable' field now that it is always in sync with 'rflag'. Since
(!rflag && writable == 0) can't be true remove those warning blocks and
simply leave the not-writable warning when attempting to write the
map. Always show 'w' in the help and rely on the check and warning
in do_write_partition_map() so the user always gets a message.

Revision 1.19 / (download) - annotate - [select for diffs], Mon Jan 18 17:57:35 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored)

struct file_media had 1 field left. And one place where struct
file_media was actually stored. So move the last field (fd) into
the place formerly used to store pointer to the instance. As a
result we can just pass fd's around rather than pointers to a struct
containing a fd.

close_file_media() becomes empty but for a close(). So just use
close() and nuke close_file_media().

Revision 1.18 / (download) - annotate - [select for diffs], Mon Jan 18 00:04:36 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.17: +1 -10 lines
Diff to previous 1.17 (colored)

Remove a grab bag of unused #define's, fields, enum's, variables,
functions.

Revision 1.17 / (download) - annotate - [select for diffs], Sun Jan 17 23:18:19 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.16: +13 -13 lines
Diff to previous 1.16 (colored)

Change "//" comments to "/**/". Nuke really stupid ones.

Revision 1.16 / (download) - annotate - [select for diffs], Sun Jan 17 19:39:20 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.15: +12 -12 lines
Diff to previous 1.15 (colored)

Reduce namespace pollution by eliminating parameter names from forward
declarations.

Revision 1.15 / (download) - annotate - [select for diffs], Sun Jan 17 18:57:52 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.14: +1 -22 lines
Diff to previous 1.14 (colored)

Remove a bunch of ridiculous and uninformative comments like "// Defines".

Revision 1.14 / (download) - annotate - [select for diffs], Sun Jan 17 18:44:59 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.13: +3 -3 lines
Diff to previous 1.13 (colored)

The great de-typedef'ification concludes with u32 -> uint32_t. And a
bunch of consequent printf() format corrections.

Revision 1.13 / (download) - annotate - [select for diffs], Sun Jan 17 17:44:05 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.12: +13 -15 lines
Diff to previous 1.12 (colored)

The great de-typedef'ification continues.

partition_map -> struct partition_map
partition_map_header -> struct partition_map_header

Revision 1.12 / (download) - annotate - [select for diffs], Sun Jan 17 16:15:59 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored)

The great de-typedef'ification continues. Block0 -> struct block0.

Revision 1.11 / (download) - annotate - [select for diffs], Sun Jan 17 16:07:06 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.10: +3 -3 lines
Diff to previous 1.10 (colored)

The great de-typedef'ification continues. DPME -> struct dpme.

Revision 1.10 / (download) - annotate - [select for diffs], Sun Jan 17 15:57:12 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

Let the great de-typedef'ification begin. MEDIA -> struct file_media *.

Revision 1.9 / (download) - annotate - [select for diffs], Sun Jan 17 14:28:25 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.8: +1 -2 lines
Diff to previous 1.8 (colored)

A/UX is no more, was m68k only, and we have no sentimental reasons for
keeping support.

Revision 1.8 / (download) - annotate - [select for diffs], Sat Jan 16 22:28:14 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.7: +3 -3 lines
Diff to previous 1.7 (colored)

Move last field (size_in_bytes) in struct media to struct file_media
and replace MEDIA with FILE_MEDIA everywhere. media.h becomes unused.

Revision 1.7 / (download) - annotate - [select for diffs], Fri Jan 15 23:05:00 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.6: +1 -3 lines
Diff to previous 1.6 (colored)

We don't need yet another alias for DEV_BSIZE. Use DEV_BSIZE and
nuke PBLOCK_SIZE and another unused #define.

Revision 1.6 / (download) - annotate - [select for diffs], Thu Jan 14 04:17:40 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.5: +1 -2 lines
Diff to previous 1.5 (colored)

Nuke 'HFS_name' field which was not referenced now other than setting
it and freeing it. Unhook hfs_misc.c from build since it now longer
contains anything being used.

Revision 1.5 / (download) - annotate - [select for diffs], Tue Jan 12 15:32:08 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.4: +2 -3 lines
Diff to previous 1.4 (colored)

Retire '-i', a poorly documented interactive mode that tries to
mimic the 20th century MacOS version of pdisk more closely than the
usual interactive editor. One set of commands is enough for anyone.

ok jasper@

Revision 1.4 / (download) - annotate - [select for diffs], Mon Jan 11 07:54:07 2016 UTC (8 years, 4 months ago) by jasper
Branch: MAIN
Changes since 1.3: +2 -0 lines
Diff to previous 1.3 (colored)

add rcs ids

Revision 1.3 / (download) - annotate - [select for diffs], Thu Apr 27 19:52:21 2006 UTC (18 years, 1 month ago) by martin
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.2: +19 -4 lines
Diff to previous 1.2 (colored)

update for pdisk 0.8a2, from NetBSD, retaining our local changes;
summing it up:

- Clean up sources - fix naming, delete old email addresses
- Added support for display of Mac volume names
- Fix block 0 display to show logical offset of drivers
- Require confirmation of quit without write
- Fix iteration to not complain about missing devices
- Warn when creating/writing a map with more than 15 entries

and, most important, add do_update_dpme() which allows us to partition
OpenBSD slices without previous MacOS setup.

Tested with shared MacOS install on macppc, procedure there remains the
same.

grammer and spelling help and ok jmc@

ok miod@

Revision 1.2 / (download) - annotate - [select for diffs], Sun Jun 9 08:13:08 2002 UTC (21 years, 11 months ago) by todd
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4, OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.1: +17 -17 lines
Diff to previous 1.1 (colored)

rm trailing whitespace

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Sat Mar 24 00:14:10 2001 UTC (23 years, 2 months ago) by drahn
Branch: apple19980218
CVS Tags: ver1, OPENBSD_3_1_BASE, OPENBSD_3_1, OPENBSD_3_0_BASE, OPENBSD_3_0, OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

Import of pdisk from apple, BSD licensed code. Archive dated Feb 18 1998 
This is a HFS partition editing tool.

Revision 1.1 / (download) - annotate - [select for diffs], Sat Mar 24 00:14:10 2001 UTC (23 years, 2 months ago) by drahn
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.