From 0d1c454bfcbbe90f6fe9930f1c68f259bd66b114 Mon Sep 17 00:00:00 2001 From: Zhihao Cheng Date: Mon, 11 Nov 2024 16:36:38 +0800 Subject: 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 Signed-off-by: David Oberhollenzer --- ubifs-utils/common/lpt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ubifs-utils/common/lpt.c') diff --git a/ubifs-utils/common/lpt.c b/ubifs-utils/common/lpt.c index 9c1143f..d07f569 100644 --- a/ubifs-utils/common/lpt.c +++ b/ubifs-utils/common/lpt.c @@ -421,7 +421,7 @@ int create_lpt(struct ubifs_info *c) alen = ALIGN(len, c->min_io_size); set_ltab(c, lnum, c->leb_size - alen, alen - len); memset(p, 0xff, alen - len); - err = write_leb(lnum++, alen, buf); + err = write_leb(c, lnum++, alen, buf); if (err) goto out; p = buf; @@ -468,7 +468,7 @@ int create_lpt(struct ubifs_info *c) set_ltab(c, lnum, c->leb_size - alen, alen - len); memset(p, 0xff, alen - len); - err = write_leb(lnum++, alen, buf); + err = write_leb(c, lnum++, alen, buf); if (err) goto out; p = buf; @@ -515,7 +515,7 @@ int create_lpt(struct ubifs_info *c) alen = ALIGN(len, c->min_io_size); set_ltab(c, lnum, c->leb_size - alen, alen - len); memset(p, 0xff, alen - len); - err = write_leb(lnum++, alen, buf); + err = write_leb(c, lnum++, alen, buf); if (err) goto out; p = buf; @@ -538,7 +538,7 @@ int create_lpt(struct ubifs_info *c) alen = ALIGN(len, c->min_io_size); set_ltab(c, lnum, c->leb_size - alen, alen - len); memset(p, 0xff, alen - len); - err = write_leb(lnum++, alen, buf); + err = write_leb(c, lnum++, alen, buf); if (err) goto out; p = buf; @@ -558,7 +558,7 @@ int create_lpt(struct ubifs_info *c) /* Write remaining buffer */ memset(p, 0xff, alen - len); - err = write_leb(lnum, alen, buf); + err = write_leb(c, lnum, alen, buf); if (err) goto out; -- cgit v1.2.3