From 8be15b96e4113903c3501a6dee3fa6108665ff29 Mon Sep 17 00:00:00 2001 From: Lucjan Bryndza Date: Wed, 2 Dec 2020 09:47:17 +0100 Subject: [PATCH] [EGD-4498] Virtual Filesystem Core Framework (#1074) * [EGD-4498] Registering and unregistering VFS * [EGD-4498] Mount structures added * [EGD-4498] Mount filesystem completed * [EGD-4498] Mount / unmount / and find mount impl * [EGD-4498] Per thread directory TLS * [EGD-4489] Absolute paths implementation * [EGD-4498] Git ignore vim * [EGD-4498] VFS core functions without cwd * [EGD-4498] Other syscalls * [EGD-4498] Code review fixes * [EGD-4498] Code review #2 Signed-off-by: Lucjan Bryndza * [EGD-4498] Code review small fixes vol #3 Signed-off-by: Lucjan Bryndza --- .gitignore | 6 + module-utils/split_sv.hpp | 33 +++ module-vfs/CMakeLists.txt | 4 + .../linux/purefs/src/fs/thread_local_cwd.cpp | 27 +++ .../rt1051/purefs/src/fs/thread_local_cwd.cpp | 57 +++++ .../internal/purefs/fs/directory_handle.hpp | 6 +- .../internal/purefs/fs/file_handle.hpp | 8 +- .../purefs/{utils => fs}/handle_mapper.hpp | 4 +- .../internal/purefs/fs/mount_point.hpp | 34 ++- .../internal/purefs/fs/thread_local_cwd.hpp | 12 + .../include/user/purefs/fs/filesystem.hpp | 126 ++++++++++- .../user/purefs/fs/filesystem_operation.hpp | 69 ------ .../user/purefs/fs/filesystem_operations.hpp | 84 +++++++ module-vfs/src/purefs/fs/filesystem.cpp | 214 ++++++++++++++++++ module-vfs/src/purefs/fs/filesystem_cwd.cpp | 32 +++ .../src/purefs/fs/filesystem_operations.cpp | 104 +++++++++ .../src/purefs/fs/filesystem_syscalls.cpp | 139 ++++++++++++ module-vfs/targets/Target_Linux.cmake | 1 + module-vfs/targets/Target_RT1051.cmake | 7 +- 19 files changed, 873 insertions(+), 94 deletions(-) create mode 100644 module-utils/split_sv.hpp create mode 100644 module-vfs/board/linux/purefs/src/fs/thread_local_cwd.cpp create mode 100644 module-vfs/board/rt1051/purefs/src/fs/thread_local_cwd.cpp rename module-vfs/include/internal/purefs/{utils => fs}/handle_mapper.hpp (93%) create mode 100644 module-vfs/include/internal/purefs/fs/thread_local_cwd.hpp delete mode 100644 module-vfs/include/user/purefs/fs/filesystem_operation.hpp create mode 100644 module-vfs/include/user/purefs/fs/filesystem_operations.hpp create mode 100644 module-vfs/src/purefs/fs/filesystem.cpp create mode 100644 module-vfs/src/purefs/fs/filesystem_cwd.cpp create mode 100644 module-vfs/src/purefs/fs/filesystem_operations.cpp create mode 100644 module-vfs/src/purefs/fs/filesystem_syscalls.cpp diff --git a/.gitignore b/.gitignore index 1a81adf58c303ccf657f1751559b12f435489fb4..65b0fde019928cde083e1e4345835d76ec6b45f0 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,9 @@ docker/Dockerfile docker/assets/actions* docker/assets/cmake* docker/assets/gcc-arm* + +# vim temporary files +*.swp +*.swo +tags +.ycm_extra_conf.py diff --git a/module-utils/split_sv.hpp b/module-utils/split_sv.hpp new file mode 100644 index 0000000000000000000000000000000000000000..3fb672eaae72236e45b9562a88900ba6a7283835 --- /dev/null +++ b/module-utils/split_sv.hpp @@ -0,0 +1,33 @@ +// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved. +// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md + +#pragma once +#include +#include +#include + +namespace utils +{ + template