支持目录硬链接的文件系统

发布于 2024-10-07 06:57:59 字数 134 浏览 4 评论 0原文

有人知道吗?最好用linux实现?

或者,有人知道将其添加到任何开源实现中需要付出多少努力吗? (我的意思是:也许改变一个 if 语句就足够了,也许我必须仔细检查整个 fs 实现添加测试;你有这个想法吗?)。

谢谢....

Does anybody know one? preferrably with linux implementation?

alternatively, does anybody know how much effort would it take to add it in any open-source implementation? (i mean: maybe it's enough to change an if statement, maybe i have to go carefully trhough the whole fs implementation adding tests; do you have that notion? ).

thanks....

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

游魂 2024-10-14 06:57:59

HFS+ 允许 OSX 10.5 中的目录硬链接。从 OSX 10.6 开始,只有 TimeMachine 可以创建它们,并且 HFS+ 会进行一些健全性检查,确保它们不会引入循环。

但是,Linux 不会读取它们。除了文件系统之外,这还可以在 VFS 层强制执行。即使没有循环,一些用户空间工具也依赖于没有目录硬链接(例如,GNU find 优化可以让它跳过许多目录;可以使用 -noleaf 禁用它)。

HFS+ allows directory hardlinks in OSX 10.5. Only TimeMachine can create them since OSX 10.6, and HFS+ does some sanity checking that they do not introduce cycles.

However, Linux will not read them. Besides filesystems, this could be enforced at the VFS layer. Even if there are no cycles, some userspace tools rely on having no directory hard links (eg, a GNU find optimisation that lets it skip many directories; it can be disabled with -noleaf ).

甜味拾荒者 2024-10-14 06:57:59

从技术上讲,没有什么可以阻止您使用十六进制编辑器打开 /dev/sda 并创建一个。然而,如果你这样做,你系统中的其他一切都会崩溃。

我能找到的最好的解释是来自 jta 的引用:

用户添加的目录硬链接
被禁止,因为它们违反了
有向无环图结构
文件系统(这是一个 ASSERT
Unixiana,粗略地),因为他们
搞得一团糟
file-tree-walkers(一个术语 Multicians
一眼就能认出,但是 Unix
极客们可能无需
也有问题。

Technically nothing keeps you from opening /dev/sda with a hex editor and creating one. However everything else in your system will fall apart if you do.

The best explanation i could find is this quote from jta:

User-added hardlinks to directories
are forbidden because they break the
directed acyclic graph structure of
the filesystem (which is an ASSERT in
Unixiana, roughly), and because they
confuse the hell out of
file-tree-walkers (a term Multicians
will recognize at sight, but Unix
geeks can probably figure out without
problems too.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文