| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Add device geometry to the fdisk API. While it maintains traditional behaviour, the cylinders
are changed to sector_t instead of unsigned int in order to avoid dealing with truncated cylinders.
A new helper is added to compute the amount of cylinders based on the heads and sectors - if a user passed
-H or -S to the program, it must call this function to update the corresponding values.
This patch passes regression tests.
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds to the fdisk API the relevant logic to buffers that have MBR. This also serves for
future GPT support for the protective MBR. All labels have been updated to have access to the cxt
structure for the corresponding buffer.
An important observation is that SGI no longer uses the standard qsort(3) function to sort partitions,
as it needs access to cxt. To address this, a heap sort implementation from the kernel was added to
the label code and adapted to fdisk.
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using a variable for each supported partition table type doesn't seem necessary.
This fixes also a minor bug in switching from SGI label to SUN label: the expert
menu isn't available as sgi_label variable remains set to true.
Code a bit more clear as *_label names have similarity with names such as
"sgilabel", "struct sun_label".
Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gcc 4.4 produces tons of
"dereferencing type-punned pointer will break strict-aliasing rules"
warnings for fdisk code where is
char buffer[BUFSIZ];
((struct disklabel *) MBRBuffer)->foo
There are two ways how fix the problem:
1/ union {
char buffer[BUFSIZ], struct disklabel label
} MBRBuffer;
2/ use allocated buffer, this way seems less invasive.
This patch implements 2/.
Old version:
$ make -C fdisk | grep -c warning
236
New version:
$ make -C fdisk | grep -c warning
0
About aliasing:
- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40665
- http://cellperformance.beyond3d.com/articles/2006/06/understanding-strict-aliasing.html
- C99
Signed-off-by: Karel Zak <kzak@redhat.com>
|
| |
|
| |
|
| |
|
|
|