diff options
| author | Tom Rini <[email protected]> | 2025-11-18 12:51:22 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-11-18 12:51:22 -0600 |
| commit | b8872deb4450b09586e28550c23d33a71084d94f (patch) | |
| tree | 8dd5e2c78ed30bd1c0983f5e134ac2a77b85ddf0 /include | |
| parent | abf15eb60c8a87f833f7e75e5e8a51a7eb115e0b (diff) | |
| parent | 30890051ab23a0293f6404c9a49e86f33e45df66 (diff) | |
Merge patch series "'part name' subcommand and some robustification"
Rasmus Villemoes <[email protected]> says:
Implement a "part name" subcommand, mirroring the existing "part
number" subcommand.
In the discussion for v1 of that, it came up that there's a bit of
inconsistency in how much and what one can assume to be initialized in
'struct disk_partition' after a successful call of one of the
get_info* family of functions. Patch 1/2 tries to consolidate
that by making sure all ->get_info invocations go through a common
helper that at least always initializes the string members.
Quentin, I've taken the liberty of including your Acks, as the
incremental diff in patch 1 is quite minor, but do speak up if I
should not have done that.
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'include')
| -rw-r--r-- | include/part.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/part.h b/include/part.h index 6caaa6526aa..d940f8b5d0e 100644 --- a/include/part.h +++ b/include/part.h @@ -509,6 +509,22 @@ struct part_driver { int (*test)(struct blk_desc *desc); }; +/** + * part_driver_get_info() - Call the part_driver's get_info method + * + * On success, string members of info are guaranteed to be properly + * initialized, though they may be empty. + * + * @drv: Partition driver + * @desc: Block device descriptor + * @part: Partition number to read + * @info: Returned partition information + * + * Return: 0 on success, negative errno on failure. + */ +int part_driver_get_info(struct part_driver *drv, struct blk_desc *desc, int part, + struct disk_partition *info); + /* Declare a new U-Boot partition 'driver' */ #define U_BOOT_PART_TYPE(__name) \ ll_entry_declare(struct part_driver, __name, part_driver) |
