Sponsored Content
Full Discussion: Help with Inodes please
Top Forums UNIX for Advanced & Expert Users Help with Inodes please Post 302567242 by Group_Inode on Sunday 23rd of October 2011 11:19:20 AM
Old 10-23-2011
OS : freebsd 8.2 release

As of now we have understood that any program uses struct stat structure to store temporary inode info and display it. The struct stat structure gets info from struct inode (defined in inode.h) which in turn gets info from struct dinode. The struct dinode is (or may be, I am not sure) is the actual physical representation of the inode structure.

I also tried studying ls.c source code. I found that it uses another important structures struct FTS and struct FTSENT for traversing the file system hierarchy using functions defined in fts.c. Now the problem is that fts.c uses systemcalls like fstat() and open() for accessing inode information
I'm trying to find how the information is retrieved from dinode and printed on the console or to the file. Once I know how it is retrieved, I'll try to add a field to dinode structure last_modified_by i.e it would have the username who lastly modified that file. I'll probably try to modify ls.c also to display information on console.

I think the path for the system calls are two fold:
1. Filesystem Independent system calls present in /usr/src/lib/libstand
2. Filesystem Dependent system calls present in /usr/src/lib/libstand/<file_system.c>

I have read /usr/src/lib/libstand/stand.h which I think is the periphery of Platform Independence. I t has a structure called struct fs_ops which has function pointers for system calls like *open(), *stat(), *fstat() etc.
These function pointers are made to point to actual system calls from different Platform Dependent file systems like ext2fs , ufs etc.
This is done by the open system call ( by reading from the struct open_file files] and struct fs_ops *file_system[).
I think if we want to add thi field for a particular file system, then I should try to make changes in file system C files like ufs.c and vfs.c ( and so on ...)

Now I was thinking that modifying already implemented file systems is a messy thing. So, I was planning to make my own file system. This file system code will only include the necessary fs_ops (File system Operations i.e. system calls) and putting the appropriate pointers in stand.h. Am I thinking right?

I read an IBM Developer Forum for FUSE which explained how to create a File System in User Space which explained something very similar. The link is as follows:
http://www.ibm.com/developerworks/linux/library/l-fuse/

Can you please suggest if I am on the right track or not. And also can you suggest some links I can read, that might help me for the same( ie For creating or modifying the file system)

Last edited by Group_Inode; 01-08-2012 at 01:31 AM..
 

10 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

INodes...

Could someone please explain to me the concept of INodes? Colour me a DOS/MacOS junkie, but I don't quite understand. Is there any relation to clusters, or physical distro.? ty. (3 Replies)
Discussion started by: boris888
3 Replies

2. Solaris

inodes???

Does anyone know what command I can run to check how many inodes are in use on a specific filesystem. On Data General servers I used to run the df -k command to check the status of the inodes for all file system.s (1 Reply)
Discussion started by: soliberus
1 Replies

3. Solaris

inodes

hi i need to find all the files that r linked to the current file as i need to delete the file as well as few of its links :confused: thnx in advance (1 Reply)
Discussion started by: livemyway
1 Replies

4. UNIX for Dummies Questions & Answers

inodes

how is the location of inodes in the physical disk. are they sequential like: bootblock|superblock|inode1|inode2| ....| datablock1|datablock2|datablock3 or are they distributed among data blocks like: bootblock|superblock|inode1|datablock1|inode2|datablock2|datablock3|inode3 |datablock4 (3 Replies)
Discussion started by: gfhgfnhhn
3 Replies

5. Linux

Inodes

Any good sites, tutorials that explain Inodes clearly and completely ? (3 Replies)
Discussion started by: nitin09
3 Replies

6. Solaris

Number of used inodes..?

Hello Experts How can i know Number of used and free inodes in a file system? thanx in advance.. (3 Replies)
Discussion started by: younus_syed
3 Replies

7. Solaris

Increasing inodes

Hi , Can someone help me to increase "inode" in solaris 9? Thanks in advance, Gowtham (8 Replies)
Discussion started by: gowthamakanthan
8 Replies

8. Filesystems, Disks and Memory

inodes

Hi, sorry to have written in other language i think i could do that. I would to know A file system use inodes indexed allocation as a method of allocating space. In the inode blocks are 10 references to direct, 1 indirect reference to a single block, 1 block indirect reference to a reference to... (1 Reply)
Discussion started by: maryprin
1 Replies

9. Solaris

/var: out of inodes

Dear Forum, Please help me i have SUNW,Sun-Fire-V240 with sun solaris 8,if i check inode in /var like below: # df -F ufs -o i Filesystem iused ifree %iused Mounted on /dev/md/dsk/d0 62354 310638 17% / /dev/md/dsk/d3 372992 0 100% /var... (2 Replies)
Discussion started by: fredginting
2 Replies

10. Shell Programming and Scripting

Maximum inodes

Hi, Is there a restriction in the number of inodes a particular directory can have in Solaris. If so how can we determine that. Regards (3 Replies)
Discussion started by: @bhi
3 Replies
SYNCER(4)                                                  BSD Kernel Interfaces Manual                                                  SYNCER(4)

NAME
syncer -- file system synchronizer kernel process SYNOPSIS
syncer DESCRIPTION
The syncer kernel process helps protect the integrity of disk volumes by flushing volatile cached file system data to disk. The kernel places all vnode(9)'s in a number of queues. The syncer process works through the queues in a round-robin fashion, usually pro- cessing one queue per second. For each vnode(9) on that queue, the syncer process forces a write out to disk of its dirty buffers. The usual delay between the time buffers are dirtied and the time they are synced is controlled by the following sysctl(8) tunable variables: Variable Default Description kern.filedelay 30 time to delay syncing files kern.dirdelay 29 time to delay syncing directories kern.metadelay 28 time to delay syncing metadata SEE ALSO
sync(2), fsck(8), sync(8), sysctl(8) HISTORY
The syncer process is a descendant of the 'update' command, which appeared in Version 6 AT&T UNIX, and was usually started by /etc/rc when the system went multi-user. A kernel initiated 'update' process first appeared in FreeBSD 2.0. BUGS
It is possible on some systems that a sync(2) occurring simultaneously with a crash may cause file system damage. See fsck(8). BSD July 14, 2000 BSD
All times are GMT -4. The time now is 03:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy