diff options
author | Zhihao Cheng <chengzhihao1@huawei.com> | 2024-11-11 16:36:38 +0800 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2024-11-11 10:32:45 +0100 |
commit | 0d1c454bfcbbe90f6fe9930f1c68f259bd66b114 (patch) | |
tree | 4d23eef04a83c14adf17f4293ed946bd8e5caace /ubifs-utils/common/ubifs.h | |
parent | f3bacdcd9cdfbe4f9861767258b359aba4db3f80 (diff) |
ubifs-utils: Add 'dev_fd' and 'libubi' into 'ubifs_info' structure
Embed new members 'dev_fd' and 'libubi' into ubifs_info structure, so
that global variable 'ubi', 'out_fd' and 'out_ubi' could be removed
from mkfs.ubifs.c. Besides, add parameter in check_volume_empty().
Next patch will extract UBI opening/closing/check_volume_empty functions
into a new source file, these functions will be used in fsck.
Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'ubifs-utils/common/ubifs.h')
-rw-r--r-- | ubifs-utils/common/ubifs.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/ubifs-utils/common/ubifs.h b/ubifs-utils/common/ubifs.h index 502a39a..5a909f6 100644 --- a/ubifs-utils/common/ubifs.h +++ b/ubifs-utils/common/ubifs.h @@ -278,6 +278,8 @@ struct ubifs_znode * @program_type: used to identify the type of current program * @program_name: program name * @dev_name: device name + * @dev_fd: opening handler for an UBI volume or an image file + * @libubi: opening handler for libubi * * @jhead_cnt: count of journal heads * @max_bud_bytes: maximum number of bytes allowed in buds @@ -370,6 +372,8 @@ struct ubifs_info int program_type; const char *program_name; char *dev_name; + int dev_fd; + libubi_t libubi; int jhead_cnt; long long max_bud_bytes; @@ -482,6 +486,13 @@ struct ubifs_branch *ubifs_idx_branch(const struct ubifs_info *c, (UBIFS_BRANCH_SZ + c->key_len + c->hash_len) * bnum); } -int write_leb(int lnum, int len, void *buf); +int write_leb(struct ubifs_info *c, int lnum, int len, void *buf); + +/* super.c */ +int open_ubi(struct ubifs_info *c, const char *node); +void close_ubi(struct ubifs_info *c); +int open_target(struct ubifs_info *c); +int close_target(struct ubifs_info *c); +int check_volume_empty(struct ubifs_info *c); #endif /* __UBIFS_H__ */ |