Skip to content
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

Get the full path(absolute path) of file or inode #105

Open
liqinggd opened this issue Nov 10, 2021 · 0 comments
Open

Get the full path(absolute path) of file or inode #105

liqinggd opened this issue Nov 10, 2021 · 0 comments

Comments

@liqinggd
Copy link

Problem 1

Many functions need to know the abs path of the file, e.g., the realpath() function or readlink from /proc/[pid]/fd/N.

In the previous implementation, we remember the path when opening the file, so it is easy to get the path for the opened file. However, if the file has been renamed, it can not influence the path for the opened file to use the new path.

Problem 2

In the current implementation, we just record the string of the path of cwd. If the dir of cwd itself is renamed, the cwd cannot be changed to the new path.

TODO

Obviously, the kernel should record the inode instead of the path of the file. However, It is incorrect to use the inode to get the full path, because the parent of one inode is not unique.

We need to handle the path of file or inode in a new way, maybe introducing dentry cache(DCache) is a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant