Skip to content

Commit b15ebd8

Browse files
vojtechtrefnyclaude
andcommitted
Fix docstring differences between API files and C implementations
Fix various docstring inconsistencies found by comparing .api files with their corresponding C implementation files: - crypto: fix swapped keyfile_offset/key_size descriptions, update URL - dm: fix stray parentheses, add error handling note to API - loop: add NULL return case to API - btrfs: fix stray parenthesis in C - lvm: fix copy-paste error in vdo_disable_deduplication docstring name, fix vdo_info parameter name in lvm-dbus.c - mdraid: add NULL return cases to API - part: fix swapped tech categories for set_part_name/set_part_uuid - s390: sync parameter descriptions, fix online/offline typo in zfcp_scsi_offline description - nvdimm: fix parameter names in API, add tech category, add mode examples - fs: fix unmount tech category, complete truncated @extra descriptions - nvme: fix sanitize docstring saying "format command" Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1dbe831 commit b15ebd8

19 files changed

Lines changed: 41 additions & 35 deletions

File tree

src/lib/plugin_apis/crypto.api

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -855,8 +855,8 @@ BDCryptoKeyslotContext* bd_crypto_keyslot_context_new_passphrase (const guint8 *
855855
/**
856856
* bd_crypto_keyslot_context_new_keyfile:
857857
* @keyfile: a key file for the new context
858-
* @keyfile_offset: number of bytes to read from @keyfile or 0 for unlimited
859-
* @key_size: number of bytes to skip at start of @keyfile
858+
* @keyfile_offset: number of bytes to skip at start of @keyfile
859+
* @key_size: number of bytes to read from @keyfile or 0 for unlimited
860860
* @error: (out) (optional): place to store error (if any)
861861
*
862862
* Returns (transfer full): new %BDCryptoKeyslotContext initialized by key file or
@@ -1299,7 +1299,7 @@ gboolean bd_crypto_keyring_add_key (const gchar *key_desc, const guint8 *key_dat
12991299
* To achieve this, we calculate the chi square value of the first
13001300
* 512 Bytes and treat devices with a chi square value between 136
13011301
* and 426 as candidates for being encrypted.
1302-
* For the reasoning, see: https://tails.boum.org/blueprint/veracrypt/
1302+
* For the reasoning, see: https://gitlab.tails.boum.org/tails/blueprints/-/wikis/veracrypt/#detecting-veracrypt-volumes
13031303
*
13041304
* Returns: %TRUE if the given @device seems to be encrypted or %FALSE if not or
13051305
* failed to determine (the @error) is populated with the error in such

src/lib/plugin_apis/dm.api

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ gchar* bd_dm_get_subsystem_from_name (const gchar *device_name, GError **error);
110110
* @error: (out) (optional): place to store error (if any)
111111
*
112112
* Returns: whether the given @map_name exists (and is live if @live_only is
113-
* %TRUE (and is active if @active_only is %TRUE)).
113+
* %TRUE (and is active if @active_only is %TRUE)). If %FALSE is returned,
114+
* @error indicates whether error appeared (non-%NULL) or not (%NULL).
114115
*
115116
* Tech category: %BD_DM_TECH_MAP-%BD_DM_TECH_MODE_QUERY
116117
*/

src/lib/plugin_apis/fs.api

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -919,6 +919,7 @@ gboolean bd_fs_unfreeze (const gchar *mountpoint, GError **error);
919919
* uid (gid), if you specify one of
920920
* these, the function will run in
921921
* a child process with real user
922+
* and/or group ID set to these values.
922923
* @error: (out) (optional): place to store error (if any)
923924
*
924925
* Returns: whether @spec was successfully unmounted or not
@@ -942,6 +943,7 @@ gboolean bd_fs_unmount (const gchar *spec, gboolean lazy, gboolean force, const
942943
* uid (gid), if you specify one of
943944
* these, the function will run in
944945
* a child process with real user
946+
* and/or group ID set to these values.
945947
* @error: (out) (optional): place to store error (if any)
946948
*
947949
* Returns: whether @device (or @mountpoint) was successfully mounted or not

src/lib/plugin_apis/loop.api

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ BDLoopInfo* bd_loop_info (const gchar *loop, GError **error);
122122
* @file: path of the backing file to get loop name for
123123
* @error: (out) (optional): place to store error (if any)
124124
*
125-
* Returns: (transfer full): name of the loop device associated with the given @file
125+
* Returns: (transfer full): name of the loop device associated with the given
126+
* @file or %NULL if failed to determine
126127
*
127128
* Tech category: %BD_LOOP_TECH_LOOP-%BD_LOOP_TECH_MODE_QUERY
128129
*/

src/lib/plugin_apis/mdraid.api

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ BDMDDetailData* bd_md_detail (const gchar *raid_spec, GError **error);
416416
* @uuid: UUID to canonicalize
417417
* @error: (out) (optional): place to store error (if any)
418418
*
419-
* Returns: (transfer full): canonicalized form of @uuid
419+
* Returns: (transfer full): canonicalized form of @uuid or %NULL in case of error
420420
*
421421
* This function expects a UUID in the form that mdadm returns. The change is as
422422
* follows: 3386ff85:f5012621:4a435f06:1eb47236 -> 3386ff85-f501-2621-4a43-5f061eb47236
@@ -430,7 +430,7 @@ gchar* bd_md_canonicalize_uuid (const gchar *uuid, GError **error);
430430
* @uuid: UUID to transform into format used by MD RAID
431431
* @error: (out) (optional): place to store error (if any)
432432
*
433-
* Returns: (transfer full): transformed form of @uuid
433+
* Returns: (transfer full): transformed form of @uuid or %NULL in case of error
434434
*
435435
* This function expects a UUID in the canonical (traditional format) and
436436
* returns a UUID in the format used by MD RAID and is thus reverse to

src/lib/plugin_apis/nvdimm.api

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,11 @@ BDNVDIMMNamespaceInfo* bd_nvdimm_namespace_info (const gchar *namespace, const B
214214
/**
215215
* bd_nvdimm_list_namespaces:
216216
* @bus: (nullable): return only namespaces on given bus (specified by name),
217-
* %NULL may be specified to return namespaces from all buses
218-
* @region: (nullable): return only namespaces on given region (specified by regionX name or region id),
217+
* %NULL may be specified to return namespaces from all buses
218+
* @region: (nullable): return only namespaces on given region (specified by 'regionX' name),
219219
* %NULL may be specified to return namespaces from all regions
220220
* @idle: whether to list idle (not enabled) namespaces too
221-
* @extra: (nullable) (array zero-terminated=1): extra options for the creation (right now
222-
* passed to the 'ndctl' utility)
221+
* @extra: (nullable) (array zero-terminated=1): extra options (currently unused)
223222
* @error: (out) (optional): place to store error (if any)
224223
*
225224
* Returns: (array zero-terminated=1): information about the namespaces on @bus and @region or
@@ -242,6 +241,8 @@ BDNVDIMMNamespaceInfo** bd_nvdimm_list_namespaces (const gchar *bus, const gchar
242241
*
243242
* Returns: whether @namespace was successfully reconfigured or not
244243
*
244+
* Tech category: %BD_NVDIMM_TECH_NAMESPACE-%BD_NVDIMM_TECH_MODE_RECONFIGURE
245+
*
245246
* Deprecated: 3.1: NVDIMM plugin will be removed in the next major release
246247
*/
247248
gboolean bd_nvdimm_namespace_reconfigure (const gchar* namespace, BDNVDIMMNamespaceMode mode, gboolean force, const BDExtraArg **extra, GError** error);

src/lib/plugin_apis/nvme.api

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ gboolean bd_nvme_format (const gchar *device, guint16 lba_data_size, guint16 met
11931193
* The sanitize operation is set to run under the Allow Unrestricted Sanitize Exit
11941194
* mode.
11951195
*
1196-
* Returns: %TRUE if the format command finished successfully, %FALSE otherwise with @error set.
1196+
* Returns: %TRUE if the sanitize command finished successfully, %FALSE otherwise with @error set.
11971197
*
11981198
* Tech category: %BD_NVME_TECH_NVME-%BD_NVME_TECH_MODE_MANAGE
11991199
*/

src/lib/plugin_apis/part.api

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ gboolean bd_part_set_part_id (const gchar *disk, const gchar *part, const gchar
385385
*
386386
* Returns: whether the @uuid type was successfully set for @part or not
387387
*
388-
* Tech category: %BD_PART_TECH_MODE_MODIFY_PART + the tech according to the partition table type
388+
* Tech category: %BD_PART_TECH_GPT-%BD_PART_TECH_MODE_MODIFY_PART
389389
*/
390390
gboolean bd_part_set_part_uuid (const gchar *disk, const gchar *part, const gchar *uuid, GError **error);
391391

src/lib/plugin_apis/s390.api

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ gboolean bd_s390_dasd_format (const gchar *dasd, const BDExtraArg **extra, GErro
5353

5454
/**
5555
* bd_s390_dasd_needs_format:
56-
* @dasd: dasd to check, whether it needs dasdfmt run on it
56+
* @dasd: dasd to check, given as device number
5757
* @error: (out) (optional): place to store error (if any)
5858
*
5959
* Returns: whether a dasd needs dasdfmt run against it
@@ -64,7 +64,7 @@ gboolean bd_s390_dasd_needs_format (const gchar *dasd, GError **error);
6464

6565
/**
6666
* bd_s390_dasd_online:
67-
* @dasd: dasd to switch online
67+
* @dasd: dasd to switch online, given as device number
6868
* @error: (out) (optional): place to store error (if any)
6969
*
7070
* Returns: whether a dasd was successfully switched online
@@ -130,9 +130,9 @@ gchar* bd_s390_zfcp_sanitize_lun_input (const gchar *lun, GError **error);
130130

131131
/**
132132
* bd_s390_zfcp_online:
133-
* @devno: a zFCP device number
134-
* @wwpn: a zFCP WWPN identifier
135-
* @lun: a zFCP LUN identifier
133+
* @devno: zfcp device number
134+
* @wwpn: zfcp WWPN (World Wide Port Number)
135+
* @lun: zfcp LUN (Logical Unit Number)
136136
* @error: (out) (optional): place to store error (if any)
137137
*
138138
* Returns: whether a zFCP device was successfully switched online
@@ -143,12 +143,12 @@ gboolean bd_s390_zfcp_online (const gchar *devno, const gchar *wwpn, const gchar
143143

144144
/**
145145
* bd_s390_zfcp_scsi_offline:
146-
* @devno: a zFCP device number
147-
* @wwpn: a zFCP WWPN identifier
148-
* @lun: a zFCP LUN identifier
146+
* @devno: zfcp device number
147+
* @wwpn: zfcp WWPN (World Wide Port Number)
148+
* @lun: zfcp LUN (Logical Unit Number)
149149
* @error: (out) (optional): place to store error (if any)
150150
*
151-
* Returns: whether a LUN was successfully removed from associated WWPN
151+
* Returns: whether a LUN was successfully removed from its associated WWPN
152152
*
153153
* This function looks through /proc/scsi/scsi and manually removes LUNs from
154154
* associated WWPNs. zFCP devices are SCSI devices accessible over FCP protocol.

src/plugins/btrfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ gboolean bd_btrfs_delete_subvolume (const gchar *mountpoint, const gchar *name,
448448
* @error: (out) (optional): place to store error (if any)
449449
*
450450
* Returns: ID of the @mountpoint volume's default subvolume. If 0,
451-
* @error) may be set to indicate error
451+
* @error may be set to indicate error
452452
*
453453
* Tech category: %BD_BTRFS_TECH_SUBVOL-%BD_BTRFS_TECH_MODE_QUERY
454454
*/

0 commit comments

Comments
 (0)