Loading lfs/CMakeLists.txt +2 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS 1) # required packages find_package(FUSE3 REQUIRED) # boost dependencies, system is required for filesystem #TODO VERSION UNTESTED. I USE 1.62 find_package(Boost 1.56.0 COMPONENTS system filesystem serialization) find_package(Boost 1.62.0 REQUIRED COMPONENTS system filesystem serialization) include_directories(${FUSE3_INCLUDE_DIR} include/) set(SOURCE_FILES src/main.cpp src/main.h src/fuse_ops.h src/configure.h Loading lfs/src/adafs_ops/access.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ int chk_access(const fuse_req_t& req, const Metadata& md, int mask) { //check user leftmost 3 bits for rwx in md->mode if (md.uid() == fuse_req_ctx(req)->uid) { // Because mode comes only with the first 3 bits used, the user bits have to be shifted to the right to compare if ((mask & md.mode() >> 6) == (unsigned int) mask) if ((mask & md.mode() >> 6) == static_cast<unsigned int>(mask)) return 0; else return EACCES; Loading @@ -32,7 +32,7 @@ int chk_access(const fuse_req_t& req, const Metadata& md, int mask) { //check group middle 3 bits for rwx in md->mode if (md.gid() == fuse_req_ctx(req)->gid) { if ((mask & md.mode() >> 3) == (unsigned int) mask) if ((mask & md.mode() >> 3) == static_cast<unsigned int>(mask)) return 0; else return EACCES; Loading @@ -40,7 +40,7 @@ int chk_access(const fuse_req_t& req, const Metadata& md, int mask) { //check other rightmost 3 bits for rwx in md->mode. // Because they are the rightmost bits they don't need to be shifted if ((mask & md.mode()) == (unsigned int) mask) { if ((mask & md.mode()) == static_cast<unsigned int>(mask)) { return 0; } Loading lfs/src/adafs_ops/io.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ int init_chunk_space(const unsigned long hash) { chnk_path /= "data"s; bfs::ofstream ofs{chnk_path}; return bfs::exists(chnk_path); return static_cast<int>(bfs::exists(chnk_path)); } /** * Remove the directory in the chunk dir of a file. Loading @@ -39,5 +39,5 @@ int destroy_chunk_space(const unsigned long hash) { // create chunk dir bfs::remove_all(chnk_path); return !bfs::exists(chnk_path); return static_cast<int>(!bfs::exists(chnk_path)); } No newline at end of file lfs/src/fuse_ops/file.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ void adafs_ll_getattr(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info* fi) auto attr = make_unique<struct stat>(); auto md = make_shared<Metadata>(); auto err = get_metadata(*md, ino); if (!err) { if (err == 0) { attr->st_ino = md->inode_no(); attr->st_mode = md->mode(); attr->st_nlink = md->link_count(); Loading lfs/src/main.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -148,9 +148,10 @@ int main(int argc, char* argv[]) { spdlog::set_level(spdlog::level::off); #endif //extract the rootdir from argv and put it into rootdir of adafs_data ADAFS_DATA->rootdir(string(realpath(argv[argc - 2], NULL))); // TODO pointer modification = dangerous. need another solution ADAFS_DATA->rootdir(string(realpath(argv[argc - 2], nullptr))); argv[argc - 2] = argv[argc - 1]; argv[argc - 1] = NULL; argv[argc - 1] = nullptr; argc--; //set all paths ADAFS_DATA->inode_path(ADAFS_DATA->rootdir() + "/meta/inodes"s); Loading Loading
lfs/CMakeLists.txt +2 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS 1) # required packages find_package(FUSE3 REQUIRED) # boost dependencies, system is required for filesystem #TODO VERSION UNTESTED. I USE 1.62 find_package(Boost 1.56.0 COMPONENTS system filesystem serialization) find_package(Boost 1.62.0 REQUIRED COMPONENTS system filesystem serialization) include_directories(${FUSE3_INCLUDE_DIR} include/) set(SOURCE_FILES src/main.cpp src/main.h src/fuse_ops.h src/configure.h Loading
lfs/src/adafs_ops/access.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ int chk_access(const fuse_req_t& req, const Metadata& md, int mask) { //check user leftmost 3 bits for rwx in md->mode if (md.uid() == fuse_req_ctx(req)->uid) { // Because mode comes only with the first 3 bits used, the user bits have to be shifted to the right to compare if ((mask & md.mode() >> 6) == (unsigned int) mask) if ((mask & md.mode() >> 6) == static_cast<unsigned int>(mask)) return 0; else return EACCES; Loading @@ -32,7 +32,7 @@ int chk_access(const fuse_req_t& req, const Metadata& md, int mask) { //check group middle 3 bits for rwx in md->mode if (md.gid() == fuse_req_ctx(req)->gid) { if ((mask & md.mode() >> 3) == (unsigned int) mask) if ((mask & md.mode() >> 3) == static_cast<unsigned int>(mask)) return 0; else return EACCES; Loading @@ -40,7 +40,7 @@ int chk_access(const fuse_req_t& req, const Metadata& md, int mask) { //check other rightmost 3 bits for rwx in md->mode. // Because they are the rightmost bits they don't need to be shifted if ((mask & md.mode()) == (unsigned int) mask) { if ((mask & md.mode()) == static_cast<unsigned int>(mask)) { return 0; } Loading
lfs/src/adafs_ops/io.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ int init_chunk_space(const unsigned long hash) { chnk_path /= "data"s; bfs::ofstream ofs{chnk_path}; return bfs::exists(chnk_path); return static_cast<int>(bfs::exists(chnk_path)); } /** * Remove the directory in the chunk dir of a file. Loading @@ -39,5 +39,5 @@ int destroy_chunk_space(const unsigned long hash) { // create chunk dir bfs::remove_all(chnk_path); return !bfs::exists(chnk_path); return static_cast<int>(!bfs::exists(chnk_path)); } No newline at end of file
lfs/src/fuse_ops/file.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ void adafs_ll_getattr(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info* fi) auto attr = make_unique<struct stat>(); auto md = make_shared<Metadata>(); auto err = get_metadata(*md, ino); if (!err) { if (err == 0) { attr->st_ino = md->inode_no(); attr->st_mode = md->mode(); attr->st_nlink = md->link_count(); Loading
lfs/src/main.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -148,9 +148,10 @@ int main(int argc, char* argv[]) { spdlog::set_level(spdlog::level::off); #endif //extract the rootdir from argv and put it into rootdir of adafs_data ADAFS_DATA->rootdir(string(realpath(argv[argc - 2], NULL))); // TODO pointer modification = dangerous. need another solution ADAFS_DATA->rootdir(string(realpath(argv[argc - 2], nullptr))); argv[argc - 2] = argv[argc - 1]; argv[argc - 1] = NULL; argv[argc - 1] = nullptr; argc--; //set all paths ADAFS_DATA->inode_path(ADAFS_DATA->rootdir() + "/meta/inodes"s); Loading