ref: 9ae6dcb7e063d495267e7a53ddecb4d8356645ba
parent: dc8bef53210b3d3bf87cf30d8f7dc99536c57414
author: gkostka <kostka.grzegorz@gmail.com>
date: Wed Apr 5 15:47:04 EDT 2017
Name refactiring inside file_windows module
--- a/blockdev/windows/file_windows.c
+++ b/blockdev/windows/file_windows.c
@@ -47,19 +47,19 @@
static HANDLE dev_file;
/**********************BLOCKDEV INTERFACE**************************************/
-static int io_raw_open(struct ext4_blockdev *bdev);
-static int io_raw_bread(struct ext4_blockdev *bdev, void *buf, uint64_t blk_id,
+static int file_open(struct ext4_blockdev *bdev);
+static int file_bread(struct ext4_blockdev *bdev, void *buf, uint64_t blk_id,
uint32_t blk_cnt);
-static int io_raw_bwrite(struct ext4_blockdev *bdev, const void *buf,
+static int file_bwrite(struct ext4_blockdev *bdev, const void *buf,
uint64_t blk_id, uint32_t blk_cnt);
-static int io_raw_close(struct ext4_blockdev *bdev);
+static int file_close(struct ext4_blockdev *bdev);
/******************************************************************************/
-EXT4_BLOCKDEV_STATIC_INSTANCE(_filedev, EXT4_IORAW_BSIZE, 0, io_raw_open,
- io_raw_bread, io_raw_bwrite, io_raw_close, 0, 0);
+EXT4_BLOCKDEV_STATIC_INSTANCE(_filedev, EXT4_IORAW_BSIZE, 0, file_open,
+ file_bread, file_bwrite, file_close, 0, 0);
/******************************************************************************/
-static int io_raw_open(struct ext4_blockdev *bdev)
+static int file_open(struct ext4_blockdev *bdev)
{
char path[64];
DISK_GEOMETRY pdg;
@@ -101,7 +101,7 @@
/******************************************************************************/
-static int io_raw_bread(struct ext4_blockdev *bdev, void *buf, uint64_t blk_id,
+static int file_bread(struct ext4_blockdev *bdev, void *buf, uint64_t blk_id,
uint32_t blk_cnt)
{
long hipart = blk_id >> (32 - 9);
@@ -125,7 +125,7 @@
}
/******************************************************************************/
-static int io_raw_bwrite(struct ext4_blockdev *bdev, const void *buf,
+static int file_bwrite(struct ext4_blockdev *bdev, const void *buf,
uint64_t blk_id, uint32_t blk_cnt)
{
long hipart = blk_id >> (32 - 9);
@@ -149,7 +149,7 @@
}
/******************************************************************************/
-static int io_raw_close(struct ext4_blockdev *bdev)
+static int file_close(struct ext4_blockdev *bdev)
{
CloseHandle(dev_file);
return EOK;
@@ -156,9 +156,15 @@
}
/******************************************************************************/
-struct ext4_blockdev *ext4_io_raw_dev_get(void) { return &_filedev; }
+struct ext4_blockdev *file_windows_dev_get(void)
+{
+ return &_filedev;
+}
/******************************************************************************/
-void ext4_io_raw_filename(const char *n) { fname = n; }
+void file_windows_name_set(const char *n)
+{
+ fname = n;
+}
/******************************************************************************/
#endif
--- a/fs_test/lwext4_generic.c
+++ b/fs_test/lwext4_generic.c
@@ -130,8 +130,8 @@
static bool open_windows(void)
{
#ifdef WIN32
- ext4_io_raw_filename(input_name);
- bd = ext4_io_raw_dev_get();
+ file_windows_name_set(input_name);
+ bd = file_windows_dev_get();
if (!bd) {
printf("open_winpartition: fail\n");
return false;
--- a/fs_test/lwext4_mbr.c
+++ b/fs_test/lwext4_mbr.c
@@ -77,8 +77,8 @@
static bool open_windows(void)
{
#ifdef WIN32
- ext4_io_raw_filename(input_name);
- bd = ext4_io_raw_dev_get();
+ file_windows_name_set(input_name);
+ bd = file_windows_dev_get();
if (!bd) {
printf("open_winpartition: fail\n");
return false;
--- a/fs_test/lwext4_mkfs.c
+++ b/fs_test/lwext4_mkfs.c
@@ -87,8 +87,8 @@
static bool open_windows(void)
{
#ifdef WIN32
- ext4_io_raw_filename(input_name);
- bd = ext4_io_raw_dev_get();
+ file_windows_name_set(input_name);
+ bd = file_windows_dev_get();
if (!bd) {
printf("open_winpartition: fail\n");
return false;
--- a/fs_test/lwext4_server.c
+++ b/fs_test/lwext4_server.c
@@ -393,8 +393,8 @@
#ifdef WIN32
if (winpart) {
- ext4_io_raw_filename(ext4_fname);
- bd = ext4_io_raw_dev_get();
+ file_windows_name_set(ext4_fname);
+ bd = file_windows_dev_get();
} else
#endif