On Sun, Jul 5, 2009 at 11:08 PM, Donato Capitella<d.capitella@xxxxxx> wrote: > Ok, thanks, now it is clear to me. I thought that as the first 11 inodes > were reserved, they could be used right away. Instead, if I want to use > one I have to first initialize it. > > I'll try and let you know. > > Another question: do reserved inodes need to be referenced by a > directory entry? I would say it depends on how you are using it (btw you haven't told us yet why you need a reserved inode :-) ). For example root inode needs to be referenced by a directory entry but journal inode doesn't Thanks - Manish > > Thanks a lot, > Donato > > On Sun, 2009-07-05 at 22:37 +0530, Manish Katiyar wrote: >> On Sun, Jul 5, 2009 at 10:28 PM, Donato Capitella<d.capitella@xxxxxx> wrote: >> > Well, as it's a reserved inode, I didn't create it. stat <3> shows that >> > the inode has bad type... so this might be the problem. But how am I >> > supposed to initialize the inode fields if I can't read it? >> >> What are you reserving it for ? Note that the reserved inodes today (2 >> for root) & (8 for journal commonly) both are initialized during mkfs. >> You also need to do something similar. Depending on what you are using >> it for you may need to initialize it properly. To do that you can do >> the following :- >> >> a) Either write a simple C program to write the fields properly at >> correct offset. >> b) Hack the code of mkfs to include your inode too. >> c) Use debugfs to change the contents of inode 3. This is the easiest >> option but I am not sure if you can modify all the fields of the >> inode, so it depends on what you need. >> >> Thanks - >> Manish >> >> > >> > >> > On Sun, 2009-07-05 at 22:06 +0530, Manish Katiyar wrote: >> >> On Sun, Jul 5, 2009 at 7:30 PM, Donato Capitella<d.capitella@xxxxxx> wrote: >> >> > Hi there, >> >> > I need some help with a patch to the ext3 filesystem I'm developing. I'm >> >> > completelly new to kernel programming and I need to understand >> >> > practically how to use one of the ext3 reserved inode for storing a log. >> >> > >> >> > I thought it would be just as easy as getting the inode with the >> >> > ext3_iget() function, but it doesn't seem to be the case. For example, >> >> > if I try to load the third reserved inode like this : >> >> > >> >> > inode = ext3_iget(sb, 3); >> >> > >> >> > ext3_iget() fails somehow and crashes the process with a NULL pointer >> >> > reference. What am I missing here? >> >> Have you created the inode 3 ? What entries does it have ? What does >> >> "stat <3>" show from the debugfs ? >> >> >> >> Thanks - >> >> Manish >> >> >> >> >> >> > How do you use a reserved inode? Can >> >> > anybody point to some documentation or project that uses reserved >> >> > inodes? >> >> > >> >> > I'm really stuck :( >> >> > >> >> > Thanks a lot, >> >> > Donato Capitella >> >> > >> >> > >> >> > >> >> > -- >> >> > To unsubscribe from this list: send an email with >> >> > "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx >> >> > Please read the FAQ at http://kernelnewbies.org/FAQ >> >> > >> >> > >> >> >> >> >> >> >> > >> > >> >> >> > > -- Thanks - Manish -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ