Skip to contentSkip to conversation

keys and inodes

DISCUSSION jenn sirp 3 participants 4 messages Jul 2, 2004 – Jul 4, 2004

lore
Share & tools
lore

jenn sirp

author
#0 lore raw

Hi,

I was hoping someone might be able to answer a couple of questions about inodes is Reiser(v3).

I would like to know how ReiserFS inodes and the VFS inodes in the d_cache correspond with each other. Specifically, how and where it is that 'keys' get mapped to inodes in the system?

Do ReiserFS keys change or get reconstructed when tails are packed or when the tree gets re-balanced? Or do keys remain consistent throughout a file's lifetime in the system?

Even the quickest response would be greatly appreciated.

Thanks,

Jenn

#1 lore raw

Hello

Quoted 7 lines · jenn sirp

Hi,

I was hoping someone might be able to answer a couple of questions about inodes is Reiser(v3).

I would like to know how ReiserFS inodes and the VFS inodes in the d_cache correspond with each other.

You might want to read about dentry-inode relationship in linux/Documentation/filesystem/vfs.txt.

Specifically, how and where it is

Quoted 1 line

that 'keys' get mapped to inodes in the system?

Reiserfs provides set of vfs operations. The one which is responsible for mapping keys to inode is lookup method. reiserfs implementation is reiserfs_lookup. It searches for the file name in filesystem tree. If name is found - file key is extracted from it and VFS inode is created (connected to d_cache dentry). File key is stored in reiserfs specific portion of VFS inode.

Quoted 3 lines

Do ReiserFS keys change or get reconstructed when tails are packed or when the tree gets re-balanced?

No. Once file is created - its key never changes. However, each position in a file has its own key. For instance, 0-th byte of a file has key X, Y, 1. 100-th byte of a file should be looked for with key X, Y, 101. [X, Y] is the same for any part of file. This is what is extracted from file name on lookup. Key of any other position within a file can be easily calculated as we saw.

Or do keys remain consistent throughout

Quoted 2 lines

a file's lifetime in the system?

Yes.

Quoted 10 lines

Even the quickest response would be greatly appreciated.

Thanks,

Jenn

#2 lore raw

So, inode numbers on Reiser are alocated on the fly, as files are used, and those numbers will change, so for example, ls -i is useless with reiser, as that number given for each file will change once the vfs structure gets released and later the file gets used again ?

Just checking,

Marcelo Pacheco

Quoted 46 lines · Vladimir V. Saveliev

Hello

Quoted 7 lines · jenn sirp

Hi,

I was hoping someone might be able to answer a couple of questions about inodes is Reiser(v3).

I would like to know how ReiserFS inodes and the VFS inodes in the d_cache correspond with each other.

You might want to read about dentry-inode relationship in linux/Documentation/filesystem/vfs.txt.

Specifically, how and where it is

Quoted 1 line

that 'keys' get mapped to inodes in the system?

Reiserfs provides set of vfs operations. The one which is responsible for mapping keys to inode is lookup method. reiserfs implementation is reiserfs_lookup. It searches for the file name in filesystem tree. If name is found - file key is extracted from it and VFS inode is created (connected to d_cache dentry).
File key is stored in reiserfs specific portion of VFS inode.

Quoted 2 lines

Do ReiserFS keys change or get reconstructed when tails are packed or when the tree gets re-balanced?

No. Once file is created - its key never changes. However, each position in a file has its own key. For instance, 0-th byte of a file has key X, Y, 1. 100-th byte of a file should be looked for with key X, Y, 101. [X, Y] is the same for any part of file. This is what is extracted from file name on lookup. Key of any other position within a file can be easily calculated as we saw.

Or do keys remain consistent throughout

Quoted 1 line

a file's lifetime in the system?

Yes.

Quoted 5 lines

Even the quickest response would be greatly appreciated.

Thanks,

Jenn

#3 lore raw

Hello

Quoted 2 lines · Marcelo Pacheco

So, inode numbers on Reiser are alocated on the fly, as files are used, and those numbers will change, so for example, ls -i is useless with reiser, as that number given for each file will change once the vfs structure gets released and later the file gets used again ?

No, once file is created ls -i will always return the same inode number for it.

Quoted 60 lines

Just checking,

Marcelo Pacheco

Quoted 51 lines · Vladimir V. Saveliev

Hello

Quoted 7 lines · jenn sirp

Hi,

I was hoping someone might be able to answer a couple of questions about inodes is Reiser(v3).

I would like to know how ReiserFS inodes and the VFS inodes in the d_cache correspond with each other.

You might want to read about dentry-inode relationship in linux/Documentation/filesystem/vfs.txt.

Specifically, how and where it is

Quoted 1 line

that 'keys' get mapped to inodes in the system?

Reiserfs provides set of vfs operations. The one which is responsible for mapping keys to inode is lookup method. reiserfs implementation is reiserfs_lookup. It searches for the file name in filesystem tree. If name is found - file key is extracted from it and VFS inode is created (connected to d_cache dentry).
File key is stored in reiserfs specific portion of VFS inode.

Quoted 2 lines

Do ReiserFS keys change or get reconstructed when tails are packed or when the tree gets re-balanced?

No. Once file is created - its key never changes. However, each position in a file has its own key. For instance, 0-th byte of a file has key X, Y, 1. 100-th byte of a file should be looked for with key X, Y, 101. [X, Y] is the same for any part of file. This is what is extracted from file name on lookup. Key of any other position within a file can be easily calculated as we saw.

Or do keys remain consistent throughout

Quoted 1 line

a file's lifetime in the system?

Yes.

Quoted 5 lines

Even the quickest response would be greatly appreciated.

Thanks,

Jenn