Fix modification infomations. Reconstruct fs directory structure.
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
SRC_DIR := fs
|
||||
SRC_DIR := fs_server libfs
|
||||
|
||||
include $(KERNEL_ROOT)/compiler.mk
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
toolchain ?= arm-none-eabi-
|
||||
cc = ${toolchain}gcc
|
||||
ld = ${toolchain}g++
|
||||
objdump = ${toolchain}objdump
|
||||
user_ldflags = -N -Ttext 0
|
||||
|
||||
cflags = -march=armv7-a -mtune=cortex-a9 -nostdlib -nodefaultlibs -mfloat-abi=soft -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -ggdb -Wno-unused -Werror -fno-omit-frame-pointer -fno-stack-protector -fno-pie -no-pie
|
||||
c_useropts = -O0
|
||||
|
||||
INC_DIR = -I$(KERNEL_ROOT)/services/fs/libfs \
|
||||
-I$(KERNEL_ROOT)/services/fs/fs_server/include \
|
||||
-I$(KERNEL_ROOT)/services/lib/ipc \
|
||||
-I$(KERNEL_ROOT)/services/boards/imx6q-sabrelite
|
||||
|
||||
fs_server: fs_server.o fs.o block_io.o
|
||||
@mv $^ ../../boards/imx6q-sabrelite
|
||||
|
||||
%.o: %.c
|
||||
@echo "cc $^"
|
||||
@${cc} ${cflags} ${c_useropts} ${INC_DIR} -o $@ -c $^
|
||||
+2
-10
@@ -39,13 +39,14 @@ Modification:
|
||||
1. support inode create and delete
|
||||
3. remove inode lock and unlock
|
||||
4. remove inode cache
|
||||
5. rename function names(DirInodeAddEntry,DirInodeLookup, InodeAlloc, InodeFree, PathElementExtract, InodeBlockMapping, Seek, InodeSeek, InodeParentSeek, InodeRead, InodeWrite) to fit XIZI_AIoT use sceneries
|
||||
*************************************************/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "block_io.h"
|
||||
#include "libserial.h"
|
||||
#include "fs.h"
|
||||
#include "libserial.h"
|
||||
|
||||
static void Error(char* s)
|
||||
{
|
||||
@@ -360,15 +361,6 @@ struct Inode* InodeParentSeek(struct Inode* source, char* path, char* name)
|
||||
return Seek(source, path, 1, name);
|
||||
}
|
||||
|
||||
/// @brief Copy State information from Inode.
|
||||
void InodeStateGet(struct Inode* ip, struct State* st)
|
||||
{
|
||||
st->ino = ip->inum;
|
||||
st->type = ip->type;
|
||||
st->nlink = ip->nlink;
|
||||
st->size = ip->size;
|
||||
}
|
||||
|
||||
/// @brief Read data from the Inode to the dst buffer.
|
||||
int InodeRead(struct Inode* ip, char* dst, int off, int n)
|
||||
{
|
||||
+11
-4
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "block_io.h"
|
||||
#include "fs.h"
|
||||
#include "fs_service.h"
|
||||
#include "libfs_to_client.h"
|
||||
#include "libserial.h"
|
||||
#include "usyscall.h"
|
||||
|
||||
@@ -256,7 +256,6 @@ int IPC_DO_SERVE_FUNC(Ipc_open)(char* path)
|
||||
strncpy(fdp->path, path, strlen(path) + 1);
|
||||
ip->nlink++;
|
||||
fdp->data = ip;
|
||||
InodeStateGet(ip, &fdp->st);
|
||||
|
||||
return fd;
|
||||
}
|
||||
@@ -327,8 +326,16 @@ IPC_SERVER_INTERFACE(Ipc_close, 1);
|
||||
IPC_SERVER_INTERFACE(Ipc_read, 4);
|
||||
IPC_SERVER_INTERFACE(Ipc_write, 4);
|
||||
|
||||
IPC_SERVER_REGISTER_INTERFACES(IpcFsServer, 9, Ipc_ls, Ipc_cd, Ipc_mkdir, Ipc_delete, Ipc_cat,
|
||||
Ipc_open, Ipc_close, Ipc_read, Ipc_write);
|
||||
IPC_SERVER_REGISTER_INTERFACES(IpcFsServer, 9,
|
||||
Ipc_ls,
|
||||
Ipc_cd,
|
||||
Ipc_mkdir,
|
||||
Ipc_delete,
|
||||
Ipc_cat,
|
||||
Ipc_open,
|
||||
Ipc_close,
|
||||
Ipc_read,
|
||||
Ipc_write);
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
-1
@@ -102,7 +102,6 @@ int InodeRead(struct Inode*, char*, int, int);
|
||||
int InodeWrite(struct Inode*, char*, uint32_t, uint32_t);
|
||||
struct Inode* InodeSeek(struct Inode*, char*);
|
||||
struct Inode* InodeParentSeek(struct Inode*, char*, char*);
|
||||
void InodeStateGet(struct Inode*, struct State*);
|
||||
|
||||
// fs fd ops
|
||||
struct FileDescriptor* GetFileDescriptor(int fd);
|
||||
+4
-2
@@ -7,9 +7,11 @@ user_ldflags = -N -Ttext 0
|
||||
cflags = -march=armv7-a -mtune=cortex-a9 -nostdlib -nodefaultlibs -mfloat-abi=soft -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -ggdb -Wno-unused -Werror -fno-omit-frame-pointer -fno-stack-protector -fno-pie -no-pie
|
||||
c_useropts = -O0
|
||||
|
||||
INC_DIR = -I$(KERNEL_ROOT)/services/fs/include -I$(KERNEL_ROOT)/services/lib/ipc -I$(KERNEL_ROOT)/services/boards/imx6q-sabrelite
|
||||
INC_DIR = -I$(KERNEL_ROOT)/services/fs/libfs \
|
||||
-I$(KERNEL_ROOT)/services/lib/ipc \
|
||||
-I$(KERNEL_ROOT)/services/boards/imx6q-sabrelite
|
||||
|
||||
fs_server: fs_server.o fs_service.o fs.o block_io.o
|
||||
fs_server: libfs_to_client.o
|
||||
@mv $^ ../../boards/imx6q-sabrelite
|
||||
|
||||
%.o: %.c
|
||||
+1
-2
@@ -9,8 +9,7 @@
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
#include "fs_service.h"
|
||||
#include "fs.h"
|
||||
#include "libfs_to_client.h"
|
||||
|
||||
IPC_INTERFACE(Ipc_ls, 1, path, strlen(path) + 1);
|
||||
int ls(struct Session* session, char* path)
|
||||
-1
@@ -12,7 +12,6 @@
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "fs.h"
|
||||
#include "libipc.h"
|
||||
|
||||
IPC_SERVICES(IpcFsServer, Ipc_ls, Ipc_cd, Ipc_mkdir, Ipc_delete, Ipc_cat,
|
||||
Reference in New Issue
Block a user