Skip to content

Commit

Permalink
fat: shorten source filenames
Browse files Browse the repository at this point in the history
Signed-off-by: James Archer <[email protected]>
  • Loading branch information
JE-Archer committed Oct 2, 2024
1 parent 801060e commit 90ae5f0
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions components/fs/fat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "fatfs_config.h"
#include "config.h"
#include "ff15/source/ff.h"
#include <fs/protocol.h>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "fatfs_decl.h"
#include "decl.h"
#include "ff15/source/ff.h"
#include "ff15/source/diskio.h"
#include <sddf/blk/queue.h>
Expand Down
2 changes: 1 addition & 1 deletion components/fs/fat/fs_diskio.c → components/fs/fat/io.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "ff15/source/ff.h"
#include "ff15/source/diskio.h"
#include "fatfs_decl.h"
#include "decl.h"
#include <stdbool.h>
#include <stdint.h>
#include <sddf/blk/queue.h>
Expand Down
2 changes: 1 addition & 1 deletion components/fs/fat/libmicrokitco_opts.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#include "fatfs_config.h"
#include "config.h"

#define LIBMICROKITCO_MAX_COTHREADS THREAD_NUM
4 changes: 2 additions & 2 deletions components/fs/fat/fatfs_op.c → components/fs/fat/op.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include "fatfs_decl.h"
#include "decl.h"
#include "ff15/source/ff.h"
#include <libmicrokitco/libmicrokitco.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <fs/protocol.h>
#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
Expand Down

0 comments on commit 90ae5f0

Please sign in to comment.