-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#57] Added support for hard links. #113
base: main
Are you sure you want to change the base?
Conversation
Map<String, String> jsonInput = new HashMap<>(); | ||
jsonInput.put("operation", "hard_link_create"); | ||
jsonInput.put("logical_path", linkTargetPath.toString()); | ||
jsonInput.put("replica_number", "0"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we want to handle cases where replica zero does not exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be controlled via the following:
- configuration
- metadata
- genquery that selects a specific replica based on certain criteria provided by the admin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't know how we could safely assume anything... doesn't it have to come from the catalog?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it executes genquery to find the latest good replica and it creates the hard link to that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think latest good replica is the answer... trying to figure out how to get that information without another trip to the catalog...
I'd like to get w you all and test this to make sure the core libs support
correctly
…On Thu, Jan 21, 2021, 7:05 PM Kory Draughn ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In
irods-vfs-impl/src/main/java/org/irods/nfsrods/vfs/IRODSVirtualFileSystem.java
<#113 (comment)>
:
> +
+ Path linkParentPath = getPath(toInodeNumber(_parent));
+ Path linkTargetPath = getPath(toInodeNumber(_existing));
+ Path linkNamePath = linkParentPath.resolve(_target);
+
+ log_.debug("list - _parent = {}", linkParentPath); // The parent directory of _target.
+ log_.debug("list - _existing = {}", linkTargetPath); // The file or directory to link to.
+ log_.debug("list - _target = {}", _target); // The filename or absolute path of the link.
+ log_.debug("list - _subject = {}", Subjects.getUid(_subject)); // The UID of the user who executed this command.
+
+ // _parent + _target => the absolute path of the hard link.
+
+ Map<String, String> jsonInput = new HashMap<>();
+ jsonInput.put("operation", "hard_link_create");
+ jsonInput.put("logical_path", linkTargetPath.toString());
+ jsonInput.put("replica_number", "0");
Maybe it executes genquery to find the latest good replica and it creates
the hard link to that?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#113 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIL4LOV2X65UNZW3AUA65LS3C6LVANCNFSM4WDCRJXA>
.
|
Sure. Let me know when you'd like to do this. |
log_.debug("list - _parent = {}", linkParentPath); // The parent directory of _target. | ||
log_.debug("list - _existing = {}", linkTargetPath); // The file or directory to link to. | ||
log_.debug("list - _target = {}", _target); // The filename or absolute path of the link. | ||
log_.debug("list - _subject = {}", Subjects.getUid(_subject)); // The UID of the user who executed this command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
list -> link
@@ -1299,7 +1370,7 @@ private Stat statPath(Path _path, long _inodeNumber) throws IOException | |||
|
|||
stat.setUid(userId); | |||
stat.setGid(groupId); | |||
stat.setNlink(1); | |||
stat.setNlink(1); // TODO: Should hard links affect this number? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we'd increase it and then... decrease it somewhere else?
This PR needs to include documentation about the hard links REP. This also needs to be tested against the version of WinSCP that triggered this change.