summaryrefslogtreecommitdiffstats
path: root/fdisk/fdiskbsdlabel.c
Commit message (Collapse)AuthorAgeFilesLines
* build-sys: rename fdisk -> fdisks/, convert to moduleKarel Zak2012-06-261-847/+0Star
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: API: add geometryDavidlohr Bueso2012-06-211-7/+5Star
| | | | | | | | | | | 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>
* fdisk: add device topology to the APIDavidlohr Bueso2012-06-061-9/+9
| | | | | | | | | | | | | | | | | | | | | | | This patch adds device topology discovery to the internal API. This functionality is static only to the API and therefore hidden from general fdisk code. Functionality itself doesn't really change, min_io_size, io_size, logical and physical sector sizes and alignment offset are added to the fdisk_context structure and elements are accessed from there. The logical sector size (sector_size) is now unsigned long instead of unsigned int, this as no effect otherwise. A few things to notice: - The patch is larger than I wanted but we need to modify function parameters across fdisk and its labels to use the topology data from cxt-> instances. Hopefully this will be pretty much it regarding this kind of modifications - perhaps geometry will need something of the like too. - The -b option must override internal discovery. - A new helper function has added to verify if the device provides topology information, this replaces the 'has_topology' global variable. Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* fdisk: use context as a parameterDavidlohr Bueso2012-06-061-42/+44
| | | | | | | | | | | | | | | | | This program heavily uses global variables, which isn't very elegant and can lead to nasty bugs. Modify functions that use fdisk's context current features (descriptor and path), to receive the context as a parameter instead of globally. This includes DOS, SUN, SGI and BSD label code. Another benefit that comes with this is that as the API grows all the information regarding fdisk will be accessible from this structure so we can reduce even more global variables and simply code. This patch passed: - building - regression tests - local dos/sun/bsd partition changes Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* fdisk: introduce fdisk contextDavidlohr Bueso2012-05-231-22/+22
| | | | | | | | | | | | | | | | | | This is the first patch that adds the initial parts of the new fdisk internal API. Two functions are created to both init and deinit the fdisk context. Only the device's descriptor and path are added as a start and these are replaced throughout fdisk.c and label specific code. All logic that opens the file does it with fdisk_new_context_from_filename(), and this enforces always opening the device with rw, then, if unsuccesfull, with read-only. This changes the current logic that opens the device with certain permissions depending on the user given options. For example, -l opens the device read-only. This patch passed regression tests and local modifications for sgi/dos/sun disk labels. Signed-off-by: Davidlohr Bueso <dave@gnu.org>
* fdisk: rewrite print menu systemFrancesco Cosoleto2011-11-141-22/+1Star
| | | | | | | | | | DOS and SGI label menus are unchanged. BSD label command descriptions change slightly to use a common form. This also removes an useless menu entry in SUN label menu to edit bsd disklabel. Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* fdisk: rename bselect, xselect functionsFrancesco Cosoleto2011-11-141-1/+2
| | | | Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
* fdisk: fix compiler warnings [-Wunused-parameter -Wsign-compare]Karel Zak2011-08-011-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk, display, hexdump.h: Use standard C types instead of u_int, u_char, ↵Josiah Worcester2011-06-141-17/+17
| | | | | | u_long, etc. Signed-off-by: Josiah Worcester <josiahw@gmail.com>
* fdisk: re-print prompt after maybe_exit()Karel Zak2011-01-051-2/+2
| | | | | | | | | | | | | | | after Do you really want to quit? n the read_chars() has to re-print the original prompt and ask again for new input. For example: Partition number (1-4, default 3): <-- CTRL-D Do you really want to quit? n Partition number (1-4, default 3): 3 <-- ask again First sector (411648-1023999, default 411648): Signed-off-by: Karel Zak <kzak@redhat.com>
* fdisk: replace bzero with memsetJon Ringle2010-03-311-2/+2
| | | | | | | Work on this was done in commit c0f19ccff73aa0ec5e9f3b61b932ea4a8bf4e6ed, however a couple of bzero call sites were missed Signed-off-by: Jon Ringle <jon@ringle.org>
* Remove now unused <sys/ioctl.h> includesGuillem Jover2009-10-091-1/+0Star
| | | | | | Those became unused with the switch to the blkdev functions. Signed-off-by: Guillem Jover <guillem@hadrons.org>
* replace bcopy,bzero,index and rindexDaniel Mierswa2009-08-171-6/+7
| | | | | | | | | Those 4 functions are marked as LEGACY in POSIX.1-2001 and removed in POSIX.1-2008. Replaced with memmove,memset,strchr and strrchr. Signed-off-by: Daniel Mierswa <impulze@impulze.org>
* fdisk: non-linux support (MAXPATHLEN)Karel Zak2007-11-261-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* Imported from util-linux-2.13-pre6 tarball.Karel Zak2006-12-071-4/+4
|
* Imported from util-linux-2.12 tarball.Karel Zak2006-12-071-6/+6
|
* Imported from util-linux-2.11x tarball.Karel Zak2006-12-071-1/+2
|
* Imported from util-linux-2.11t tarball.Karel Zak2006-12-071-117/+129
|
* Imported from util-linux-2.11r tarball.Karel Zak2006-12-071-2/+0Star
|
* Imported from util-linux-2.11m tarball.Karel Zak2006-12-071-4/+8
|
* Imported from util-linux-2.11f tarball.Karel Zak2006-12-071-6/+7
|
* Imported from util-linux-2.11b tarball.Karel Zak2006-12-071-10/+9Star
|
* Imported from util-linux-2.10m tarball.Karel Zak2006-12-071-159/+178
|
* Imported from util-linux-2.10f tarball.Karel Zak2006-12-071-26/+29
|
* Imported from util-linux-2.9v tarball.Karel Zak2006-12-071-73/+77
|
* Imported from util-linux-2.9i tarball.Karel Zak2006-12-071-0/+825