Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Abstract operations on a vnode.
- *
- * These are used in the form VOP_FOO(vnode, args), which are macros
- * that expands to vnode->vn_ops->vop_foo(vnode, args). The operations
- * "foo" are:
- *
- * vop_eachopen - Called on *each* open() of a file. Can be used to
- * reject illegal or undesired open modes. Note that
- * various operations can be performed without the
- * file actually being opened.
- * The vnode need not look at O_CREAT, O_EXCL, or
- * O_TRUNC, as these are handled in the VFS layer.
- *
- * VOP_EACHOPEN should not be called directly from
- * above the VFS layer - use vfs_open() to open vnodes.
- *
- * vop_reclaim - Called when vnode is no longer in use.
- *
- *****************************************
- *
- * vop_read - Read data from file to uio, at offset specified
- * in the uio, updating uio_resid to reflect the
- * amount read, and updating uio_offset to match.
- * Not allowed on directories or symlinks.
- *
- * vop_readlink - Read the contents of a symlink into a uio.
- * Not allowed on other types of object.
- *
- * vop_getdirentry - Read a single filename from a directory into a
- * uio, choosing what name based on the offset
- * field in the uio, and updating that field.
- * Unlike with I/O on regular files, the value of
- * the offset field is not interpreted outside
- * the filesystem and thus need not be a byte
- * count. However, the uio_resid field should be
- * handled in the normal fashion.
- * On non-directory objects, return ENOTDIR.
- *
- * vop_write - Write data from uio to file at offset specified
- * in the uio, updating uio_resid to reflect the
- * amount written, and updating uio_offset to match.
- * Not allowed on directories or symlinks.
- *
- * vop_ioctl - Perform ioctl operation OP on file using data
- * DATA. The interpretation of the data is specific
- * to each ioctl.
- *
- * vop_stat - Return info about a file. The pointer is a
- * pointer to struct stat; see kern/stat.h.
- *
- * vop_gettype - Return type of file. The values for file types
- * are in kern/stattypes.h.
- *
- * vop_isseekable - Check if this file is seekable. All regular files
- * and directories are seekable, but some devices are
- * not.
- *
- * vop_fsync - Force any dirty buffers associated with this file
- * to stable storage.
- *
- * vop_mmap - Map file into memory. If you implement this
- * feature, you're responsible for choosing the
- * arguments for this operation.
- *
- * vop_truncate - Forcibly set size of file to the length passed
- * in, discarding any excess blocks.
- *
- * vop_namefile - Compute pathname relative to filesystem root
- * of the file and copy to the specified
- * uio. Need not work on objects that are not
- * directories.
- *
- *****************************************
- *
- * vop_creat - Create a regular file named NAME in the passed
- * directory DIR. If boolean EXCL is true, fail if
- * the file already exists; otherwise, use the
- * existing file if there is one. Hand back the
- * vnode for the file as per vop_lookup.
- *
- * vop_symlink - Create symlink named NAME in the passed directory,
- * with contents CONTENTS.
- *
- * vop_mkdir - Make directory NAME in the passed directory PARENTDIR.
- *
- * vop_link - Create hard link, with name NAME, to file FILE
- * in the passed directory DIR.
- *
- * vop_remove - Delete non-directory object NAME from passed
- * directory. If NAME refers to a directory,
- * return EISDIR. If passed vnode is not a
- * directory, return ENOTDIR.
- *
- * vop_rmdir - Delete directory object NAME from passed
- * directory.
- *
- * vop_rename - Rename file NAME1 in directory VN1 to be
- * file NAME2 in directory VN2.
- *
- *****************************************
- *
- * vop_lookup - Parse PATHNAME relative to the passed directory
- * DIR, and hand back the vnode for the file it
- * refers to. May destroy PATHNAME. Should increment
- * refcount on vnode handed back.
- *
- * vop_lookparent - Parse PATHNAME relative to the passed directory
- * DIR, and hand back (1) the vnode for the
- * parent directory of the file it refers to, and
- * (2) the last component of the filename, copied
- * into kernel buffer BUF with max length LEN. May
- * destroy PATHNAME. Should increment refcount on
- * vnode handed back.
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement