All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* some ext2-understanding problems (page cache etc.)
@ 2004-04-30  1:21 Christof
  2004-04-30 20:29 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Christof @ 2004-04-30  1:21 UTC (permalink / raw
  To: linux-kernel

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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: some ext2-understanding problems (page cache etc.)
  2004-04-30  1:21 some ext2-understanding problems (page cache etc.) Christof
@ 2004-04-30 20:29 ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2004-04-30 20:29 UTC (permalink / raw
  To: Christof; +Cc: linux-kernel

On Fri, Apr 30, 2004 at 03:21:19AM +0200, Christof wrote:
> 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.

You're probably better off using the the libext2fs library that is
part of e2fsprogs, since it is already userspace code.  

						- Ted

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-04-30 20:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-30  1:21 some ext2-understanding problems (page cache etc.) Christof
2004-04-30 20:29 ` Theodore Ts'o

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.