some ext2-understanding problems (page cache etc.)

From: Christof
Date: Thu Apr 29 2004 - 20:22:48 EST


Hello,

I'm not a kernel guru, but my task is to extract some ext2-code from the kernel into user space for a scientific project/experiment. I've "ported" a lot of code by now but now I am stuck.
I wanted to bypass the page cache and disk buffer and have all writes and reads directly in memory. I don't want to get into details, but imagine I have an image of an ext2-filesystem in memory and want to access it in user space but with the same interface as it would be in the kernel.

My problem at the moment is the function ext2_make_empty.
It is called in ext2_mkdir after an inode has been created.
It looks like the ext2_make_empty creates the basic dir entries like "." and ".." but I cannot find the block number where this information is written on disk. There seems to be a function get_block but i'm not sure what it exactly does. Could you help me to understand how and when block-numbers are set?

I see 2 possibilities:
1. The block numbers are set at the moment files/dirs are created,
changed etc.
2. First, pages are requested. When they need to be written, a block
number is obtained (if needed).

Is any of these ideas true?
Once again: I need to replace all writes and reads to and from pages and buffers by writes and reads to block numbers on the given device.

Thanks in advance!

--
Q: What's little, yellow and very very dangerous?
A: A canary with the super-user password.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/