Linux Filesystems API

This documentation is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

For more details see the file COPYING in the source distribution of Linux.


Table of Contents

1. The Linux VFS
The Filesystem types
enum positive_aop_returns — aop return codes with specific semantics
struct export_operations — for nfsd to communicate with file systems
The Directory Cache
d_invalidate — invalidate a dentry
shrink_dcache_sb — shrink dcache for a superblock
have_submounts — check for mounts over a dentry
shrink_dcache_parent — prune dcache
d_alloc — allocate a dcache entry
d_instantiate — fill in inode information for a dentry
d_alloc_root — allocate root dentry
d_alloc_anon — allocate an anonymous dentry
d_splice_alias — splice a disconnected dentry into the tree if one exists
d_lookup — search for a dentry
d_validate — verify dentry provided from insecure source
d_delete — delete a dentry
d_rehash — add an entry back to the hash
d_move — move a dentry
d_materialise_unique — introduce an inode into the tree
find_inode_number — check for dentry with name
__d_drop — drop a dentry
d_add — add dentry to hash queues
d_add_unique — add dentry to hash queues without aliasing
dget — get a reference to a dentry
d_unhashed — is dentry hashed
Inode Handling
clear_inode — clear an inode
invalidate_inodes — discard the inodes on a device
new_inode — obtain an inode
iunique — get a unique inode number
ilookup5_nowait — search for an inode in the inode cache
ilookup5 — search for an inode in the inode cache
ilookup — search for an inode in the inode cache
iget5_locked — obtain an inode from a mounted file system
iget_locked — obtain an inode from a mounted file system
__insert_inode_hash — hash an inode
remove_inode_hash — remove an inode from the hash
iput — put an inode
bmap — find a block number in a file
touch_atime — update the access time
file_update_time — update mtime and ctime time
make_bad_inode — mark an inode bad due to an I/O error
is_bad_inode — is an inode errored
Registration and Superblocks
deactivate_super — drop an active reference to superblock
generic_shutdown_super — common helper for ->kill_sb
sget — find or create a superblock
get_super — get the superblock of a device
File Locks
posix_lock_file — Apply a POSIX-style lock to a file
posix_lock_file_conf — Apply a POSIX-style lock to a file
posix_lock_file_wait — Apply a POSIX-style lock to a file
locks_mandatory_area — Check for a conflicting lock
__break_lease — revoke all outstanding leases on file
lease_get_mtime
flock_lock_file_wait — Apply a FLOCK-style lock to a file
posix_unblock_lock — stop waiting for a file lock
lock_may_read — checks that the region is free of locks
lock_may_write — checks that the region is free of locks
locks_mandatory_locked — Check for an active lock
fcntl_getlease — Enquire what lease is currently active
__setlease — sets a lease on an open file
fcntl_setlease — sets a lease on an open file
sys_flockflock system call.
get_locks_status — reports lock usage in /proc/locks
Other Functions
mpage_readpages — populate an address space with some pages, and
mpage_writepages — walk the list of dirty pages of the given
generic_permission — check for access rights on a Posix-like filesystem
vfs_permission — check for access rights to a given path
file_permission — check for additional access rights to a given file
lookup_create — lookup a dentry, creating it if it doesn't exist
freeze_bdev — - lock a filesystem and force it into a consistent state
thaw_bdev — - unlock filesystem
sync_mapping_buffers — write out and wait upon a mapping's “associated
mark_buffer_dirty — mark a buffer_head as needing writeout
__bread — reads a specified block and returns the bh
block_invalidatepage — invalidate part of all of a buffer-backed page
ll_rw_block — level access to block devices (DEPRECATED)
bio_alloc_bioset — allocate a bio for I/O
bio_put — release a reference to a bio
__bio_clone — clone a bio
bio_clone — clone a bio
bio_get_nr_vecs — return approx number of vecs
bio_add_pc_page — attempt to add page to bio
bio_add_page — attempt to add page to bio
bio_uncopy_user — finish previously mapped bio
bio_copy_user — copy user data to bio
bio_map_user — map user address into bio
bio_unmap_user — unmap a bio
bio_map_kern — map kernel address into bio
bio_endio — end I/O on a bio
seq_open — initialize sequential file
seq_read — ->read method for sequential files.
seq_lseek — ->llseek method for sequential files.
seq_release — free the structures associated with sequential file.
seq_escape — print string into buffer, escaping some characters
register_filesystem — register a new filesystem
unregister_filesystem — unregister a file system
__mark_inode_dirty — internal function
write_inode_now — write an inode to disk
sync_inode — write an inode and its pages to disk.
generic_osync_inode — flush all dirty data for a given inode to disk
bd_claim_by_disk — wrapper function for bd_claim_by_kobject
bd_release_from_disk — wrapper function for bd_release_from_kobject
open_bdev_excl — open a block device by name and set it up for use
close_bdev_excl — release a blockdevice openen by open_bdev_excl
2. The proc filesystem
sysctl interface
register_sysctl_table — register a sysctl hierarchy
unregister_sysctl_table — unregister a sysctl table hierarchy
proc_dostring — read a string sysctl
proc_dointvec — read a vector of integers
proc_dointvec_minmax — read a vector of integers with min/max values
proc_doulongvec_minmax — read a vector of long integers with min/max values
proc_doulongvec_ms_jiffies_minmax — read a vector of millisecond values with min/max values
proc_dointvec_jiffies — read a vector of integers as seconds
proc_dointvec_userhz_jiffies — read a vector of integers as 1/USER_HZ seconds
proc_dointvec_ms_jiffies — read a vector of integers as 1 milliseconds
proc filesystem interface
proc_flush_task — Remove dcache entries for task from the /proc dcache.
3. The Filesystem for Exporting Kernel Objects
sysfs_create_file — create an attribute file for an object.
sysfs_update_file — update the modified timestamp on an object attribute.
sysfs_chmod_file — update the modified mode value on an object attribute.
sysfs_remove_file — remove an object attribute.
sysfs_create_link — create symlink between two objects.
sysfs_remove_link — remove symlink in object's directory.
sysfs_create_bin_file — create binary file for object.
sysfs_remove_bin_file — remove binary file for object.
4. The debugfs filesystem
debugfs interface
debugfs_create_file — create a file in the debugfs filesystem
debugfs_create_dir — create a directory in the debugfs filesystem
debugfs_remove — removes a file or directory from the debugfs filesystem
debugfs_create_u8 — create a debugfs file that is used to read and write an unsigned 8-bit value
debugfs_create_u16 — create a debugfs file that is used to read and write an unsigned 16-bit value
debugfs_create_u32 — create a debugfs file that is used to read and write an unsigned 32-bit value
debugfs_create_bool — create a debugfs file that is used to read and write a boolean value
debugfs_create_blob — create a debugfs file that is used to read and write a binary blob
5. The Linux Journalling API
Overview
Details
Summary
Data Types
Structures
Functions
Journal Level
Transasction Level
See also