summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libfdisk/src/alignment.c6
-rw-r--r--libfdisk/src/context.c4
-rw-r--r--libfdisk/src/label.c4
-rw-r--r--libfdisk/src/partition.c12
-rw-r--r--libfdisk/src/parttype.c9
-rw-r--r--libfdisk/src/script.c12
-rw-r--r--libfdisk/src/table.c10
-rw-r--r--libfdisk/src/utils.c8
-rw-r--r--term-utils/agetty.c2
9 files changed, 60 insertions, 7 deletions
diff --git a/libfdisk/src/alignment.c b/libfdisk/src/alignment.c
index 09860703b..90f21bc69 100644
--- a/libfdisk/src/alignment.c
+++ b/libfdisk/src/alignment.c
@@ -193,11 +193,11 @@ static void recount_geometry(struct fdisk_context *cxt)
* @heads: user specified heads
* @sectors: user specified sectors
*
- * Overrides auto-discovery. The function fdisk_reset_device_properties()
+ * Overrides auto-discovery. The function fdisk_reset_device_properties()
* restores the original setting.
*
* The difference between fdisk_override_geometry() and fdisk_save_user_geometry()
- * is that saved user geometry is persistent setting and it's applied always
+ * is that saved user geometry is persistent setting and it's applied always
* when device is assigned to the context or device properties are reseted.
*
* Returns: 0 on success, < 0 on error.
@@ -238,7 +238,7 @@ int fdisk_override_geometry(struct fdisk_context *cxt,
*
* Save user defined geometry to use it for partitioning.
*
- * The user properties are applied by fdisk_assign_device() or
+ * The user properties are applied by fdisk_assign_device() or
* fdisk_reset_device_properties().
* Returns: <0 on error, 0 on success.
diff --git a/libfdisk/src/context.c b/libfdisk/src/context.c
index 5385baaae..698e71d93 100644
--- a/libfdisk/src/context.c
+++ b/libfdisk/src/context.c
@@ -197,6 +197,10 @@ void fdisk_ref_context(struct fdisk_context *cxt)
*
* If no @name specified then returns the current context label.
*
+ * The label is allocated and maintained within the context #cxt. There is
+ * nothing like reference counting for labels, you cannot delallocate the
+ * label.
+ *
* Returns: label struct or NULL in case of error.
*/
struct fdisk_label *fdisk_get_label(struct fdisk_context *cxt, const char *name)
diff --git a/libfdisk/src/label.c b/libfdisk/src/label.c
index 12ad1dc30..a12bc838e 100644
--- a/libfdisk/src/label.c
+++ b/libfdisk/src/label.c
@@ -10,7 +10,9 @@
* The fdisk_new_context() initializes all label drivers, and allocate
* per-label specific data struct. This concept allows to store label specific
* settings to the label driver independently on the currently active label
- * driver.
+ * driver. Note that lable struct cannot be deallocated, so there is no
+ * reference counting for fdisk_label objects. All is destroyed by
+ * fdisk_unref_context() only.
*
* Anyway, all label drives share in-memory first sector. The function
* fdisk_create_disklabel() overwrites the sector. But it's possible that
diff --git a/libfdisk/src/partition.c b/libfdisk/src/partition.c
index ee33d7bdf..1af3cf245 100644
--- a/libfdisk/src/partition.c
+++ b/libfdisk/src/partition.c
@@ -4,6 +4,18 @@
#include "fdiskP.h"
+/**
+ * SECTION: partition
+ * @title: partition abstraction
+ * @short_description: generic label independent partition
+ *
+ * The fdisk_partition provides label independent abstraction. The partitions
+ * are not directly connected with partition table (label) data. Any change to
+ * fdisk_partition does not affects in-memory or on-disk label data.
+ *
+ * The fdisk_partition is possible to use as a template for
+ * fdisk_add_partition() or fdisk_set_partition() operations.
+ */
static void init_partition(struct fdisk_partition *pa)
{
diff --git a/libfdisk/src/parttype.c b/libfdisk/src/parttype.c
index 2bcf69d6f..1e39eff10 100644
--- a/libfdisk/src/parttype.c
+++ b/libfdisk/src/parttype.c
@@ -2,9 +2,16 @@
#include <ctype.h>
#include "nls.h"
-
#include "fdiskP.h"
+/**
+ * SECTION: parttypw
+ * @title: Partition types
+ * @short_description: abstraction to partition types
+ *
+ * There are two basic types of parttypes, string based (e.g. GPT)
+ * and code/hex based (e.g. MBR).
+ */
/**
* fdisk_new_parttype:
diff --git a/libfdisk/src/script.c b/libfdisk/src/script.c
index 5047461d5..2353cb8a2 100644
--- a/libfdisk/src/script.c
+++ b/libfdisk/src/script.c
@@ -2,6 +2,18 @@
#include "fdiskP.h"
#include "strutils.h"
+/**
+ * SECTION: script
+ * @title: Partition table script
+ * @short_description: text based description of partition table
+ *
+ * The libfdisk scripts are based on original sfdisk script (dumps). Each
+ * script has two parts: script headers and partition table entries
+ * (partitions).
+ *
+ * For more details about script format see sfdisk man page.
+ */
+
/* script header (e.g. unit: sectors) */
struct fdisk_scriptheader {
struct list_head headers;
diff --git a/libfdisk/src/table.c b/libfdisk/src/table.c
index 63531f243..3a78e9e02 100644
--- a/libfdisk/src/table.c
+++ b/libfdisk/src/table.c
@@ -2,6 +2,16 @@
#include "fdiskP.h"
/**
+ * SECTION: table
+ * @title: table
+ * @short_description: container for fdisk partitions
+ *
+ * The fdisk_table is simple container for fdisk_partitions. The table is no
+ * directly connected to label data (partition table), and table changes don't
+ * affect in-memory or on-disk data.
+ */
+
+/**
* fdisk_new_table:
*
* The table is a container for struct fdisk_partition entries. The container
diff --git a/libfdisk/src/utils.c b/libfdisk/src/utils.c
index da6b01c2b..b705f9eb4 100644
--- a/libfdisk/src/utils.c
+++ b/libfdisk/src/utils.c
@@ -4,6 +4,12 @@
#include <ctype.h>
+/**
+ * SECTION: utils
+ * @title: Misc utils
+ * @short_description: misc fdisk functions
+ */
+
/*
* Zeros in-memory first sector buffer
*/
@@ -74,7 +80,7 @@ int fdisk_read_firstsector(struct fdisk_context *cxt)
* dev: device name
* @partno: partition name
*
- * Return: allocated buffer with partition name
+ * Return: allocated buffer with partition name, use free() to deallocate.
*/
char *fdisk_partname(const char *dev, size_t partno)
{
diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index 34ad7f230..f7ae570fb 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -390,7 +390,7 @@ int main(int argc, char **argv)
/* Default is to follow the current line speend and then default to 9600 */
if ((options.flags & F_VCONSOLE) == 0 && options.numspeed == 0) {
options.speeds[options.numspeed++] = bcode("9600");
- options.flags |= F_KEEPSPEED
+ options.flags |= F_KEEPSPEED;
}
/* Initialize the termios settings (raw mode, eight-bit, blocking i/o). */