• Home
  • Raw
  • Download

Lines Matching +full:entry +full:- +full:method

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
44 ----------------
54 To look up an inode requires that the VFS calls the lookup() method of
55 the parent directory inode. This method is installed by the specific
64 ---------------
67 structure (this is the kernel-side implementation of file descriptors).
70 taken from the inode data. The open() file method is then called so the
77 file structure, and then calling the required file structure method to
88 .. code-block:: c
97 namespace, the VFS will call the appropriate mount() method for the
99 ->mount() will be attached to the mountpoint, so that when pathname
108 -----------------------
113 .. code-block:: c
146 Initializes 'struct fs_context' ->ops and ->fs_private fields with
147 filesystem-specific data.
155 the method to call when a new instance of this filesystem should
159 the method to call when an instance of this filesystem should be
174 i_lock_key, i_mutex_key, invalidate_lock_key, i_mutex_dir_key: lockdep-specific
176 The mount() method has the following arguments:
192 The mount() method must return the root dentry of the tree requested by
199 suitable filesystem image the method creates and initializes struct
202 ->mount() may choose to return a subtree of existing filesystem - it
208 method fills in is the "s_op" field. This is a pointer to a "struct
245 -----------------------
250 .. code-block:: c
294 this method is called by alloc_inode() to allocate memory for
301 this method is called by destroy_inode() to release resources
303 ->alloc_inode was defined and simply undoes anything done by
304 ->alloc_inode.
307 this method is called from RCU callback. If you use call_rcu()
308 in ->destroy_inode to free 'struct inode' memory, then it's
309 better to release memory in this method.
312 this method is called by the VFS when an inode is marked dirty.
317 and struct inode has times updated since the last ->dirty_inode
321 this method is called when the VFS needs to write an inode to
327 inode->i_lock spinlock held.
329 This method should be either NULL (normal UNIX filesystem
331 not want to cache inodes - causing "delete_inode" to always be
340 *not* evict the pagecache or inode-associated metadata buffers;
341 the method has to use truncate_inode_pages_final() to get rid
343 the inode while (or after) ->evict_inode() is called. Optional.
351 superblock. The second parameter indicates whether the method
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
363 consistent state. This method is currently used by the Logical
368 again after ->freeze_super. Optional.
372 again after ->freeze_fs. Optional.
400 filesystem-specific mount statistics.
420 Optional, but any filesystem implementing this method needs to
421 also implement ->nr_cached_objects for it to be called
427 hence this method does not need to handle that situation itself.
441 ---------------------
444 superblock field points to a NULL-terminated array of xattr handlers.
464 attribute. This method is called by the getxattr(2) system
470 particular extended attribute. This method is called by the
475 the various ``*xattr(2)`` system calls return -EOPNOTSUPP.
485 -----------------------
490 .. code-block:: c
536 method must call d_add() to insert the found inode into the
545 a struct "dentry_operations". This method is called with the
551 d_instantiate() just as you would in the create() method
560 d_instantiate() just as you would in the create() method
565 call d_instantiate() just as you would in the create() method
576 create() method
582 The filesystem must return -EINVAL for any unsupported or
585 the rename exists the rename should fail with -EEXIST instead of
596 This method returns the symlink body to traverse (and possibly
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.
633 called by the VFS to set attributes for a file. This method is
637 called by the VFS to get attributes of a file. This method is
642 file. This method is called by the listxattr(2) system call.
651 method the filesystem can look up, possibly create and open the
656 dentry). This method is only called if the last component is
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
660 method must only succeed if the file didn't exist and hence
675 fall back to f_op->ioctl().
680 i_rwsem exclusive. If unset, then fall back to f_op->ioctl().
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 --------------------------------
789 file->fsync operation, they should call file_check_and_advance_wb_err to
795 -------------------------------
800 .. code-block:: c
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.
868 Filesystems may implement ->read_folio() synchronously.
869 In normal operation, folios are read through the ->readahead()
870 method. Only if this fails, or if the caller needs to wait for
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.
910 rac->ra->async_size gives the number of async pages. The
924 basic-blocks on storage, then those blocks should be pre-read
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,
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
1002 called by the generic read/write routines to perform direct_IO -
1015 Called before freeing a folio - it writes back the dirty folio.
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
1154 open method for the newly allocated file structure. You might
1155 think that the open method really belongs in "struct
1158 The open() method is a good place to initialize the
1174 (non-blocking) mode is enabled for a file
1191 method is used by the splice(2) system call
1195 method is used by the splice(2) system call
1232 the new open() method for the file. This is how opening a device file
1234 method.
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.
1350 calls iput(). If you define this method, you must call iput()
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
1421 overlay/union type filesystems implement this method to return one
1428 For non-regular files, the 'dentry' argument is returned.
1435 Directory Entry Cache API
1436 --------------------------
1448 parent's hash, the "d_delete" method is called to check whether
1461 d_iput() method is called). If there are other references, then
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>