Loading src/client/fuse/fuse_client.cpp +6 −4 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ static struct fuse_lowlevel_ops ll_ops; static std::mutex ino_mutex; static Inode root_inode; static std::unordered_map<fuse_ino_t, Inode> ino_map; static std::unordered_map<std::string, fuse_ino_t> path_map; static std::unordered_map<std::string, struct stat> local_fifos; Loading Loading @@ -76,10 +77,10 @@ alloc_inode(const std::string& path) { static Inode* get_inode(fuse_ino_t ino) { std::lock_guard<std::mutex> lk(ino_mutex); if(gkfs::config::fuse::pointertrick) { if(ino == FUSE_ROOT_ID) { return &ino_map[FUSE_ROOT_ID]; return &root_inode; } if(gkfs::config::fuse::pointertrick) { return (Inode*) ino; } else { auto it = ino_map.find(ino); Loading Loading @@ -933,7 +934,8 @@ init_gekkofs() { fuse_log(FUSE_LOG_ERR, "failed to open root\n"); exit(1); } ino_map[FUSE_ROOT_ID] = {root_path, 1}; root_inode = {root_path, 1}; ino_map[FUSE_ROOT_ID] = root_inode; path_map[root_path] = FUSE_ROOT_ID; std::cout << "root node allocated" << std::endl; } Loading Loading
src/client/fuse/fuse_client.cpp +6 −4 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ static struct fuse_lowlevel_ops ll_ops; static std::mutex ino_mutex; static Inode root_inode; static std::unordered_map<fuse_ino_t, Inode> ino_map; static std::unordered_map<std::string, fuse_ino_t> path_map; static std::unordered_map<std::string, struct stat> local_fifos; Loading Loading @@ -76,10 +77,10 @@ alloc_inode(const std::string& path) { static Inode* get_inode(fuse_ino_t ino) { std::lock_guard<std::mutex> lk(ino_mutex); if(gkfs::config::fuse::pointertrick) { if(ino == FUSE_ROOT_ID) { return &ino_map[FUSE_ROOT_ID]; return &root_inode; } if(gkfs::config::fuse::pointertrick) { return (Inode*) ino; } else { auto it = ino_map.find(ino); Loading Loading @@ -933,7 +934,8 @@ init_gekkofs() { fuse_log(FUSE_LOG_ERR, "failed to open root\n"); exit(1); } ino_map[FUSE_ROOT_ID] = {root_path, 1}; root_inode = {root_path, 1}; ino_map[FUSE_ROOT_ID] = root_inode; path_map[root_path] = FUSE_ROOT_ID; std::cout << "root node allocated" << std::endl; } Loading