[PATCH 33/38] ubifs: keep scan buffer in ubifs_info

Dongsheng Yang yangds.fnst at cn.fujitsu.com
Mon Dec 21 00:41:56 PST 2015


From: David Gstir <david at sigma-star.at>

Like in der kernel's UBIFS code, we keep a single scan buffer in the ubifs_info
struct for all scan-related functions to use.

Signed-off-by: David Gstir <david at sigma-star.at>
Signed-off-by: Richard Weinberger <richard at nod.at>
---
 ubifs-utils/include/ubifs.h         | 2 ++
 ubifs-utils/ubifs_dump/ubifs_dump.c | 1 +
 2 files changed, 3 insertions(+)

diff --git a/ubifs-utils/include/ubifs.h b/ubifs-utils/include/ubifs.h
index 1678663..4a3212f 100644
--- a/ubifs-utils/include/ubifs.h
+++ b/ubifs-utils/include/ubifs.h
@@ -329,6 +329,7 @@ enum {
  * @vi: UBI volume information
  *
  * @gc_lnum: LEB number used for garbage collection
+ * @sbuf: a buffer of LEB size used by GC and replay for scanning
  * @rp_size: reserved pool size
  *
  * @space_bits: number of bits needed to record free or dirty space
@@ -407,6 +408,7 @@ struct ubifs_info
 	struct ubi_vol_info vi;
 
 	int gc_lnum;
+	void *sbuf;
 	long long rp_size;
 
 	int space_bits;
diff --git a/ubifs-utils/ubifs_dump/ubifs_dump.c b/ubifs-utils/ubifs_dump/ubifs_dump.c
index fe2aaf4..4cbf755 100644
--- a/ubifs-utils/ubifs_dump/ubifs_dump.c
+++ b/ubifs-utils/ubifs_dump/ubifs_dump.c
@@ -991,6 +991,7 @@ static int dump()
 		err = -ENOMEM;
 		goto out;
 	}
+	c->sbuf = leb_buf;
 
 	err = dump_master();
 	if (err)
-- 
1.8.4.2






More information about the linux-mtd mailing list