Re: VFS layer filesytem tracking
On Wed, Dec 8, 2010 at 8:00 AM, sanoj wrote: > Hello all, > I want to track the read/write operations for a particular inode at the vfs > layer. > I added the following structure as a field to struct inode. > struct meta_info > { > unsigned int read_count; > unsigned int write_count; > }; Looking at the fields it seems you want this only incore...and I guess you want to count how many reads or writes came to a particular file. > This caused a problem in mounting the root device , what could be the cause > ? Can you tell us what was the error/problem ? Stack trace would be better. > Am i allowed modify the struct inode by adding a new field ? Sure :-) ... you are allowed to modify incore ondisk anything as long as you make code understand those structures (or if you are adding something in spare bytes which might get ignored). If you change something ondisk structure you will need to fix other userspace utilities which may parse this (in the worst case throw away your old filesystem and create new one if it changes the size of ondisk inode). > Also, i would like to know if there are any existing mechanisms that can > help me track the workload . > at various levels > Thanks, HTH > sanoj > -- Thanks - Manish == [$\*.^ -- I miss being one of them == -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecar...@nl.linux.org Please read the FAQ at http://kernelnewbies.org/FAQ
Re: VFS layer filesytem tracking
On Wed, Dec 8, 2010 at 11:00 AM, sanoj wrote: > Hello all, > I want to track the read/write operations for a particular inode at the vfs > layer. > I added the following structure as a field to struct inode. > struct meta_info > { > unsigned int read_count; > unsigned int write_count; > }; > This caused a problem in mounting the root device , what could be the cause > ? > Am i allowed modify the struct inode by adding a new field ? > Also, i would like to know if there are any existing mechanisms that can > help me track the workload . > at various levels > Thanks, > sanoj There are 2 instances of inode I believe. One is the on disk layout, and one is the ram layout. You can modify the ram layout to your hearts content, but the disk layout you have to be very precise with. The trouble is the ram instance will of course be free'd from time to time, so you can't keep data in there forever. I don't positively recall the lifetime rules for the ram instance, but I think as long as a file is open, the inode is kept in RAM. I also think there are ways to lock an inode in RAM if you need it RAM resident over multiple open/close sessions. Greg -- Greg Freemyer Head of EDD Tape Extraction and Processing team Litigation Triage Solutions Specialist http://www.linkedin.com/in/gregfreemyer CNN/TruTV Aired Forensic Imaging Demo - http://insession.blogs.cnn.com/2010/03/23/how-computer-evidence-gets-retrieved/ The Norcross Group The Intersection of Evidence & Technology http://www.norcrossgroup.com -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecar...@nl.linux.org Please read the FAQ at http://kernelnewbies.org/FAQ
Re: VFS layer filesytem tracking
On Wed, Dec 8, 2010 at 23:00, sanoj wrote: > Hello all, > I want to track the read/write operations for a particular inode at the vfs > layer. Try inotify -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecar...@nl.linux.org Please read the FAQ at http://kernelnewbies.org/FAQ
VFS layer filesytem tracking
Hello all, I want to track the read/write operations for a particular inode at the vfs layer. I added the following structure as a field to struct inode. struct meta_info { unsigned int read_count; unsigned int write_count; }; This caused a problem in mounting the root device , what could be the cause ? Am i allowed modify the struct inode by adding a new field ? Also, i would like to know if there are any existing mechanisms that can help me track the workload . at various levels Thanks, sanoj