Commit a0d1ad48 authored by Ramon Nou's avatar Ramon Nou
Browse files

NeedHAS_SYMLINKS+HAS_RENAME

parent 1a17485b
Pipeline #3132 passed with stages
in 15 minutes and 48 seconds
......@@ -209,7 +209,6 @@ gkfs_open(const std::string& path, mode_t mode, int flags, bool rename) {
}
return gkfs_open(md.target_path(), mode, flags, true);
}
#endif
#ifdef HAS_RENAME
std::string new_path = path;
if(md.blocks() == -1) {
......@@ -247,6 +246,7 @@ gkfs_open(const std::string& path, mode_t mode, int flags, bool rename) {
std::make_shared<gkfs::filemap::OpenFile>(new_path, flags));
}
}
#endif
#endif
if(S_ISDIR(md.mode())) {
return gkfs_opendir(path);
......@@ -327,7 +327,7 @@ gkfs_remove(const std::string& path) {
errno = EISDIR;
return -1;
}
#ifdef HAS_SYMLINKS
#ifdef HAS_RENAME
if(md.value().blocks() == -1) {
errno = ENOENT;
......@@ -351,6 +351,7 @@ gkfs_remove(const std::string& path) {
return 0;
}
}
#endif
#endif
auto err = gkfs::rpc::forward_remove(path);
......@@ -378,6 +379,7 @@ gkfs_access(const std::string& path, const int mask, bool follow_links) {
return 0;
}
#ifdef HAS_SYMLINKS
#ifdef HAS_RENAME
/**
* gkfs wrapper for rename() system calls
......@@ -447,6 +449,7 @@ gkfs_rename(const string& old_path, const string& new_path) {
return 0;
}
#endif
#endif
/**
* gkfs wrapper for stat() system calls
......@@ -500,6 +503,7 @@ gkfs_statx(int dirfs, const std::string& path, int flags, unsigned int mask,
if(!md) {
return -1;
}
#ifdef HAS_SYMLINKS
#ifdef HAS_RENAME
if(md.value().blocks() == -1) {
errno = ENOENT;
......@@ -512,6 +516,7 @@ gkfs_statx(int dirfs, const std::string& path, int flags, unsigned int mask,
}
}
}
#endif
#endif
struct stat tmp {};
......@@ -743,6 +748,7 @@ gkfs_truncate(const std::string& path, off_t length) {
}
// If we have rename enabled we need to check if the file is renamed
#ifdef HAS_SYMLINKS
#ifdef HAS_RENAME
if(md.value().blocks() == -1) {
errno = ENOENT;
......@@ -763,6 +769,7 @@ gkfs_truncate(const std::string& path, off_t length) {
}
return gkfs_truncate(new_path, size, length);
}
#endif
#endif
auto size = md->size();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment