aboutsummaryrefslogtreecommitdiff
path: root/include/erofs/cache.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/erofs/cache.h')
-rw-r--r--include/erofs/cache.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/include/erofs/cache.h b/include/erofs/cache.h
index 8c171f5..72b849d 100644
--- a/include/erofs/cache.h
+++ b/include/erofs/cache.h
@@ -1,7 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0+ */
/*
- * erofs-utils/include/erofs/cache.h
- *
* Copyright (C) 2018 HUAWEI, Inc.
* http://www.huawei.com/
* Created by Miao Xie <miaoxie@huawei.com>
@@ -10,6 +8,11 @@
#ifndef __EROFS_CACHE_H
#define __EROFS_CACHE_H
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
#include "internal.h"
struct erofs_buffer_head;
@@ -21,6 +24,8 @@ struct erofs_buffer_block;
#define INODE 2
/* shared xattrs */
#define XATTR 3
+/* device table */
+#define DEVT 4
struct erofs_bhops {
bool (*preflush)(struct erofs_buffer_head *bh);
@@ -39,6 +44,7 @@ struct erofs_buffer_head {
struct erofs_buffer_block {
struct list_head list;
+ struct list_head mapped_list;
erofs_blk_t blkaddr;
int type;
@@ -57,6 +63,9 @@ static inline const int get_alignsize(int type, int *type_ret)
} else if (type == XATTR) {
*type_ret = META;
return sizeof(struct erofs_xattr_entry);
+ } else if (type == DEVT) {
+ *type_ret = META;
+ return EROFS_DEVT_SLOT_SIZE;
}
if (type == META)
@@ -95,10 +104,13 @@ struct erofs_buffer_head *erofs_balloc(int type, erofs_off_t size,
struct erofs_buffer_head *erofs_battach(struct erofs_buffer_head *bh,
int type, unsigned int size);
-erofs_blk_t erofs_mapbh(struct erofs_buffer_block *bb, bool end);
+erofs_blk_t erofs_mapbh(struct erofs_buffer_block *bb);
bool erofs_bflush(struct erofs_buffer_block *bb);
void erofs_bdrop(struct erofs_buffer_head *bh, bool tryrevoke);
+#ifdef __cplusplus
+}
#endif
+#endif