*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> fsctl (7)              
Title
Content
Arch
Section
 

Contents


FSCTL(7)							      FSCTL(7)


NAME    [Toc]    [Back]

     fsctl - operations	on a mounted file system

SYNOPSIS    [Toc]    [Back]

     /dev/fsctl

DESCRIPTION    [Toc]    [Back]

     fsctl presents a device interface for performing low-level	operations on
     a mounted file system.  This driver is used by the	file system
     reorganizer, fsr.

     WARNING: this driver does NOT copy	or otherwise operate on	data within
     file system blocks.  This can be done through the raw device interface to
     the file system.

     Only the superuser	can open /dev/fsctl.  Only one process at a time can
     open this device.

     The following operations are available as ioctl(2)	calls on a file
     descriptor	opened on this device.	The second argument to ioctl(2)	is the
     command name.  The	third argument is a pointer to a struct	fscarg with
     the specified fields appropriately	set.  The command names	and the
     structure are defined in /usr/include/sys/fsctl.h.

     ILOCK dev inum    [Toc]    [Back]
	       Locks the inode,	synchronously updates the physical disk	with
	       the current state of the	in-core	inode, synchronously updates
	       the file's data blocks to disk, and invalidates any cached
	       pages for this inode.  This is an inode lock which will cause
	       any system call from any	process	to block until released	by an
	       IUNLOCK.

	       [EFAULT]	 Failed	to copy	in argument to ioctl(2).

	       [EBUSY]	 Another inode is already locked by this device, or
			 the specified inode is	in use.

	       [ENOENT]	 The file system was unmounted before the inode	could
			 be read from the disk and locked.

	       [EINVAL]	 The device is not a mounted file system, or the inode
			 is not	a regular file.

	       [EFBIG]	 Failed	to read	in indirect extents.

     IUNLOCK dev inum    [Toc]    [Back]
	       Unlocks the inode.

	       [EFAULT]	 Failed	to copy	in argument to ioctl(2).






									Page 1






FSCTL(7)							      FSCTL(7)



	       [EINVAL]	 The specified inode is	not currently ILOCK'ed.

     ICOMMIT dev inum ne ex ni ix    [Toc]    [Back]
	       This commits the	new direct and indirect	extents, and
	       synchronously updates the new inode and indirect	extents	to
	       disk.  The state	of the inode is	otherwise unchanged -- ICOMMIT
	       does not	update the inode ctime,	or mtime, for example.	ne is
	       the number of direct extents.  ex is a pointer to the direct
	       extents.	 nie is	the number of indirect extents.	 ix is the
	       pointer to the indirect extents.	 A check is made that all
	       blocks described	in the new extent and indirect extents are
	       valid and allocated data	blocks.	 This does NOT copy the
	       contents	of any data blocks in the implied move as a result of
	       ICOMMIT'ing new extents,	nor does ICOMMIT automatically free
	       any blocks which	are now	no longer described by the file's
	       extents.	 If ICOMMIT fails for any reason the inode and its
	       data remain intact and unchanged.

	       [EFAULT]	 Failed	to copy	in argument to ioctl(2).

	       [EINVAL]	 The specified inode is	not ILOCK'ed.

	       [EINVAL]	 The extent information	is not valid.  The extent and
			 indirect extent information must be consistent	and
			 the blocks they describe must be allocated.

	       [EFAULT]	 Failed	to copy	in argument to ioctl(2)	or the extent
			 lists to which	this points.

     BALLOC/BFREE dev bn len
	       Allocates/frees the specified blocks.

	       [EFAULT]	 Failed	to copy	in argument to ioctl(2).

	       [EINVAL]	 There is currently no ILOCK'ed	inode in the specified
			 device.

	       [EINVAL]	 The specified data blocks are not valid data blocks.

	       [EEXIST]	 The specified data blocks are not currently
			 free/allocated.

     TSTALLOC/TSTFREE dev bn
	       Returns the number of cylinder group data blocks	allocated/free
	       on the specified	dev starting at	block bn.

	       [EFAULT]	 Failed	to copy	in argument to ioctl(2).

	       [EINVAL]	 There is currently no ILOCK'ed	inode in the specified
			 device.





									Page 2






FSCTL(7)							      FSCTL(7)



	       [EINVAL]	 The block number is not a valid data block number.

REORGANIZER USAGE    [Toc]    [Back]

     The reorganizer, fsr, uses	/dev/fsctl as follows:

     open(/dev/fsctl)
     for each file system
	  for each regular file
	       ILOCK
	       find better location using TSTFREE/TSTALLOC
	       BALLOC new bn+len
	       copy blocks to new bn+len using fs device
	       ICOMMIT new extents using new bn+len
	       BFREE old bn+len
	       IUNLOCK
     close(/dev/fsctl)

FILES    [Toc]    [Back]

     /usr/include/sys/fsctl.h

SEE ALSO    [Toc]    [Back]

      
      
     fsr(1M).

DIAGNOSTICS    [Toc]    [Back]

     These ioctl(2)'s all return -1 on error.  Otherwise, all commands except
     TSTALLOC and TSTFREE return 0.


									PPPPaaaaggggeeee 3333
[ Back ]
 Similar pages
Name OS Title
mnttab HP-UX mounted file system table
ustat HP-UX get mounted file system statistics
rmtab IRIX remotely mounted file system table
vfs_mountedon FreeBSD check if the vnode belongs to a mounted file system
mklost+found Linux create a lost+found directory on a mounted Linux second extended file system
pfs_fstab HP-UX static file system mounting table, mounted file systems table
getmntinfo_r Tru64 Get information about mounted file systems
getfsstat OpenBSD get list of all mounted file systems
getmntinfo OpenBSD get information about mounted file systems
getmntinfo Tru64 Get information about mounted file systems
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service