some ext2-understanding problems (page cache etc.)

From: Christof (mail_at_pop2wap.net)
Date: 04/30/04

  • Next message: Rob Couto: "Re: well-supported motherboard"
    Date:	Fri, 30 Apr 2004 03:21:19 +0200
    To: linux-kernel@vger.kernel.org
    
    

    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@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Rob Couto: "Re: well-supported motherboard"

    Relevant Pages

    • Re: size_t or int for malloc-type functions?
      ... Some go as high as 3GB with special boot ... RedHat has a special Linux kernel that gives just under 4GB of user address space; a bit of kernel space is still required to keep syscalls working, ... It's mainly used by database folks, who should be moving to AMD64 now anyways (with its 2^51 bytes of user space, currently). ... of like the old extended/expanded memory hacks in the DOS days. ...
      (comp.lang.c)
    • Re: [swsusp] separate snapshot functionality to separate file
      ... >> Split does not prevent you from doing the cleanups. ... Kernel needs to use get_user, ... > memory directly from the used space. ... > not be visible to the user space at all. ...
      (Linux-Kernel)
    • Re: Virtual memory - user space kernel space
      ... It depends upon the total size of kernel code and static data. ... 1G/3G division in virutal memory is nothing but a set of pointers to ... User space pointers has to go via MMU to get the location in physical ... you bumble virtual and physical memory. ...
      (comp.os.linux.development.system)
    • Re: Checkpoint/restart (was Re: [PATCH 0/4] - v2 - Object creation with a specified id)
      ... kernel representation. ... If the state can be inferred from user space it is visible to user ... In the worst case today we can restore a checkpoint by replaying all of ... Checkpoints coordinated between multiple containers or real ...
      (Linux-Kernel)
    • Re: [swsusp] separate snapshot functionality to separate file
      ... Kernel needs to use get_user, ... >> memory directly from the used space. ... >> not be visible to the user space at all. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)