Re: inode::rename post conditions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



MHD.Tayseer Alqouatli a écrit :
Hi all:
When the (vfs_rename_dir) or (vfs_rename_other) calls my underlying file system's inode::rename(old_dir, old_dentry, new_dir, new_dentry) What does the VFS expects from my filesystem to do when ? First .. sure the VFS expects my fs to do the actual renaming on disk blocks or update the metadata database or whatsoever, but what are the changes it expect regarding it's own object (which are: old_dir, old_dentry, new_dir, new_dentry in this case) I've expected that I've to do a kind of association between the new_dentry and the old_inode (as the old_inode will become the inode of the new_dentry after renaming) but when i tried to read some implementation of the inode::rename method on some simple file systems to see how it works I couldn't figure out when or where such an association is done (if it's really done) all that i've found is some changes in the counters i couldn't understand well
Have i miss something ? any pointers will be helpful
Thanks in advance
MHD
Hi,
if you just rename the file, the inode structure should't change.
But the dentry should change. Especially the d_name field.
But also note that you have to change the parent directory. A directory is a file which contains a list of his files. So you have to change this list.
I think you juste have to do these operations. But im not a fs expert :)


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux