在omfs_rename中下断点:
Breakpoint 4, omfs_rename (old_dir=0xddf2cca8, old_dentry=0xdde57330,
new_dir=0xddf2cca8, new_dentry=0xddf2f220) at fs/omfs/dir.c:392
Touch aaaa
Mv aaaa bbbb
相关阅读:
Linux文件系统omfs的目录创建和删除 http://www.linuxidc.com/Linux/2012-02/54025.htm
Linux文件系统omfs的目录创建和删除 http://www.linuxidc.com/Linux/2012-02/54025.htm
Linux文件系统omfs的普通文件创建和删除 http://www.linuxidc.com/Linux/2012-02/54026.htm
函数堆栈如下:
#0 omfs_rename (old_dir=0xddf2cca8, old_dentry=0xdde57330,
new_dir=0xddf2cca8, new_dentry=0xddf2f220) at fs/omfs/dir.c:392
#1 0xc02a0a8f in vfs_rename_other (old_dir=0xddf2cca8, old_dentry=0xdde57330,
new_dir=0xddf2cca8, new_dentry=0xddf2f220) at fs/namei.c:2619
#2 0xc02a0bee in vfs_rename (old_dir=0xddf2cca8, old_dentry=0xdde57330,
new_dir=0xddf2cca8, new_dentry=0xddf2f220) at fs/namei.c:2661
#3 0xc02a0e21 in sys_renameat (olddfd=-100, oldname=0xbfb8d933 “aaaa”,
newdfd=-100, newname=0xbfb8d938 “bbbb”) at fs/namei.c:2744
#4 0xc02a0ecd in sys_rename (oldname=0xbfb8d933 “aaaa”,
newname=0xbfb8d938 “bbbb”) at fs/namei.c:2766
#5 0xc0104657 in ?? () at arch/x86/kernel/entry_32.S:457
Sys_renameàsys_renameatàvfs_renameàvfs_rename_otheràomfs_rename
Old_dir和new_dir都是”/”的inode,old_dentry是”aaaa”的dentry,new_dentry是”bbbb”的dentry。
如果new_dentry是不存在的,那么删除原先的(omfs_unlink(old_dir, old_dentry);),
再在omfs_add_link(new_dentry, old_inode);
如果new_dentry存在,那么就是覆盖,在上面的步骤之前要omfs_unlink(new_dir, new_dentry);