Re: inode numbers

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

 



On Tue, 10 Oct 2006 19:15:15 +0200
"Jakko Pastuchio" <jakkop@xxxxxxxxx> wrote:

> Hi All !

Hi,

> I wonder how inodes numbers are allocated/maintainded/recycled.

Inode numbers are FS specific. Most FS preallocates a certain amount of
inodes (considering the size of the FS), and use a bitmap to tag them
as used/free.

So when creating a file, you just search this bitmpa for a free inode,
when deleting a file (the last hard link pointing to it) you set as free
the corresponding bit in the bitmap.

> does every file on disk have a unique inode number (which is kept

Yes, but several directory entry (dentry) may point to the same file,
either using soft or hard links.

Hard links use inode numbers and are limited to a specific FS.
Actually, the common "file" idea on a FS system is only a "file
ressource" (ie the data on disk) accessed by one or more hard links
(removing a file is done by using unlink(2)).

Soft links uses paths (to reference hard links) and can reference files
over other FS.

> on the disk) and that inode number never changes ?

Inode number never changes.
 
> or does the inode numbers are given only when that file is opened ?

No, when the file is created.

Vincent

--
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