*/
#include <fs/battfs.h>
-#include <io/kblock_file.h>
+#include <io/kblock_posix.h>
#include <cfg/debug.h>
#include <cfg/test.h>
for (int i = 0; i < PAGE_COUNT; i++)
ref[i] = i;
- KBlockFile f;
- kblockfile_init(&f, fpt, HW_PAGEBUF, page_buffer, PAGE_SIZE, PAGE_COUNT);
+ KBlockPosix f;
+ kblockposix_init(&f, fpt, HW_PAGEBUF, page_buffer, PAGE_SIZE, PAGE_COUNT);
battfs_mount(disk, &f.b, page_array, sizeof(page_array));
testCheck(disk, ref);
for (int i = 0; i < FILE_SIZE; i++)
fputc(0xff, fp);
- KBlockFile f;
- kblockfile_init(&f, fp, HW_PAGEBUF, page_buffer, PAGE_SIZE, PAGE_COUNT);
+ KBlockPosix f;
+ kblockposix_init(&f, fp, HW_PAGEBUF, page_buffer, PAGE_SIZE, PAGE_COUNT);
for (int i = 0; i < PAGE_COUNT; i++)
{
for (int i = 0; i < FILE_SIZE; i++)
fputc(0xff, fp);
- KBlockFile f;
- kblockfile_init(&f, fp, HW_PAGEBUF, page_buffer, PAGE_SIZE, PAGE_COUNT);
+ KBlockPosix f;
+ kblockposix_init(&f, fp, HW_PAGEBUF, page_buffer, PAGE_SIZE, PAGE_COUNT);
for (int i = 0; i < PAGE_COUNT / 2; i++)
{
FILE *fp = fopen(test_filename, "w+");
for (int i = 0; i < PAGE_SIZE * 4; i++)
fputc(0xff, fp);
- KBlockFile f;
- kblockfile_init(&f, fp, HW_PAGEBUF, page_buffer, PAGE_SIZE, 4);
+ KBlockPosix f;
+ kblockposix_init(&f, fp, HW_PAGEBUF, page_buffer, PAGE_SIZE, 4);
// page, inode, seq, fill, pgoff
battfs_writeTestBlock(&f.b, 0, 0, 0, DATA_SIZE, 0);
FILE *fp = fopen(test_filename, "w+");
for (int i = 0; i < PAGE_SIZE * 4; i++)
fputc(0xff, fp);
- KBlockFile f;
- kblockfile_init(&f, fp, HW_PAGEBUF, page_buffer, PAGE_SIZE, 4);
+ KBlockPosix f;
+ kblockposix_init(&f, fp, HW_PAGEBUF, page_buffer, PAGE_SIZE, 4);
// page, inode, seq, fill, pgoff
battfs_writeTestBlock(&f.b, 0, 0, 0, DATA_SIZE, 0);
FILE *fp = fopen(test_filename, "w+");
for (int i = 0; i < PAGE_SIZE * 4; i++)
fputc(0xff, fp);
- KBlockFile f;
- kblockfile_init(&f, fp, HW_PAGEBUF, page_buffer, PAGE_SIZE, 4);
+ KBlockPosix f;
+ kblockposix_init(&f, fp, HW_PAGEBUF, page_buffer, PAGE_SIZE, 4);
// page, inode, seq, fill, pgoff
battfs_eraseBlock(&f.b, 0);
FILE *fp = fopen(test_filename, "w+");
for (int i = 0; i < PAGE_SIZE * 8; i++)
fputc(0xff, fp);
- KBlockFile f;
- kblockfile_init(&f, fp, HW_PAGEBUF, page_buffer, PAGE_SIZE, 8);
+ KBlockPosix f;
+ kblockposix_init(&f, fp, HW_PAGEBUF, page_buffer, PAGE_SIZE, 8);
// page, inode, seq, fill, pgoff
battfs_eraseBlock(&f.b, 0);
FILE *fp = fopen(test_filename, "w+");
for (int i = 0; i < PAGE_SIZE * 8; i++)
fputc(0xff, fp);
- KBlockFile f;
- kblockfile_init(&f, fp, HW_PAGEBUF, page_buffer, PAGE_SIZE, 8);
+ KBlockPosix f;
+ kblockposix_init(&f, fp, HW_PAGEBUF, page_buffer, PAGE_SIZE, 8);
int PAGE_FILL = PAGE_SIZE - BATTFS_HEADER_LEN;
FILE *fp = fopen(test_filename, "w+");
for (int i = 0; i < PAGE_SIZE * 8; i++)
fputc(0xff, fp);
- KBlockFile f;
- kblockfile_init(&f, fp, HW_PAGEBUF, page_buffer, PAGE_SIZE, 8);
+ KBlockPosix f;
+ kblockposix_init(&f, fp, HW_PAGEBUF, page_buffer, PAGE_SIZE, 8);
unsigned int PAGE_FILL = PAGE_SIZE - BATTFS_HEADER_LEN;
FILE *fp = fopen(test_filename, "w+");
for (int i = 0; i < PAGE_SIZE * 8; i++)
fputc(0xff, fp);
- KBlockFile f;
- kblockfile_init(&f, fp, HW_PAGEBUF, page_buffer, PAGE_SIZE, 8);
+ KBlockPosix f;
+ kblockposix_init(&f, fp, HW_PAGEBUF, page_buffer, PAGE_SIZE, 8);
const unsigned int PAGE_FILL = PAGE_SIZE - BATTFS_HEADER_LEN;
inode_t INODE = 0;
FILE *fp = fopen(test_filename, "w+");
for (int i = 0; i < PAGE_SIZE * 8; i++)
fputc(0xff, fp);
- KBlockFile f;
- kblockfile_init(&f, fp, HW_PAGEBUF, page_buffer, PAGE_SIZE, 8);
+ KBlockPosix f;
+ kblockposix_init(&f, fp, HW_PAGEBUF, page_buffer, PAGE_SIZE, 8);
unsigned int PAGE_FILL = PAGE_SIZE - BATTFS_HEADER_LEN;
FILE *fp = fopen(test_filename, "w+");
for (int i = 0; i < PAGE_SIZE * 8; i++)
fputc(0xff, fp);
- KBlockFile f;
- kblockfile_init(&f, fp, HW_PAGEBUF, page_buffer, PAGE_SIZE, 8);
+ KBlockPosix f;
+ kblockposix_init(&f, fp, HW_PAGEBUF, page_buffer, PAGE_SIZE, 8);
const unsigned int PAGE_FILL = PAGE_SIZE - BATTFS_HEADER_LEN;
inode_t INODE = 0;
FILE *fpt = fopen(test_filename, "w+");
for (int i = 0; i < FILE_SIZE; i++)
fputc(0xff, fpt);
- KBlockFile f;
- kblockfile_init(&f, fpt, HW_PAGEBUF, page_buffer, PAGE_SIZE, PAGE_COUNT);
+ KBlockPosix f;
+ kblockposix_init(&f, fpt, HW_PAGEBUF, page_buffer, PAGE_SIZE, PAGE_COUNT);
BattFs fd1;
inode_t INODE = 0;
ASSERT(battfs_umount(disk));
fpt = fopen(test_filename, "r+");
- kblockfile_init(&f, fpt, HW_PAGEBUF, page_buffer, PAGE_SIZE, PAGE_COUNT);
+ kblockposix_init(&f, fpt, HW_PAGEBUF, page_buffer, PAGE_SIZE, PAGE_COUNT);
ASSERT(battfs_mount(disk, &f.b, page_array, sizeof(page_array)));
ASSERT(battfs_fsck(disk));
FILE *fpt = fopen(test_filename, "w+");
for (int i = 0; i < FILE_SIZE; i++)
fputc(0xff, fpt);
- KBlockFile f;
- kblockfile_init(&f, fpt, HW_PAGEBUF, page_buffer, PAGE_SIZE, PAGE_COUNT);
+ KBlockPosix f;
+ kblockposix_init(&f, fpt, HW_PAGEBUF, page_buffer, PAGE_SIZE, PAGE_COUNT);
BattFs fd1;
ASSERT(battfs_umount(disk));
fpt = fopen(test_filename, "r+");
- kblockfile_init(&f, fpt, HW_PAGEBUF, page_buffer, PAGE_SIZE, PAGE_COUNT);
+ kblockposix_init(&f, fpt, HW_PAGEBUF, page_buffer, PAGE_SIZE, PAGE_COUNT);
ASSERT(battfs_mount(disk, &f.b, page_array, sizeof(page_array)));
ASSERT(battfs_fsck(disk));
for (int i = 0; i < FILE_SIZE / 10; i++)
fputc(0xff, fpt);
- KBlockFile f;
- kblockfile_init(&f, fpt, HW_PAGEBUF, page_buffer, PAGE_SIZE, PAGE_COUNT / 10);
+ KBlockPosix f;
+ kblockposix_init(&f, fpt, HW_PAGEBUF, page_buffer, PAGE_SIZE, PAGE_COUNT / 10);
BattFs fd1,fd2;
FILE *fp = fopen(test_filename, "w+");
for (int i = 0; i < PAGE_SIZE * 8; i++)
fputc(0xff, fp);
- KBlockFile f;
- kblockfile_init(&f, fp, HW_PAGEBUF, page_buffer, PAGE_SIZE, 8);
+ KBlockPosix f;
+ kblockposix_init(&f, fp, HW_PAGEBUF, page_buffer, PAGE_SIZE, 8);
unsigned int PAGE_FILL = PAGE_SIZE - BATTFS_HEADER_LEN;
FILE *fpt = fopen(test_filename, "w+");
for (int i = 0; i < FILE_SIZE / 5; i++)
fputc(0xff, fpt);
- KBlockFile f;
- kblockfile_init(&f, fpt, HW_PAGEBUF, page_buffer, PAGE_SIZE, PAGE_COUNT / 5);
+ KBlockPosix f;
+ kblockposix_init(&f, fpt, HW_PAGEBUF, page_buffer, PAGE_SIZE, PAGE_COUNT / 5);
BattFs fd1;
inode_t INODE = 0;
FILE *fp = fopen(test_filename, "w+");
for (int i = 0; i < PAGE_SIZE * 4; i++)
fputc(0xff, fp);
- KBlockFile f;
- kblockfile_init(&f, fp, HW_PAGEBUF, page_buffer, PAGE_SIZE, 4);
+ KBlockPosix f;
+ kblockposix_init(&f, fp, HW_PAGEBUF, page_buffer, PAGE_SIZE, 4);
unsigned int PAGE_FILL = PAGE_SIZE - BATTFS_HEADER_LEN;
inode_t INODE = 0;
FILE *fpt = fopen(test_filename, "w+");
for (int i = 0; i < FILE_SIZE; i++)
fputc(0xff, fpt);
- KBlockFile f;
- kblockfile_init(&f, fpt, HW_PAGEBUF, page_buffer, PAGE_SIZE, PAGE_COUNT);
+ KBlockPosix f;
+ kblockposix_init(&f, fpt, HW_PAGEBUF, page_buffer, PAGE_SIZE, PAGE_COUNT);
#define N_FILES 10
BattFs fd[N_FILES];
ASSERT(battfs_umount(disk));
fpt = fopen(test_filename, "r+");
- kblockfile_init(&f, fpt, HW_PAGEBUF, page_buffer, PAGE_SIZE, PAGE_COUNT);
+ kblockposix_init(&f, fpt, HW_PAGEBUF, page_buffer, PAGE_SIZE, PAGE_COUNT);
ASSERT(battfs_mount(disk, &f.b, page_array, sizeof(page_array)));
ASSERT(battfs_fsck(disk));
FILE *fpt = fopen(test_filename, "w+");
for (int i = 0; i < FILE_SIZE; i++)
fputc(0xff, fpt);
- KBlockFile f;
- kblockfile_init(&f, fpt, HW_PAGEBUF, page_buffer, PAGE_SIZE, PAGE_COUNT);
+ KBlockPosix f;
+ kblockposix_init(&f, fpt, HW_PAGEBUF, page_buffer, PAGE_SIZE, PAGE_COUNT);
BattFs fd[BATTFS_MAX_FILES];
unsigned int MODE = BATTFS_CREATE;
fpt = fopen(test_filename, "r+");
- kblockfile_init(&f, fpt, HW_PAGEBUF, page_buffer, PAGE_SIZE, PAGE_COUNT);
+ kblockposix_init(&f, fpt, HW_PAGEBUF, page_buffer, PAGE_SIZE, PAGE_COUNT);
ASSERT(battfs_mount(disk, &f.b, page_array, sizeof(page_array)));
ASSERT(battfs_fsck(disk));