zipl: expand interface of disk_get_blocklist_from_file

. expand interface of disk_get_blocklist_from_file() to get
  block pointers for a specific range of data within a file.
. provide a helper function add_component_file_range() to add a
  specific range of data within a file as a boot component.

This will be used by a later patch.

Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Signed-off-by: Eduard Shishkin <edward6@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Eduard Shishkin
2020-12-04 14:21:59 +01:00
committed by Jan Höppner
parent a0b8033088
commit 2ae44cb794
3 changed files with 63 additions and 25 deletions
+6
View File
@@ -90,6 +90,11 @@ struct disk_info {
definition_t targetbase;
};
struct file_range {
off_t offset;
size_t len;
};
struct job_target_data;
int disk_get_info(const char* device, struct job_target_data* target,
@@ -119,6 +124,7 @@ int disk_is_zero_block(disk_blockptr_t* block, struct disk_info* info);
blocknum_t disk_compact_blocklist(disk_blockptr_t* list, blocknum_t count,
struct disk_info* info);
blocknum_t disk_get_blocklist_from_file(const char* filename,
struct file_range *reg,
disk_blockptr_t** blocklist,
struct disk_info* pinfo);
int disk_check_subchannel_set(int devno, dev_t device, char* dev_name);