Revert from/to link parameters for readability

This commit is contained in:
Ben RUBSON 2018-03-15 19:55:59 +01:00 committed by GitHub
parent f9a63e0b8b
commit db623272df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View File

@ -609,14 +609,14 @@ int DirNode::rename(const char *fromPlaintext, const char *toPlaintext) {
return res; return res;
} }
int DirNode::link(const char *from, const char *to) { int DirNode::link(const char *to, const char *from) {
Lock _lock(mutex); Lock _lock(mutex);
string fromCName = rootDir + naming->encodePath(from);
string toCName = rootDir + naming->encodePath(to); string toCName = rootDir + naming->encodePath(to);
string fromCName = rootDir + naming->encodePath(from);
rAssert(!fromCName.empty());
rAssert(!toCName.empty()); rAssert(!toCName.empty());
rAssert(!fromCName.empty());
VLOG(1) << "link " << fromCName << " -> " << toCName; VLOG(1) << "link " << fromCName << " -> " << toCName;
@ -624,7 +624,7 @@ int DirNode::link(const char *from, const char *to) {
if (fsConfig->config->externalIVChaining) { if (fsConfig->config->externalIVChaining) {
VLOG(1) << "hard links not supported with external IV chaining!"; VLOG(1) << "hard links not supported with external IV chaining!";
} else { } else {
res = ::link(fromCName.c_str(), toCName.c_str()); res = ::link(toCName.c_str(), fromCName.c_str());
if (res == -1) { if (res == -1) {
res = -errno; res = -errno;
} else { } else {

View File

@ -130,7 +130,7 @@ class DirNode {
int rename(const char *fromPlaintext, const char *toPlaintext); int rename(const char *fromPlaintext, const char *toPlaintext);
int link(const char *from, const char *to); int link(const char *to, const char *from);
// returns idle time of filesystem in seconds // returns idle time of filesystem in seconds
int idleSeconds(); int idleSeconds();

View File

@ -500,7 +500,7 @@ int encfs_symlink(const char *to, const char *from) {
return res; return res;
} }
int encfs_link(const char *from, const char *to) { int encfs_link(const char *to, const char *from) {
EncFS_Context *ctx = context(); EncFS_Context *ctx = context();
if (isReadOnly(ctx)) { if (isReadOnly(ctx)) {
@ -514,7 +514,7 @@ int encfs_link(const char *from, const char *to) {
} }
try { try {
res = FSRoot->link(from, to); res = FSRoot->link(to, from);
} catch (encfs::Error &err) { } catch (encfs::Error &err) {
RLOG(ERROR) << "error caught in link: " << err.what(); RLOG(ERROR) << "error caught in link: " << err.what();
} }

View File

@ -70,7 +70,7 @@ int encfs_unlink(const char *path);
int encfs_rmdir(const char *path); int encfs_rmdir(const char *path);
int encfs_symlink(const char *from, const char *to); int encfs_symlink(const char *from, const char *to);
int encfs_rename(const char *from, const char *to); int encfs_rename(const char *from, const char *to);
int encfs_link(const char *from, const char *to); int encfs_link(const char *to, const char *from);
int encfs_chmod(const char *path, mode_t mode); int encfs_chmod(const char *path, mode_t mode);
int encfs_chown(const char *path, uid_t uid, gid_t gid); int encfs_chown(const char *path, uid_t uid, gid_t gid);
int encfs_truncate(const char *path, off_t size); int encfs_truncate(const char *path, off_t size);