linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: is there any prob in accessing new field added to inode mem structure, in some other functions?
@ 2004-12-15 21:42 Vineet Joglekar
  0 siblings, 0 replies; 3+ messages in thread
From: Vineet Joglekar @ 2004-12-15 21:42 UTC (permalink / raw)
  To: adilger, vintya; +Cc: linux-kernel


I am sorry, typing my mistake. I was changing (adding a pointer in) ext2_inode_info and NOT ext2_inode. still it was giving the problem.

someone mentioned about extended attributes. I dont have much idea about them, but will try to search on google.

 --- On Wed 12/15, Andreas Dilger < adilger@clusterfs.com > wrote:
From: Andreas Dilger [mailto: adilger@clusterfs.com]
To: vintya@excite.com
     Cc: linux-kernel@vger.kernel.org
Date: Wed, 15 Dec 2004 14:22:53 -0700
Subject: Re: is there any prob in accessing new field added to inode mem structure, in some other functions?

On Dec 15, 2004  11:41 -0500, Vineet Joglekar wrote:<br>> 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.<br>> 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.<br>> <br>> 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)<br><br>You are confusing "ext2_inode" (on disk structure, never change that) with<br>"ext2_inode_info" (in memory structure, what you want to change).<br><br>Cheers, Andreas<br>--<br>Andreas Dilger<br>http://sourceforge.net/projects/ext2resize/<br>http://members.shaw.ca/adilger/             http://members.shaw.ca/golinux/<br><br>Attachment: Attachment  (0.19KB)<br>

_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!

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

* Re: is there any prob in accessing new field added to inode mem structure, in some other functions?
  2004-12-15 16:41 Vineet Joglekar
@ 2004-12-15 21:22 ` Andreas Dilger
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Dilger @ 2004-12-15 21:22 UTC (permalink / raw)
  To: Vineet Joglekar; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1236 bytes --]

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/


[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* is there any prob in accessing new field added to inode mem structure, in some other functions?
@ 2004-12-15 16:41 Vineet Joglekar
  2004-12-15 21:22 ` Andreas Dilger
  0 siblings, 1 reply; 3+ messages in thread
From: Vineet Joglekar @ 2004-12-15 16:41 UTC (permalink / raw)
  To: linux-kernel





Hi all,

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)
In the do_generic_file_read, VFS inode is availavle, so I am trying to access my pointer as inode->u.ext2_i.x_ptr and I had accessed this pointer in the same way while allocating memory for it in read_inode. At the same time, in do_generic_file_read, I can access other inode parameters, but not this new one added.

Can someone please tell me where am I going wrong, or what could be the alternate solution to achieve this? This is very important for me.

Thanks and regards,

Vineet


_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!

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

end of thread, other threads:[~2004-12-15 21:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-15 21:42 is there any prob in accessing new field added to inode mem structure, in some other functions? Vineet Joglekar
  -- strict thread matches above, loose matches on Subject: below --
2004-12-15 16:41 Vineet Joglekar
2004-12-15 21:22 ` Andreas Dilger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).