aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorYue Hu <huyue2@yulong.com>2021-06-24 15:02:34 +0800
committerGao Xiang <xiang@kernel.org>2021-06-25 02:08:43 +0800
commit3afe21832d80f3cdbe4173809db91ee271b52a76 (patch)
tree56b49c329138aa00826a191bac03f0e50e545dab /include
parent1f89b5d82163b55932ef5f43dbf4a83be67db812 (diff)
downloaderofs-utils-3afe21832d80f3cdbe4173809db91ee271b52a76.tar.gz
AOSP: erofs-utils: add block list support
Android update engine will treat EROFS filesystem image as one single file. Let's add block list support to optimize OTA size. Link: https://lore.kernel.org/r/20210624070234.1340-1-zbestahu@gmail.com Tested-by: Yue Hu <huyue2@yulong.com> Tested-by: Huang Jianan <huangjianan@oppo.com> Signed-off-by: Yue Hu <huyue2@yulong.com> Signed-off-by: Li Guifu <blucerlee@gmail.com> Signed-off-by: Gao Xiang <xiang@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/erofs/block_list.h27
-rw-r--r--include/erofs/config.h1
2 files changed, 28 insertions, 0 deletions
diff --git a/include/erofs/block_list.h b/include/erofs/block_list.h
new file mode 100644
index 0000000..7756d8a
--- /dev/null
+++ b/include/erofs/block_list.h
@@ -0,0 +1,27 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * erofs-utils/include/erofs/block_list.h
+ *
+ * Copyright (C), 2021, Coolpad Group Limited.
+ * Created by Yue Hu <huyue2@yulong.com>
+ */
+#ifndef __EROFS_BLOCK_LIST_H
+#define __EROFS_BLOCK_LIST_H
+
+#include "internal.h"
+
+#ifdef WITH_ANDROID
+int erofs_droid_blocklist_fopen(void);
+void erofs_droid_blocklist_fclose(void);
+void erofs_droid_blocklist_write(struct erofs_inode *inode,
+ erofs_blk_t blk_start, erofs_blk_t nblocks);
+void erofs_droid_blocklist_write_tail_end(struct erofs_inode *inode,
+ erofs_blk_t blkaddr);
+#else
+static inline void erofs_droid_blocklist_write(struct erofs_inode *inode,
+ erofs_blk_t blk_start, erofs_blk_t nblocks) {}
+static inline
+void erofs_droid_blocklist_write_tail_end(struct erofs_inode *inode,
+ erofs_blk_t blkaddr) {}
+#endif
+#endif
diff --git a/include/erofs/config.h b/include/erofs/config.h
index d140a73..67e7a0f 100644
--- a/include/erofs/config.h
+++ b/include/erofs/config.h
@@ -65,6 +65,7 @@ struct erofs_configure {
char *mount_point;
char *target_out_path;
char *fs_config_file;
+ char *block_list_file;
#endif
};