[OpenAFS-devel] Linux 2.6.25 - R.I.P. iget()

Marc Dionne marc.c.dionne@gmail.com
Tue, 26 Feb 2008 23:03:52 -0500


Derrick Brashear wrote:
> On Feb 19, 2008 9:28 AM, Marc Dionne <marc.c.dionne@gmail.com> wrot=
e:
>  =20
>> There's already some code in osi_UFSOpen() and in the system call
>> interface to deal with filenames passed from afsd, so it doesn't l=
ook
>> too hard to try something like (I'll try to test this out):
>>  - Pass file names instead of inodes from afsd to the kernel modul=
e
>>  - Initially pass file names to InitCacheFile =96 this will do a l=
ookup
>> and should get inodes into the inode cache if they aren't already
>>  - Keep track of the association of file names and inodes in the k=
ernel code
>>  - For subsequent opening of cache files, first try iget_locked() =
with
>> the inode number.  If a new inode is returned, discard it and fall
>> back to doing a lookup with the file name
>>    =20
> Avoiding it entirely has the added benefit that we're effectively
> cache filesystem agnostic: suddenly, you can have a cache on reiser=
fs.
> Of course locking issues may remain. The code you see in afsd and t=
he
> syscall interface was added for MacOS 10.5, where the volfs trick
> being used like iget was to be de-exported for 10.5.
>  =20
I have working code (on ext3) for something similar to this that I'll=
=20
submit as part of the fixes for 2.6.25 :
- References to cache files are passed to the kernel module by inode,=
=20
directory number and V file number with a new AFSOP type.=20
- These numbers are stored alongside the inode numbers, and are used =
to=20
build the file name for every call to UFSOpen.=20
- UFSOpen has an extra parameter - it is always passed both an inode=
=20
number and a file name
- iget_locked() is first tried with the inode number - if it fails=
=20
(inode not in cache), a lookup is done with the file name
- File names for the special files (CellItems, etc.) are also stored =
and=20
passed to UFSOpen when needed
- All these changes are IFDEF'ed based on the non availability of ige=
t()

Out of curiosity I gave this a quick try with reiserfs and xfs, and g=
ot=20
some oopses in both cases.  So there's still other issues to work out=
=20
before these can be used.

Marc