Find the answer to your Linux question:
Results 1 to 2 of 2
Hi everyone I'm just starting in kenel programming, and have been working on modifying the ext2 file system. This might sound strange, but what i need to access the data ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2005
    Posts
    1

    Open files at filesystem level


    Hi everyone

    I'm just starting in kenel programming, and have been working on modifying the ext2 file system. This might sound strange, but what i need to access the data of a file by its inode, without using the filename.

    is that possible?

    i can't use filp_open cos that needs the whole path to work.

    Chris

  2. #2
    Linux User
    Join Date
    Oct 2004
    Location
    /dev/random
    Posts
    404

    Re: Open files at filesystem level

    Quote Originally Posted by ChrisBurrell
    Hi everyone

    I'm just starting in kenel programming, and have been working on modifying the ext2 file system. This might sound strange, but what i need to access the data of a file by its inode, without using the filename.

    is that possible?

    i can't use filp_open cos that needs the whole path to work.

    Chris
    Yes, ultimately, the file system driver's open() system call works only with an inode.
    This is the function you write in your fs driver and whose pointer goes into the file_operations structure of the driver. It is called by the VFS. Kernel/VFS translates the file name (including the path) to an inode before calling the driver specific functions.

    Check out:
    http://lxr.linux.no/source/include/linux/fs.h#L577
    and possibly, http://lxr.linux.no/source/include/linux/fs.h#L577
    The Unforgiven
    Registered Linux User #358564

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •