* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
+#define _FILE_OFFSET_BITS 64
+
#include <ext4_config.h>
#include <ext4_blockdev.h>
#include <ext4_errno.h>
/**@brief Image file descriptor.*/
static FILE *dev_file;
-#define DROP_LINUXCACHE_BUFFERS 1
+#define DROP_LINUXCACHE_BUFFERS 0
/**********************BLOCKDEV INTERFACE**************************************/
filedev_close
);
-/******************************************************************************/
-EXT4_BCACHE_STATIC_INSTANCE(__cache, CONFIG_BLOCK_DEV_CACHE_SIZE, 1024);
-
/******************************************************************************/
static int filedev_open(struct ext4_blockdev *bdev)
{
- dev_file = fopen64(fname, "r+b");
+ dev_file = fopen(fname, "r+b");
if(!dev_file)
return EIO;
/*No buffering at file.*/
setbuf(dev_file, 0);
- if(fseeko64(dev_file, 0, SEEK_END))
+ if(fseek(dev_file, 0, SEEK_END))
return EFAULT;
_filedev.ph_bcnt = ftell(dev_file) / _filedev.ph_bsize;
static int filedev_bread(struct ext4_blockdev *bdev, void *buf, uint64_t blk_id,
uint32_t blk_cnt)
{
- if(fseeko64(dev_file, blk_id * bdev->ph_bsize, SEEK_SET))
+ if(fseek(dev_file, blk_id * bdev->ph_bsize, SEEK_SET))
return EIO;
if(!fread(buf, bdev->ph_bsize * blk_cnt, 1, dev_file))
static int filedev_bwrite(struct ext4_blockdev *bdev, const void *buf,
uint64_t blk_id, uint32_t blk_cnt)
{
- if(fseeko64(dev_file, blk_id * bdev->ph_bsize, SEEK_SET))
+ if(fseek(dev_file, blk_id * bdev->ph_bsize, SEEK_SET))
return EIO;
if(!fwrite(buf, bdev->ph_bsize * blk_cnt, 1, dev_file))
return EOK;
}
-
-/******************************************************************************/
-
-struct ext4_bcache* ext4_filecache_get(void)
-{
- return &__cache;
-}
/******************************************************************************/
struct ext4_blockdev* ext4_filedev_get(void)
{