[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::digital_unix

Title:DIGITAL UNIX(FORMERLY KNOWN AS DEC OSF/1)
Notice:Welcome to the Digital UNIX Conference
Moderator:SMURF::DENHAM
Created:Thu Mar 16 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:10068
Total number of notes:35879

9073.0. "file id?, i-node? v-nodes?" by GRIFUN::BENVI () Fri Mar 07 1997 12:27

HI all,
is there a way to get the maximum number of file-id per process? 
the maximum number of i-nodes?
which is the relationship between v-nodes, i-nodes and file-id?

Thanks in advance
Angelo
T.RTitleUserPersonal
Name
DateLines
9073.1NABETH::alanDr. File System's Home for Wayward Inodes.Fri Mar 07 1997 14:1158
	If by "file-id" you mean file descriptors, you can use the
	getdtablesize(2) system call to get the size of file descriptor
	table.  It is guaranteed to be a minimum of 64 entries and
	will typically be 4096.  I believe there is a parameter that
	can be used to change the size.

	For each open file, socket, pipe, etc, there is a file
	descriptor.  This descriptor refers to an entry in the
	process' file table (struct file).  Depending on the
	implementation, the system will keep the whole system
	wide file table as a list or array.� Quoting the comments
	in /usr/include/sys/file.h:

	"One file structure is allocated for each open/creat/pipe
	 call. Main use is to hold the read/write pointer associated
	 with each open file."

	Among the fields of the data structure are function pointers
	for handling the read, write, ioctl, select and close functions
	specific to the type of type, an address that points to the
	data structure for handling the rest of the file information;
	a vnode, socket data structure, or whatever else is appropriate,
	credentials, etc.

	Since the introduction of the Network File System, most UNIX
	systems have supported at least two different kinds of file
	systems; a local one for disks and NFS.  Over the years many
	others have been added.  Digital UNIX supports UFS and AdvFS for
	local read/write use, NFS for network use, CDFS for ISO-9660
	CDROM, and other specialized ones (procfs for example).

	The vnode interface generalizes the interface between the
	the high level file interface and the multiple lower level
	file system specific interfaces.  Like the (struct file),
	the vnode data structure contains function pointers for all
	the different of file system operations.  The vnode layer
	calls the appropriate function for the operation desired.
	I don't know if the size of the vnode table is fixed or
	dyamic.  Older UNIX systems made it fixed, but OSF/1 went
	to a lot of work to make such tables dynamic.

	The inode is an on-disk data structure used for files on UFS,
	which is an implementation of the Berkeley Fast File System.
	The number of inodes available on a file system is specific
	to an instance of that file system.  The space of the file
	system is divided into groups of cylinder, with each group
	having an area of inodes.  The size of the area is fixed when
	the file system is created, though the size can vary some.
	Typically each cylinder group may have 2048 inodes, but this
	is an adjustable parameter when the file system is created.
	The limit on inodes then is the product of the number of inodes
	per group and the number of cylinder groups.

	AdvFS has a comparible data structure that isn't called inode,
	which is a bit more dynamic.  The number of these data structure
	is limited as people using for News have found out, but with
	careful planning up front and regular maintenance, it can handle
	the growth of many file creation loads.