projects
/
lwext4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bc9718e
)
Support for large files and block devices.
author
gkostka
<kostka.grzegorz@gmail.com>
Fri, 17 Jan 2014 18:03:38 +0000
(18:03 +0000)
committer
gkostka
<kostka.grzegorz@gmail.com>
Fri, 17 Jan 2014 18:03:38 +0000
(18:03 +0000)
blockdev/filedev/ext4_filedev.c
patch
|
blob
|
history
diff --git
a/blockdev/filedev/ext4_filedev.c
b/blockdev/filedev/ext4_filedev.c
index 437e840428fbd8b458d0af17b4d27fabeeec78a6..07bf1507a665989a0a97352655d2c10c7a400484 100644
(file)
--- a/
blockdev/filedev/ext4_filedev.c
+++ b/
blockdev/filedev/ext4_filedev.c
@@
-71,7
+71,7
@@
EXT4_BCACHE_STATIC_INSTANCE(__cache, CONFIG_BLOCK_DEV_CACHE_SIZE, 1024);
/******************************************************************************/
static int filedev_open(struct ext4_blockdev *bdev)
{
/******************************************************************************/
static int filedev_open(struct ext4_blockdev *bdev)
{
- dev_file = fopen(fname, "r+b");
+ dev_file = fopen
64
(fname, "r+b");
if(!dev_file)
return EIO;
if(!dev_file)
return EIO;
@@
-79,7
+79,7
@@
static int filedev_open(struct ext4_blockdev *bdev)
/*No buffering at file.*/
setbuf(dev_file, 0);
/*No buffering at file.*/
setbuf(dev_file, 0);
- if(fseek(dev_file, 0, SEEK_END))
+ if(fseek
o64
(dev_file, 0, SEEK_END))
return EFAULT;
_filedev.ph_bcnt = ftell(dev_file) / _filedev.ph_bsize;
return EFAULT;
_filedev.ph_bcnt = ftell(dev_file) / _filedev.ph_bsize;
@@
-92,7
+92,7
@@
static int filedev_open(struct ext4_blockdev *bdev)
static int filedev_bread(struct ext4_blockdev *bdev, void *buf, uint64_t blk_id,
uint32_t blk_cnt)
{
static int filedev_bread(struct ext4_blockdev *bdev, void *buf, uint64_t blk_id,
uint32_t blk_cnt)
{
- if(fseek(dev_file, blk_id * bdev->ph_bsize, SEEK_SET))
+ if(fseek
o64
(dev_file, blk_id * bdev->ph_bsize, SEEK_SET))
return EIO;
if(!fread(buf, bdev->ph_bsize * blk_cnt, 1, dev_file))
return EIO;
if(!fread(buf, bdev->ph_bsize * blk_cnt, 1, dev_file))
@@
-118,7
+118,7
@@
static void drop_cache(void)
static int filedev_bwrite(struct ext4_blockdev *bdev, const void *buf,
uint64_t blk_id, uint32_t blk_cnt)
{
static int filedev_bwrite(struct ext4_blockdev *bdev, const void *buf,
uint64_t blk_id, uint32_t blk_cnt)
{
- if(fseek(dev_file, blk_id * bdev->ph_bsize, SEEK_SET))
+ if(fseek
o64
(dev_file, blk_id * bdev->ph_bsize, SEEK_SET))
return EIO;
if(!fwrite(buf, bdev->ph_bsize * blk_cnt, 1, dev_file))
return EIO;
if(!fwrite(buf, bdev->ph_bsize * blk_cnt, 1, dev_file))