该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

issue comes up in language when you switch from single dispatch to multiple dispatch "self" no longer has any

meaning.

In a traditional UNIX filesystem, cycles are bad for two reasons: firstly, the reclamation of storage is based on

reference counting, which doesn't handle cyclic references! The only backreferences are the .. and . entries, and

these are handled as special cases.

Secondly, backreferences in the tree structure can lead to nasty multithreading problems. In the traditional kernel

design, like the BSD kernel, inodes that are in use are represented by in-memory structures called vnodes. These

nodes are accessed concurrently, and contain locks. Certain operations retain a lock on a directory while navigating

to the subdirectory. In a cycled graph, this can lead to two processes trying to acquire a pair of locks on the same

two objects, but in an opposite order, which will deadlock the processes. These locking operations are often done in

a way that cannot be interrupted by a signal, so the processes will stay deadlocked until a reboot.

There are special hacks in BSD to avoid this deadlock when navigating the .. reference. Basically, the lock on the

originating directory vnode is relinquished, the .. lock is acquired and then the originating directory is re-

locked. Yes, it's basically an open race. It's possible that the original directory is deleted by the time the lock

is re-acquired, for instance.

I once implemented a cycle detection algorithm for vnode locks, to try to support cyclic hard linking in a file

system for a version of BSD, but the problem was that although the code itself worked beautifully, it was just too

hard to make the rest of the kernel cooperate. Too many places in the kernel, in the higher layers above the

filesystem drivers, simply assume that a lock will succeed, or eventually succeed, and are consequently not prepared

to correctly deal with an EDEADLK error. It's not entirely clear, even, what to do with the information which tells

you that a deadlock would occur if you were allowed to proceed. Do you abort the whole system call? At what level do

you retry? How will applications respond to having random filesystem operations bail with deadlock errors.

And so that's about five paragraphs more than you ever wanted to know about hard links.

-- KazKylheku

linux文件夹做链接,linux为什么不能给目录做硬链接相关推荐

  1. linux 文件夹修改名字,linux命令修改文件名_修改文件夹名字怎么操作

    如何用命令修改文件名呢?在Linux下可以用rename命令,当然还可以使用mv命令如下: Linux修改文件名 语句:mv oldFileName newFileName 示例:我想把 aaa.tx ...

  2. 修改linux文件夹密码忘记,Linux中如何重新获取丢失的密码

    在Linux系统中,如果把用户的密码忘记了,就很麻烦也很难重新获得.通过下面的方法可以重新设置用户对饿密码: 首先介绍一下Linux'的建立/删除账户的命令 useradd  username    ...

  3. linux文件夹制作iso,Linux 制作 ISO

    Linux 环境下制作 iso. 用法: mkisofs -a -I -J -r -o filename.iso /目录 用途: 将Linux下某个目录中的所有文件做成iso镜像.而且我加上了参数,可 ...

  4. linux文件夹不能复制,linux如何复制文件夹

    1.copy ,cp,该命令的功能是将给出的文件或目录拷贝到另外一个文件或目录中. 语法: cp [选项]  源文件或目录  目标文件或目录 2.例如;在/TEST目录下新建test1和test2两个 ...

  5. linux 文件夹增加容量,Linux系统下对目录扩容的方法介绍

    导读 本文介绍了在Linux系统下对目录扩容的方法,一起来看一下吧. 1.现象: 日志服务器当初考虑不周,分区划分不太合理: 2.目标: 将/home磁盘空间缩减  并将新的磁盘分区扩充到/根目录 卸 ...

  6. linux文件夹 压缩效率,Linux 高压缩率工具 XZ 压缩详解

    一.XZ 基础信息 XZ 压缩比比较高,在这里没有进行详细对比. 官网介绍到: 压缩后的文件大小 gzip 小30%,比bzip2小15%. 我测试 一个 112M 的文件,xz 压缩完后 4.5M, ...

  7. linux系统各文件夹的作用,linux系统文件夹的作用 good

    /bin 二进制可执行命令 /dev 设备特殊文件 /etc 系统管理和配置文件 如:环境变量 /etc/rc.d 启动的配置文件和脚本 /home用户主目录的基点,比如用户user的主目录就是/ho ...

  8. linux文件夹文件颜色及命令

    Linux 中文件夹 / 根目录:包含了几乎所的文件目录.相当于中央系统.进入的方法是cd / /root 如果你是以超级用户的身份登录的,这个就是超级用户的主目录. /home 如果建立一个名为&q ...

  9. linux 文件夹的颜色代表什么意思

    linux 文件夹的颜色代表什么意思 绿色 蓝色 黑色代表什么意思 蓝色表示目录: 绿色表示可执行文件: 红色表示压缩文件: 浅蓝色表示链接文件: 灰色表示其它文件: 红色闪烁表示链接的文件有问题了: ...

  10. linux文件夹缩略图不显示,分享|如何在终端显示图像缩略图

    不久前,我们讨论了 Fim,这是一个轻量级的命令行图像查看器应用程序,用于从命令行显示各种类型的图像,如 bmp.gif.jpeg 和 png 等.今天,我偶然发现了一个名为 lsix 的类似工具.它 ...

最新文章

  1. C#列出局域网中可用SQL Server服务器(续)
  2. micropython解释器原理_了解一下 MicroPython 的项目整体架构
  3. 百度智能云拿下MTCS最高安全评级,企业出海再添安全通道
  4. 【转】log4net使用详解
  5. android主流技术框架,android开发现在流行什么IDE和开发框架?
  6. 掌握渗透测试,从Web漏洞靶场搭建开始
  7. javascript详解函数原型对象prototype与constructor
  8. [转载] Python数学实验与建模 课后习题第1章解析
  9. 李航教授展望自然语言对话领域:现状与未来
  10. ab压力测试及结果分析
  11. 服务器的安全措施有哪些呢?
  12. iphone双重认证关闭不了怎么办_iPhone如何关闭Apple ID的双重认证
  13. QT读取局域网共享文件夹文件内容 解决不同网段无法访问共享文件夹问题
  14. single-spa_如何使用Single-SPA开发和部署微前端
  15. 【FCN】Fully Convolutional Networks for Semantic Segmentation学习
  16. 查看电脑连接过的无线网密码
  17. 初创企业:融资有风险额度需谨慎
  18. C++11之正则表达式(regex_match、regex_search、regex_replace)
  19. html如何制作正方体手工图,怎么用卡纸做正方体(做长方体的步骤图纸)
  20. 华为服务器查询IPMI地址

热门文章

  1. 终端怎么进入hadoop_Ubuntu中使用终端运行Hadoop程序
  2. redis的zset的底层实现_Redis底层数据结构之 zset
  3. httpcline转发_go http请求转发
  4. 多终端同时登录_So easy!同时登陆两个或多个Mac版微信和QQ
  5. c# combobox集合数据不显示_VBA与数据库解决方案第9讲:如何打开数据库记录集合,并把所得的数据显示到工作表文件中...
  6. 华为荣耀9x怎么解账户锁_荣耀X10顶配与30S最低配形成200元的价差,我觉得这样是最好的...
  7. 编程三角形面积公式_利用边长计算三角形面积 — 海伦公式推导
  8. Cryengine 3新的全局光照算法简介
  9. 深入分析Kubelet Bootstrap Checkpoint
  10. 关于CSS与HTML知识点总结(二)