summaryrefslogtreecommitdiffstats
path: root/arch/sandbox/board/hostfile.c
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2021-02-16 21:02:03 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2021-02-18 09:23:42 +0100
commit130fbc7f6c67357a58823c8f17ecef7d276386a9 (patch)
treecbf03d20fa48605aac314b871ffa925c76a2013f /arch/sandbox/board/hostfile.c
parent47fe8d54c41a8076bb936f4b45304117af3a493d (diff)
downloadbarebox-130fbc7f6c67357a58823c8f17ecef7d276386a9.tar.gz
barebox-130fbc7f6c67357a58823c8f17ecef7d276386a9.tar.xz
block: use 64-bit types for sector offset and count on all platforms
barebox' use of int for the sector offset puts an upper bound of 1TB on the size of supported block devices, which is already exceeded by common place USB mass storage. Increasing the sizes involved to 64 bit like Linux does won't magically add missing driver support, but it gives us at least a fighting chance. Do so. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/sandbox/board/hostfile.c')
-rw-r--r--arch/sandbox/board/hostfile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/sandbox/board/hostfile.c b/arch/sandbox/board/hostfile.c
index e3e38b7119..d63f51eb23 100644
--- a/arch/sandbox/board/hostfile.c
+++ b/arch/sandbox/board/hostfile.c
@@ -72,14 +72,14 @@ static struct cdev_operations hf_cdev_ops = {
.write = hf_cdev_write,
};
-static int hf_blk_read(struct block_device *blk, void *buf, int block, int num_blocks)
+static int hf_blk_read(struct block_device *blk, void *buf, sector_t block, blkcnt_t num_blocks)
{
ssize_t ret = hf_read(container_of(blk, struct hf_priv, blk), buf,
num_blocks << SECTOR_SHIFT, block << SECTOR_SHIFT, 0);
return ret > 0 ? 0 : ret;
}
-static int hf_blk_write(struct block_device *blk, const void *buf, int block, int num_blocks)
+static int hf_blk_write(struct block_device *blk, const void *buf, sector_t block, blkcnt_t num_blocks)
{
ssize_t ret = hf_write(container_of(blk, struct hf_priv, blk), buf,
num_blocks << SECTOR_SHIFT, block << SECTOR_SHIFT, 0);