ANDROID: Incremental fs: Add INCFS_IOC_PERMIT_FILL

Provide a securable way to open a file for filling

Test: incfs_test passes
Bug: 138149732
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Change-Id: Ib4b6fd839ad30ce08e31121d19e2c0d7066d302f
This commit is contained in:
Paul Lawrence
2020-03-11 15:21:20 -07:00
parent 71f75bde65
commit 5183d3514a
3 changed files with 143 additions and 15 deletions

View File

@@ -51,13 +51,23 @@
_IOR(INCFS_IOCTL_BASE_CODE, 31, struct incfs_get_file_sig_args)
/*
* Fill in one or more data block
* Fill in one or more data block. This may only be called on a handle
* passed as a parameter to INCFS_IOC_PERMIT_FILLING
*
* Returns number of blocks filled in, or error if none were
*/
#define INCFS_IOC_FILL_BLOCKS \
_IOR(INCFS_IOCTL_BASE_CODE, 32, struct incfs_fill_blocks)
/*
* Permit INCFS_IOC_FILL_BLOCKS on the given file descriptor
* May only be called on .pending_reads file
*
* Returns 0 on success or error
*/
#define INCFS_IOC_PERMIT_FILL \
_IOW(INCFS_IOCTL_BASE_CODE, 33, struct incfs_permit_fill)
enum incfs_compression_alg {
COMPRESSION_NONE = 0,
COMPRESSION_LZ4 = 1
@@ -136,6 +146,17 @@ struct incfs_fill_blocks {
__aligned_u64 fill_blocks;
};
/*
* Permit INCFS_IOC_FILL_BLOCKS on the given file descriptor
* May only be called on .pending_reads file
*
* Argument for INCFS_IOC_PERMIT_FILL
*/
struct incfs_permit_fill {
/* File to permit fills on */
__u32 file_descriptor;
};
enum incfs_hash_tree_algorithm {
INCFS_HASH_TREE_NONE = 0,
INCFS_HASH_TREE_SHA256 = 1