aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViktar Palstsiuk <viktar.palstsiuk@promwad.com>2011-08-20 07:07:37 +0300
committerArtem Bityutskiy <Artem.Bityutskiy@intel.com>2011-08-20 07:07:37 +0300
commit92ed6c0bf6f6793395cdeec5a61ac2059b005056 (patch)
tree8770f62c2b47cba42fd0ef3f62d346c8873bc572
parentb602ab59b9782003d1179488d8c1580bc8563738 (diff)
mkfs.ubifs/ubinize: increase PEB size limit to 2MiB
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@intel.com>
-rw-r--r--mkfs.ubifs/mkfs.ubifs.c2
-rw-r--r--mkfs.ubifs/ubifs.h3
-rw-r--r--ubi-utils/include/libubi.h3
-rw-r--r--ubi-utils/ubinize.c3
4 files changed, 9 insertions, 2 deletions
diff --git a/mkfs.ubifs/mkfs.ubifs.c b/mkfs.ubifs/mkfs.ubifs.c
index dcdb722..f77e5e6 100644
--- a/mkfs.ubifs/mkfs.ubifs.c
+++ b/mkfs.ubifs/mkfs.ubifs.c
@@ -390,7 +390,7 @@ static int validate_options(void)
return err_msg("LEB should be multiple of min. I/O units");
if (c->leb_size % 8)
return err_msg("LEB size has to be multiple of 8");
- if (c->leb_size > 1024*1024)
+ if (c->leb_size > UBIFS_MAX_LEB_SZ)
return err_msg("too large LEB size %d", c->leb_size);
if (c->max_leb_cnt < UBIFS_MIN_LEB_CNT)
return err_msg("too low max. count of LEBs, minimum is %d",
diff --git a/mkfs.ubifs/ubifs.h b/mkfs.ubifs/ubifs.h
index f94a52c..434b651 100644
--- a/mkfs.ubifs/ubifs.h
+++ b/mkfs.ubifs/ubifs.h
@@ -25,6 +25,9 @@
#ifndef __UBIFS_H__
#define __UBIFS_H__
+/* Maximum logical eraseblock size in bytes */
+#define UBIFS_MAX_LEB_SZ (2*1024*1024)
+
/* Minimum amount of data UBIFS writes to the flash */
#define MIN_WRITE_SZ (UBIFS_DATA_NODE_SZ + 8)
diff --git a/ubi-utils/include/libubi.h b/ubi-utils/include/libubi.h
index 03b16ad..02017e8 100644
--- a/ubi-utils/include/libubi.h
+++ b/ubi-utils/include/libubi.h
@@ -35,6 +35,9 @@ extern "C" {
/* UBI version libubi is made for */
#define LIBUBI_UBI_VERSION 1
+/* Maximum physical eraseblock size in bytes */
+#define UBI_MAX_PEB_SZ (2*1024*1024)
+
/* UBI library descriptor */
typedef void * libubi_t;
diff --git a/ubi-utils/ubinize.c b/ubi-utils/ubinize.c
index 453494d..3d19a02 100644
--- a/ubi-utils/ubinize.c
+++ b/ubi-utils/ubinize.c
@@ -35,6 +35,7 @@
#include <mtd/ubi-media.h>
#include <libubigen.h>
#include <libiniparser.h>
+#include <libubi.h>
#include "common.h"
#include "ubiutils-common.h"
@@ -253,7 +254,7 @@ static int parse_opt(int argc, char * const argv[])
if (args.peb_size < 0)
return errmsg("physical eraseblock size was not specified (use -h for help)");
- if (args.peb_size > 1024*1024)
+ if (args.peb_size > UBI_MAX_PEB_SZ)
return errmsg("too high physical eraseblock size %d", args.peb_size);
if (args.min_io_size < 0)