All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.net>
To: barebox@lists.infradead.org
Cc: Grigory Milev <G.Milev@sam-solutions.com>,
	Dmitry Lavnikevich <D.Lavnikevich@sam-solutions.com>
Subject: [PATCH 3/5] ubi: Fix for creating ubi volumes with 64bit size
Date: Fri, 7 Mar 2014 14:15:04 +0300	[thread overview]
Message-ID: <5319AA38.20409@sam-solutions.net> (raw)
In-Reply-To: <1394190783-12978-1-git-send-email-d.lavnikevich@sam-solutions.com>

Since MTD is already supports >= 4GB device sizes it is better to
allow ubi valumes also be created of larger sizes.

Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com>
Signed-off-by: Grigory Milev <g.milev@sam-solutions.com>
---
  commands/ubi.c         | 4 ++--
  drivers/mtd/ubi/cdev.c | 2 +-
  2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/commands/ubi.c b/commands/ubi.c
index 57ae790..8a409c2 100644
--- a/commands/ubi.c
+++ b/commands/ubi.c
@@ -15,12 +15,12 @@ static int do_ubimkvol(int argc, char *argv[])
  {
  	struct ubi_mkvol_req req;
  	int fd, ret;
-	size_t size;
+	uint64_t size;
   	if (argc != 4)
  		return COMMAND_ERROR_USAGE;
  -	size = strtoul_suffix(argv[3], NULL, 0);
+	size = strtoull_suffix(argv[3], NULL, 0);
  	req.name_len = min_t(int, strlen(argv[2]), UBI_VOL_NAME_MAX);
  	strncpy(req.name, argv[2], req.name_len);
  	req.name[req.name_len] = 0;
diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c
index 129f2e2..b97739a 100644
--- a/drivers/mtd/ubi/cdev.c
+++ b/drivers/mtd/ubi/cdev.c
@@ -220,7 +220,7 @@ static int ubi_cdev_ioctl(struct cdev *cdev, int 
cmd, void *buf)
  		break;
  	case UBI_IOCMKVOL:
  		if (!req->bytes)
-			req->bytes = ubi->avail_pebs * ubi->leb_size;
+			req->bytes = (__s64)ubi->avail_pebs * ubi->leb_size;
  		return ubi_create_volume(ubi, req);
  	};
  -- 1.8.5.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2014-03-07 11:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1394190783-12978-1-git-send-email-d.lavnikevich@sam-solutions.com>
2014-03-07 11:14 ` [PATCH 2/5] mtd: Support for 4GB partitions Dmitry Lavnikevich
2014-03-07 11:15 ` Dmitry Lavnikevich [this message]
2014-03-07 11:15 ` [PATCH 4/5] nand: mxs: Check for up to 4 NAND chips Dmitry Lavnikevich
2014-03-07 11:15 ` [PATCH 5/5] nand: mxs: Fix for calculating ecc strength on some types of NAND flash Dmitry Lavnikevich
2014-03-10 11:39 [PATCH 1/5] mtd: Update internal API to support 64-bit device size Dmitry Lavnikevich
2014-03-10 11:39 ` [PATCH 3/5] ubi: Fix for creating ubi volumes with 64bit size Dmitry Lavnikevich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5319AA38.20409@sam-solutions.net \
    --to=d.lavnikevich@sam-solutions.net \
    --cc=D.Lavnikevich@sam-solutions.com \
    --cc=G.Milev@sam-solutions.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.