由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Linux版 - SSA, 能不能讲一下 inode
相关主题
Symbolic Link: ln 和 cp -s 是一样的么?为啥 inode-cache 的内存算在 used 里面,不算在 cached 里面呢?
大家能帮我看一下下面的问题吗,不胜感激。用一个linux系统读一个linux硬盘,被读的硬盘会留痕迹吗
A simple Bash question about changing directoryLinux的文件ACL信息存在什么地方的?
想修改buffer cache的内核代码?请问从哪开始并口驱动的一个问题 (转载)
奇怪的df怎么获取一个ext4的disk image所含的文件列表
急问:linux 2.6 里,如何从inode得到ext2_inode_info?请教一个linux下面的多线程semaphore的问题。 (转载)
为啥用mmap访问文件的效率高呢?ls -l 显示一堆 ??? 的咋整啊?
linux太毁硬盘了最准确,精简 spinlock VS semaphore 的 区别??
相关话题的讨论汇总
话题: inode话题: file话题: directory话题: entry话题: ssa
进入Linux版参与讨论
1 (共1页)
r****t
发帖数: 10904
1
以及 mv 文件的时候,内核如何防止 race condition? inode semaphore 具体来讲是
怎么设置的?
S*A
发帖数: 7142
2
what race condition do you want to prevent?
mv inside the same file system is very simple.
It does not change the inode much at all, it just change
the directory entry that points to the inode.
Some file system allow more than one directory entry
points to the same inode (hard link).

【在 r****t 的大作中提到】
: 以及 mv 文件的时候,内核如何防止 race condition? inode semaphore 具体来讲是
: 怎么设置的?

r****t
发帖数: 10904
3
Thanks, this directory entry is another inode, isn't it?
Is this modification of pointer atomic?
What if two users trying to mv a file at about the same time, would there be
any possible race condition?

【在 S*A 的大作中提到】
: what race condition do you want to prevent?
: mv inside the same file system is very simple.
: It does not change the inode much at all, it just change
: the directory entry that points to the inode.
: Some file system allow more than one directory entry
: points to the same inode (hard link).

G*****h
发帖数: 33134
4
kernel takes care of it bah.
kernel makes sure it is atomic

be

【在 r****t 的大作中提到】
: Thanks, this directory entry is another inode, isn't it?
: Is this modification of pointer atomic?
: What if two users trying to mv a file at about the same time, would there be
: any possible race condition?

S*A
发帖数: 7142
5

No, directory file is another file own by file system itself.
It contain many directory entry. The entry entry is just contain
the name and attribute and file it points to. The main purpose
is to do the name to inode lookup.
In journal file system, you can consider it atomic on disk.
In other file system, no, it is not atomic on disk. That is
why it need fsck after unclean shutdown.
In memory it is usually protected by the directory lock.
be
No, all write to a directory file has lock (usually associate with
that directory) to serialize it.
It is the same as one try to unlink and the other one try to create
the same file.

【在 r****t 的大作中提到】
: Thanks, this directory entry is another inode, isn't it?
: Is this modification of pointer atomic?
: What if two users trying to mv a file at about the same time, would there be
: any possible race condition?

1 (共1页)
进入Linux版参与讨论
相关主题
最准确,精简 spinlock VS semaphore 的 区别??奇怪的df
大家ssh连ubuntu 9.1登录有多快?急问:linux 2.6 里,如何从inode得到ext2_inode_info?
问个关于find 的问题为啥用mmap访问文件的效率高呢?
gnome下面如何该一类文件的icon?linux太毁硬盘了
Symbolic Link: ln 和 cp -s 是一样的么?为啥 inode-cache 的内存算在 used 里面,不算在 cached 里面呢?
大家能帮我看一下下面的问题吗,不胜感激。用一个linux系统读一个linux硬盘,被读的硬盘会留痕迹吗
A simple Bash question about changing directoryLinux的文件ACL信息存在什么地方的?
想修改buffer cache的内核代码?请问从哪开始并口驱动的一个问题 (转载)
相关话题的讨论汇总
话题: inode话题: file话题: directory话题: entry话题: ssa