Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

lfs_markv(2) [netbsd man page]

LFS_MARKV(2)						      BSD System Calls Manual						      LFS_MARKV(2)

NAME
lfs_markv -- rewrite disk blocks to new disk locations LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <sys/types.h> #include <ufs/lfs/lfs.h> int lfs_markv(fsid_t *fsidp, BLOCK_INFO *blkiov, int blkcnt); DESCRIPTION
lfs_markv() rewrites the blocks specified in blkiov to new disk locations, for the purposes of grouping them next to one another, or to move them out of a segment to clean it. All fields of the BLOCK_INFO structure must be filled in, except for bi_segcreate. If bi_daddr is not the correct current address for logical block bi_lbn of the file with inode number bi_inode, or if the file's version number does not match bi_version, the block will not be written to disk, but no error will be returned. The fsidp argument contains the id of the filesystem to which the inodes and blocks belong. The bi_bp field contains bi_size bytes of data to be written into the appropriate block. If bi_lbn is specified as LFS_UNUSED_LBN, the inode itself will be rewritten. The blkiov argument is an array of BLOCK_INFO structures (see below). The blkcnt argument determines the size of the blkiov array. typedef struct block_info { ino_t bi_inode; /* inode # */ ufs_daddr_t bi_lbn; /* logical block w/in file */ ufs_daddr_t bi_daddr; /* disk address of block */ time_t bi_segcreate; /* origin segment create time */ int bi_version; /* file version number */ void *bi_bp; /* data buffer */ int bi_size; /* size of the block (if fragment) */ } BLOCK_INFO; RETURN VALUES
lfs_markv() returns 0 on success, or -1 on error. ERRORS
An error return from lfs_markv() indicates: [EFAULT] fsidp points outside the process's allocated address space. [EINVAL] *fsidp does not specify a valid filesystem. [EBUSY] One or more of the inodes whose blocks were to be written was locked, and its blocks were not rewritten. SEE ALSO
lfs_segclean(2), lfs_segwait(2), lfs_cleanerd(8) HISTORY
The lfs_markv() function call appeared in 4.4BSD. BUGS
The functionality of lfs_markv() does not really belong in user space. Among other things it could be used to work around the SF_IMMUTABLE and SF_APPEND file flags (see chflags(2)). BSD
May 23, 2000 BSD

Check Out this Related Man Page

sg_get_fs_stats(3)					     Library Functions Manual						sg_get_fs_stats(3)

NAME
sg_get_fs_stats - get filesystem statistics SYNOPSIS
#include <statgrab.h> sg_fs_stats *sg_get_fs_stats(int *entries); DESCRIPTION
The sg_get_fs_stats takes a pointer to an int, entries, which is filled with the number of mounted file systems the machine has. The return value is a pointer to the first member of an array of sg_fs_stats structures; the number of entries in the array is returned in entries. The function returns statistics about mounted filesystems, including free space and inode usage. RETURN VALUES
sg_get_fs_stats returns a pointer to a structure of type sg_fs_stats. typedef struct { char *device_name; char *fs_type; char *mnt_point; long long size; long long used; long long avail; long long total_inodes; long long used_inodes; long long free_inodes; long long avail_inodes; long long io_size; long long block_size; long long total_blocks; long long free_blocks; long long used_blocks; long long avail_blocks; } sg_fs_stats; device_name The name known to the operating system. (eg. on linux it might be hda) fs_type The type of the filesystem. mnt_point The mount point of the file system. size The size, in bytes, of the file system. used The amount of space, in bytes, used on the filesystem. avail The amount of space, in bytes, available on the filesystem. total_inodes The total number of inodes in the filesystem. used_inodes The number of used inodes in the filesystem. free_inodes The number of free inodes in the filesystem. avail_inodes The number of free inodes available to non-privileged processes. io_size A suggested optimal block size for IO operations -- if you're reading or writing lots of data, do it in chunks of this size. block_size How big blocks actually are on the underlying filesystem (typically for purposes of stats reporting). total_blocks The total number of blocks in the filesystem. free_blocks The number of free blocks in the filesystem. used_blocks The number of used blocks in the filesystem. avail_blocks The number of free blocks available to non-privileged processes. SEE ALSO
statgrab(3) WEBSITE
http://www.i-scream.org/libstatgrab/ i-scream $Date: 2005/07/13 13:01:23 $ sg_get_fs_stats(3)
Man Page