Lines Matching +full:i +full:- +full:cache +full:- +full:block +full:- +full:size
1 .. SPDX-License-Identifier: GPL-2.0
9 - Copyright (C) 1999 Richard Gooch
10 - Copyright (C) 2005 Pekka Enberg
26 Directory Entry Cache (dcache)
27 ------------------------------
31 to search through the directory entry cache (also known as the dentry
32 cache or dcache). This provides a very fast look-up mechanism to
36 The dentry cache is meant to be a view into your entire filespace. As
38 bits of the cache are missing. In order to resolve your pathname into a
44 ----------------
48 beasts. They live either on the disc (for block device filesystems) or
64 ---------------
67 structure (this is the kernel-side implementation of file descriptors).
88 .. code-block:: c
99 ->mount() will be attached to the mountpoint, so that when pathname
108 -----------------------
113 .. code-block:: c
143 various flags (i.e. FS_REQUIRES_DEV, FS_NO_DCACHE, etc.)
146 Initializes 'struct fs_context' ->ops and ->fs_private fields with
147 filesystem-specific data.
174 i_lock_key, i_mutex_key, invalidate_lock_key, i_mutex_dir_key: lockdep-specific
197 on filesystem type. E.g. for block filesystems, dev_name is interpreted
198 as block device name, that device is opened and if it contains a
202 ->mount() may choose to return a subtree of existing filesystem - it
216 mount a filesystem residing on a block device
245 -----------------------
250 .. code-block:: c
289 noted. This means that most methods can block safely. All methods are
290 only called from a process context (i.e. not from an interrupt handler
303 ->alloc_inode was defined and simply undoes anything done by
304 ->alloc_inode.
308 in ->destroy_inode to free 'struct inode' memory, then it's
317 and struct inode has times updated since the last ->dirty_inode
327 inode->i_lock spinlock held.
331 not want to cache inodes - causing "delete_inode" to always be
340 *not* evict the pagecache or inode-associated metadata buffers;
343 the inode while (or after) ->evict_inode() is called. Optional.
347 (i.e. unmount). This is called with the superblock lock held
355 Called instead of ->freeze_fs callback if provided.
356 Main difference is that ->freeze_super is called without taking
357 down_write(&sb->s_umount). If filesystem implements it and wants
358 ->freeze_fs to be called too, then it has to call ->freeze_fs
368 again after ->freeze_super. Optional.
372 again after ->freeze_fs. Optional.
400 filesystem-specific mount statistics.
413 called by the sb cache shrinking function for the filesystem to
418 called by the sb cache shrinking function for the filesystem to
421 also implement ->nr_cached_objects for it to be called
441 ---------------------
444 superblock field points to a NULL-terminated array of xattr handlers.
475 the various ``*xattr(2)`` system calls return -EOPNOTSUPP.
485 -----------------------
490 .. code-block:: c
529 not have an inode (i.e. it should be a negative dentry). Here
573 block) inode or a named pipe (FIFO) or socket. Only required if
582 The filesystem must return -EINVAL for any unsupported or
585 the rename exists the rename should fail with -EEXIST instead of
605 have it return ERR_PTR(-ECHILD).
607 If the filesystem stores the symlink target in ->i_link, the
608 VFS may use it directly without calling ->get_link(); however,
609 ->get_link() must still be provided. ->i_link must not be
610 freed until after an RCU grace period. Writing to ->i_link
611 post-iget() time requires a 'release' memory barrier.
615 cases when ->get_link uses nd_jump_link() or object is not in
617 ->get_link for symlinks and readlink(2) will automatically use
621 called by the VFS to check for access rights on a POSIX-like
624 May be called in rcu-walk mode (mask & MAY_NOT_BLOCK). If in
625 rcu-walk mode, the filesystem must check the permission without
628 If a situation is encountered that rcu-walk cannot handle,
630 -ECHILD and it will be called again in ref-walk mode.
658 handled by f_op->open(). If the file was created, FMODE_CREATED
659 flag should be set in file->f_mode. In case of O_EXCL the
675 fall back to f_op->ioctl().
680 i_rwsem exclusive. If unset, then fall back to f_op->ioctl().
690 cache. It can be used to keep track of the pages in a file (or anything
695 address-space can provide. These include communicating memory pressure,
701 in order to reuse them. To do this it can call the ->writepage method
702 on dirty pages, and ->release_folio on clean folios with the private
710 Pages are normally kept in a radix tree index by ->index. This tree
714 The Dirty tag is primarily used by mpage_writepages - the default
715 ->writepages method. It uses the tag to find dirty pages to call
716 ->writepage on. If mpage_writepages is not used (i.e. the address
717 provides its own ->writepages) , the PAGECACHE_TAG_DIRTY tag is almost
719 __sync_single_inode) to check if ->writepages has been successful in
734 by memory-mapping the page. Data is written into the address space by
735 the application, and then written-back to storage typically in whole
761 --------------------------------
763 Most applications that do buffered I/O will periodically call a file
789 file->fsync operation, they should call file_check_and_advance_wb_err to
795 -------------------------------
798 cache in your filesystem. The following members are defined:
800 .. code-block:: c
834 may happen for data integrity reasons (i.e. 'sync'), or to free
836 wbc->sync_mode. The PG_Dirty flag has been cleared and
842 If wbc->sync_mode is WB_SYNC_NONE, ->writepage doesn't have to
847 keep calling ->writepage on that page.
852 Called by the page cache to read a folio from the backing store.
854 filesystems, and is generally not used by block based filesystems.
865 the page cache holds a reference count and that will not be
868 Filesystems may implement ->read_folio() synchronously.
869 In normal operation, folios are read through the ->readahead()
871 the read to complete will the page cache call ->read_folio().
873 in the ->read_folio() operation.
879 and call ->read_folio again.
881 Callers may invoke the ->read_folio() method directly, but using
887 address_space object. If wbc->sync_mode is WB_SYNC_ALL, then
891 ->writepages is given, then mpage_writepages is used instead.
893 DIRTY and will pass them to ->writepage.
905 object. The pages are consecutive in the page cache and are
907 after starting I/O on each page. Usually the page will be
908 unlocked by the I/O completion handler. The set of pages are
910 rac->ra->async_size gives the number of async pages. The
913 stop attempting I/O, it can simply return. The caller will
915 and decrement the page refcount. Set PageUptodate if the I/O
924 basic-blocks on storage, then those blocks should be pre-read
953 called by the VFS to map a logical block offset within object to
954 physical block number. This method is used by the FIBMAP ioctl
955 and for working with swap-files. To be able to swap to a file,
956 the file must have a stable mapping to a block device. The swap
971 discarded. This may be done by calling the ->release_folio
976 filesystem that the folio is about to be freed. ->release_folio
981 active users. If ->release_folio succeeds, the folio will be
988 believe the cache may be out of date with storage) by calling
996 page cache in order to allow the cleanup of any private data.
999 it should not block.
1002 called by the generic read/write routines to perform direct_IO -
1003 that is IO requests which bypass the page cache and transfer
1015 Called before freeing a folio - it writes back the dirty folio.
1021 the underlying blocksize is smaller than the size of the folio.
1022 If the required block is up to date then the read can complete
1023 without needing I/O to bring the whole page up to date.
1049 through ->swap_rw(), it should set SWP_FS_OPS, otherwise IO will
1050 be submitted directly to the block device ``sis->bdev``.
1067 ----------------------
1072 .. code-block:: c
1156 inode_operations", and you may be right. I think it's done the
1174 (non-blocking) mode is enabled for a file
1228 (character or block special) most filesystems will call special
1237 Directory Entry Cache (dcache)
1242 ------------------------
1251 .. code-block:: c
1271 called whenever a name look-up finds a dentry in the dcache.
1280 d_revalidate may be called in rcu-walk mode (flags &
1281 LOOKUP_RCU). If in rcu-walk mode, the filesystem must
1287 If a situation is encountered that rcu-walk cannot handle,
1289 -ECHILD and it will be called again in ref-walk mode.
1293 is called when a path-walk ends at dentry that was not acquired
1295 "." and "..", as well as procfs-style symlinks and mountpoint
1306 d_weak_revalidate is only called after leaving rcu-walk mode.
1329 module. ->d_sb may be used.
1332 under "rcu-walk", ie. without any locks or references on things.
1336 dcache is deciding whether or not to cache it. Return 1 to
1337 delete immediately, or 0 to cache the dentry. Default is NULL
1338 which means to always cache a reachable dentry. d_delete must
1370 .. code-block:: c
1375 dentry->d_inode->i_ino);
1386 an error code should be returned. If -EISDIR is returned, then
1393 returned with 2 refs on it to prevent automatic expiration - the
1405 returned to let the calling process continue. -EISDIR can be
1412 pathwalk in RCU-walk mode. Sleeping is not permitted in this
1414 returning -ECHILD. -EISDIR may also be returned to tell
1428 For non-regular files, the 'dentry' argument is returned.
1435 Directory Entry Cache API
1436 --------------------------
1489 ---------------
1504 ---------------
1509 - options MUST be shown which are not default or their values differ
1512 - options MAY be shown which are enabled by default or have their
1528 (Note some of these resources are not up-to-date with the latest kernel
1534 The Linux Virtual File-system Layer by Neil Brown. 1999
1535 <http://www.cse.unsw.edu.au/~neilb/oss/linux-commentary/vfs.html>