From 90ae5f038c5058a497faec4dceddfeb6281e9cdd Mon Sep 17 00:00:00 2001 From: James Archer Date: Thu, 3 Oct 2024 02:11:16 +1000 Subject: [PATCH] fat: shorten source filenames Signed-off-by: James Archer --- components/fs/fat/Makefile | 12 ++++++------ components/fs/fat/{FATFS_README.md => README.md} | 10 +++++----- components/fs/fat/{fatfs_config.h => config.h} | 0 components/fs/fat/{fatfs_decl.h => decl.h} | 2 +- components/fs/fat/{fatfs_event.c => event.c} | 2 +- components/fs/fat/{fs_diskio.c => io.c} | 2 +- components/fs/fat/libmicrokitco_opts.h | 2 +- components/fs/fat/{fatfs_op.c => op.c} | 4 ++-- 8 files changed, 17 insertions(+), 17 deletions(-) rename components/fs/fat/{FATFS_README.md => README.md} (96%) rename components/fs/fat/{fatfs_config.h => config.h} (100%) rename components/fs/fat/{fatfs_decl.h => decl.h} (97%) rename components/fs/fat/{fatfs_event.c => event.c} (99%) rename components/fs/fat/{fs_diskio.c => io.c} (99%) rename components/fs/fat/{fatfs_op.c => op.c} (99%) diff --git a/components/fs/fat/Makefile b/components/fs/fat/Makefile index adfbf191..b08348b9 100644 --- a/components/fs/fat/Makefile +++ b/components/fs/fat/Makefile @@ -44,9 +44,9 @@ LIBS := \ FATFS_OBJS := \ ff.o \ ffunicode.o \ - fatfs_event.o \ - fatfs_op.o \ - fs_diskio.o \ + event.o \ + op.o \ + io.o \ printf.o \ putchar_debug.o \ assert.o @@ -79,13 +79,13 @@ $(FATFS_OBJECT_DIR)/ff.o: $(FF15_SRC)/source/ff.c Makefile | $(FATFS_OBJECT_DIR) $(FATFS_OBJECT_DIR)/ffunicode.o: $(FF15_SRC)/source/ffunicode.c Makefile $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ -$(FATFS_OBJECT_DIR)/fatfs_event.o: $(FS_DIR)/fatfs_event.c $(LIBMICROKITCO_OBJS) Makefile +$(FATFS_OBJECT_DIR)/event.o: $(FS_DIR)/event.c $(LIBMICROKITCO_OBJS) Makefile $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ -$(FATFS_OBJECT_DIR)/fatfs_op.o: $(FS_DIR)/fatfs_op.c Makefile +$(FATFS_OBJECT_DIR)/op.o: $(FS_DIR)/op.c Makefile $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ -$(FATFS_OBJECT_DIR)/fs_diskio.o: $(FS_DIR)/fs_diskio.c Makefile +$(FATFS_OBJECT_DIR)/io.o: $(FS_DIR)/io.c Makefile $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ $(FATFS_OBJECT_DIR)/printf.o: $(LIONSOS)/dep/sddf/util/printf.c Makefile diff --git a/components/fs/fat/FATFS_README.md b/components/fs/fat/README.md similarity index 96% rename from components/fs/fat/FATFS_README.md rename to components/fs/fat/README.md index 41ca57a8..2a849cc5 100644 --- a/components/fs/fat/FATFS_README.md +++ b/components/fs/fat/README.md @@ -25,13 +25,13 @@ When the disk I/O operation completes, the event thread is notified (akin to the - **ff15 folder**: Contains the implementation of Elm-Chan's FatFs (version 0.15 with patch 3). -- **fatfs_event.c**: +- **event.c**: This file manages the initialization process, event handling, and request assignment. It handles enqueuing requests, waking up worker threads, and overall event management. -- **fatfs_op.c**: -Defines wrapper functions executed by worker threads. These functions perform input validation, prepare arguments, and call the actual file system operations defined in ff15/source/ff.h. The interaction between fatfs_event.c and fatfs_op.c is facilitated by an array of operation functions, which fatfs_event.c assigns to the worker threads. +- **op.c**: +Defines wrapper functions executed by worker threads. These functions perform input validation, prepare arguments, and call the actual file system operations defined in ff15/source/ff.h. The interaction between event.c and op.c is facilitated by an array of operation functions, which event.c assigns to the worker threads. -- **fs_diskio.c**: +- **io.c**: Contains disk I/O functions, which are called by the file system operations. For instance, if the file system needs to read a specific sector from the disk, it calls disk_read. Disk operations are queued as requests to the sddf queue between the file system and the block device (blk virt), where worker threads may block until responses are received. # Lifecycle of a File System Operation @@ -50,7 +50,7 @@ Once validated, the event thread assigns the corresponding function (from the op During execution, the file system function may initiate one or more disk operations, such as reading or writing data. These operations are enqueued as block read/write requests in the queue between the file system and the block subsystem (blk virtualizer). - **Worker Thread Blocking and Wake-Up**: -After enqueuing the disk request, the worker thread goes to sleep, awaiting the response from the block subsystem. Once fatfs_event.c receives the response, it wakes up the worker thread, which then continues processing. +After enqueuing the disk request, the worker thread goes to sleep, awaiting the response from the block subsystem. Once event.c receives the response, it wakes up the worker thread, which then continues processing. - **Completion**: The operation is completed, and the result is sent back to the client via the response queue. diff --git a/components/fs/fat/fatfs_config.h b/components/fs/fat/config.h similarity index 100% rename from components/fs/fat/fatfs_config.h rename to components/fs/fat/config.h diff --git a/components/fs/fat/fatfs_decl.h b/components/fs/fat/decl.h similarity index 97% rename from components/fs/fat/fatfs_decl.h rename to components/fs/fat/decl.h index e4f3de2f..7d90b8eb 100644 --- a/components/fs/fat/fatfs_decl.h +++ b/components/fs/fat/decl.h @@ -1,6 +1,6 @@ #pragma once -#include "fatfs_config.h" +#include "config.h" #include "ff15/source/ff.h" #include diff --git a/components/fs/fat/fatfs_event.c b/components/fs/fat/event.c similarity index 99% rename from components/fs/fat/fatfs_event.c rename to components/fs/fat/event.c index c0c3ff9c..f02da7b9 100644 --- a/components/fs/fat/fatfs_event.c +++ b/components/fs/fat/event.c @@ -1,4 +1,4 @@ -#include "fatfs_decl.h" +#include "decl.h" #include "ff15/source/ff.h" #include "ff15/source/diskio.h" #include diff --git a/components/fs/fat/fs_diskio.c b/components/fs/fat/io.c similarity index 99% rename from components/fs/fat/fs_diskio.c rename to components/fs/fat/io.c index ab88fde6..86fdb01c 100644 --- a/components/fs/fat/fs_diskio.c +++ b/components/fs/fat/io.c @@ -1,6 +1,6 @@ #include "ff15/source/ff.h" #include "ff15/source/diskio.h" -#include "fatfs_decl.h" +#include "decl.h" #include #include #include diff --git a/components/fs/fat/libmicrokitco_opts.h b/components/fs/fat/libmicrokitco_opts.h index 56d9a28e..0765af2e 100644 --- a/components/fs/fat/libmicrokitco_opts.h +++ b/components/fs/fat/libmicrokitco_opts.h @@ -1,3 +1,3 @@ -#include "fatfs_config.h" +#include "config.h" #define LIBMICROKITCO_MAX_COTHREADS THREAD_NUM diff --git a/components/fs/fat/fatfs_op.c b/components/fs/fat/op.c similarity index 99% rename from components/fs/fat/fatfs_op.c rename to components/fs/fat/op.c index eb247028..7c1500aa 100644 --- a/components/fs/fat/fatfs_op.c +++ b/components/fs/fat/op.c @@ -1,11 +1,11 @@ -#include "fatfs_decl.h" +#include "decl.h" #include "ff15/source/ff.h" #include #include #include #include #include -#include "fatfs_config.h" +#include "config.h" /* This file define a bunch of wrapper functions of FATFs functions so those functions can be run in the