| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
tweak #include's as necessary.
|
|
|
|
| |
struct block0 into struct partition_map. Easier to read code.
|
|
|
|
|
| |
a malloc() or calloc() fails. Simplifies a bunch of logic, makes
add_data_to_map() always succeed or exit, so make it a void.
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
of the existing code.
|
|
|
|
|
|
|
| |
strlcpy() to fill them.
They are also supposed to be NUL-padded so zap previous contents
before copying in possibly shorter new values.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
endian or alignment issues forcefully. Removes need for convert_*
functions so unhook convert.c from build. read/write_block become
static functions inside file_media.c.
Tweak struct block0 to stop trying to handle alignment issues by clever
declaration. Rely on the new functions to accurately translate between
on-disk and in-memory layouts.
Enables pdisk to work on amd64 and likely other architectures if
it's ever desirable. Does bring back DEV_BSIZE to pdisk.c since the
in-memory structure will *not* be 512 bytes on other archs.
|
| |
|
|
|
|
|
|
|
|
|
| |
instead of off_t values. Do the DEV_BSIZE multiplication in these two
functions.
Easier to read code and kills two #include <sys/param.h>.
Kill unused label.
|
|
|
|
|
| |
write_block() and write_file_media(). One layer of read/write
wrappers for pread/pwrite should be enough for anyone.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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().
|
|
|
|
|
| |
Just use pread/pwrite and report error emanating from them. No more
uses of size_in_byte field of struct file_media, so toss that too.
|
|
|
|
|
| |
a NULL pointer. And the result is ignored. Nuke it. This removes the only
use of the 'regular_file' field of struct file_media. So nuke that too.
|
|
|
|
| |
KNF'ish.
|
|
|
|
| |
functions.
|
| |
|
|
|
|
| |
declarations.
|
| |
|
| |
|
|
|
|
| |
and replace MEDIA with FILE_MEDIA everywhere. media.h becomes unused.
|
| |
|
|
|
|
|
|
| |
or store. Just use.
No functional change.
|
|
|
|
|
|
| |
media kind since it will always be the same -- a file.
No functional change.
|
|
|
|
|
|
|
|
|
|
| |
Since 'file' is the only kind of media, no need to call the appropriate
functions via pointers. Just call the _file_ variants directly.
Nuke the fields do_read(), do_write(), do_close(), do_os_reload()
and the functions read_media(), write_media(), close_media() and
os_reload_media().
No functional change.
|
|
|
|
|
|
|
| |
anything other than 512-byte sectors are encountered. Unlink
deblock_media.c from the build.
ok jasper@
|
|
|
|
|
| |
ask the disklabel as everyone else does. Add file name to
compute_block_size() parameters to make error messages nicer.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
#define llseek lseek
#define LOFF_T_MAX LLONG_MAX
I mean, really? Nuke'em and use off_t, lseek and LLONG_MAX.
Also make a couple of checks for overflow of off_t value more likely
to work.
ok millert@
|
|
|
|
|
|
| |
usage() to pdisk.c and nuke do_help() and '-h'.
ok jasper@ deraadt@
|
|
|
|
| |
anywhere, as evidenced by everything still compiling after they are gone.
|
|
|
|
|
|
| |
- unifdef notdef
ok krw@
|
|
|
|
| |
ok krw@
|
| |
|
| |
|
|
|
|
|
| |
malloc, calloc, realloc*
ok krw millert
|
|
|
|
|
| |
disklabel(8), and while at it, fix the usage code to not be utterly distasteful
ok drahn
|
| |
|
|
|
|
|
|
| |
cleaning the maze of ifdef's not relevant for us.
This round wipes most linux and/or MacOS-only bits, more to come.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
This is a HFS partition editing tool.
|