> Damn. I've just run into a snag. My read_inode() needs to dereference
> inode->u.generic_ip, however, I can only initialise this *after* the
> call to iget() finishes. Now, I could shoehorn my pointer into
> inode->ino (thanks to it being an unsigned long), but that's pretty
> gross.
>
> I also notice iget4() and the read_inode2() method, however, from the
> comments, it looks like those are reiserfs-specific, and will die
> soon. At the very least, it seems use thereof is discouraged.
>
> Suggestions?
Lose ->read_inode(). Since your inode numbers are not stable across
reboot you can't use iget for NFS-exporting devfs (even if you would
want to export it in the first place). So there is no reason whatsoever
to use it.
Add put_inode: force_delete, into your super_operations and replace
your call of iget() with
inode = new_inode(sb);
if (inode) {
inode->i_ino = whatever;
/* stuff you've used to do in devfs_read_inode */
}
Notice that here you have pointer to 'entry', so there is no problem
with passing it. ->read_inode() simply goes away. Besides, that way
you don't pollute icache hash chains - devfs inodes stay out of hash.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/