Re: is there any prob in accessing new field added to inode mem structure, in some other functions?

From: Andreas Dilger (adilger_at_clusterfs.com)
Date: 12/15/04

  • Next message: Matt Domsch: "Re: How to add/drop SCSI drives from within the driver?"
    Date:	Wed, 15 Dec 2004 14:22:53 -0700
    To: Vineet Joglekar <vintya@excite.com>
    
    
    

    On Dec 15, 2004 11:41 -0500, Vineet Joglekar wrote:
    > I am using linux 2.4.21 and I am trying to play with the etx2 file system. My aim is to allocate a data structure dynamically to every file that is opened, at the time of opening.
    > What I tried to do was: added the structure pointer in the inode data structure "ext2_inode" say "x_ptr". In the function "ext2_read_inode" which reads the hard disk copy of inode into memory, I allocated memory to this pointer and filled the appropriate value. I chose this function as I thought when a file is opened, this function will be always called once. Upto this is working fine.
    >
    > Now when I try to use this pointer "x_ptr" in some other function, that is, "do_generic_file_read" - which is called while reading a file, I am not getting any value in that pointer, but a null. (which is supposed to be there as I am filling up appropriate value in function ext2_read_inode)

    You are confusing "ext2_inode" (on disk structure, never change that) with
    "ext2_inode_info" (in memory structure, what you want to change).

    Cheers, Andreas

    --
    Andreas Dilger
    http://sourceforge.net/projects/ext2resize/
    http://members.shaw.ca/adilger/             http://members.shaw.ca/golinux/
    
    

    -
    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/


    • application/pgp-signature attachment: stored

  • Next message: Matt Domsch: "Re: How to add/drop SCSI drives from within the driver?"

    Relevant Pages

    • Re: [PATCH] whitespace cleanups for fs/cifs/file.c
      ... > project cold and don't know how anything works or where it lives it ... Judicious use of gotos and some helper functions would help a lot ... Andreas Dilger ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: First impressions of reiserfs4
      ... the sys_statfs64API is broken such that the filesystem can't make ... we can't be guaranteed to fit into the 32-bit f_blocks counts ... Andreas Dilger ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: mutt segfault with ext3 & 1k blocks & htree in 2.6
      ... Normally an application segfault is really caused by a kernel OOPS, ... Andreas Dilger ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Directory link count wrapping on Linux/XFS/i386?
      ... However, in the kernel, I think this field is ... > This naturally doesn't let you screw up the filesystem or anything, ... Andreas Dilger ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Ext2/3 32-bit stat() wrap for ~2TB files
      ... so the sparse limit was enough. ... larger sparse files. ... Andreas Dilger ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)