zipl: expand interface of disk_write_block_aligned_base()

Provide helper functions disk_write_block_buffer_align()
and add_component_buffer_align() to align offset of the record
on specified block size boundary and to save the offset, where
the record was made at.

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-10-15 14:44:56 +02:00
committed by Jan Höppner
parent 2ae44cb794
commit bbeb0f8445
3 changed files with 73 additions and 35 deletions
+6 -1
View File
@@ -117,7 +117,12 @@ int disk_write_block_aligned(int fd, const void* data, size_t bytecount,
blocknum_t disk_write_block_buffer(int fd, int fd_is_basedisk,
const void* buffer, size_t bytecount,
disk_blockptr_t** blocklist,
struct disk_info* info);
struct disk_info *info);
blocknum_t disk_write_block_buffer_align(int fd, int fd_is_basedisk,
const void *buffer, size_t bytecount,
disk_blockptr_t **blocklist,
struct disk_info *info, int align,
off_t *offset);
void disk_print_devt(dev_t d);
void disk_print_info(struct disk_info* info);
int disk_is_zero_block(disk_blockptr_t* block, struct disk_info* info);