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
136 the method to call when a new instance of this filesystem should
140 the method to call when an instance of this filesystem should be
151 s_lock_key, s_umount_key: lockdep-specific
153 The mount() method has the following arguments:
169 The mount() method must return the root dentry of the tree requested by
176 suitable filesystem image the method creates and initializes struct
179 ->mount() may choose to return a subtree of existing filesystem - it
185 method fills in is the "s_op" field. This is a pointer to a "struct
222 -----------------------
227 .. code-block:: c
260 this method is called by alloc_inode() to allocate memory for
267 this method is called by destroy_inode() to release resources
269 ->alloc_inode was defined and simply undoes anything done by
270 ->alloc_inode.
273 this method is called by the VFS to mark an inode dirty.
276 this method is called when the VFS needs to write an inode to
282 inode->i_lock spinlock held.
284 This method should be either NULL (normal UNIX filesystem
286 not want to cache inodes - causing "delete_inode" to always be
302 superblock. The second parameter indicates whether the method
307 consistent state. This method is currently used by the Logical
345 Optional, but any filesystem implementing this method needs to
346 also implement ->nr_cached_objects for it to be called
352 hence this method does not need to handle that situation itself.
366 ---------------------
369 superblock field points to a NULL-terminated array of xattr handlers.
389 attribute. This method is called by the getxattr(2) system
395 particular extended attribute. This method is called by the the
400 the various ``*xattr(2)`` system calls return -EOPNOTSUPP.
410 -----------------------
415 .. code-block:: c
455 method must call d_add() to insert the found inode into the
464 a struct "dentry_operations". This method is called with the
470 d_instantiate() just as you would in the create() method
479 d_instantiate() just as you would in the create() method
484 call d_instantiate() just as you would in the create() method
495 create() method
501 The filesystem must return -EINVAL for any unsupported or
504 the rename exists the rename should fail with -EEXIST instead of
515 This method returns the symlink body to traverse (and possibly
524 have it return ERR_PTR(-ECHILD).
526 If the filesystem stores the symlink target in ->i_link, the
527 VFS may use it directly without calling ->get_link(); however,
528 ->get_link() must still be provided. ->i_link must not be
529 freed until after an RCU grace period. Writing to ->i_link
530 post-iget() time requires a 'release' memory barrier.
534 cases when ->get_link uses nd_jump_link() or object is not in
536 ->get_link for symlinks and readlink(2) will automatically use
540 called by the VFS to check for access rights on a POSIX-like
543 May be called in rcu-walk mode (mask & MAY_NOT_BLOCK). If in
544 rcu-walk mode, the filesystem must check the permission without
547 If a situation is encountered that rcu-walk cannot handle,
549 -ECHILD and it will be called again in ref-walk mode.
552 called by the VFS to set attributes for a file. This method is
556 called by the VFS to get attributes of a file. This method is
561 file. This method is called by the listxattr(2) system call.
570 method the filesystem can look up, possibly create and open the
575 dentry). This method is only called if the last component is
577 handled by f_op->open(). If the file was created, FMODE_CREATED
578 flag should be set in file->f_mode. In case of O_EXCL the
579 method must only succeed if the file didn't exist and hence
597 address-space can provide. These include communicating memory pressure,
603 in order to reuse them. To do this it can call the ->writepage method
604 on dirty pages, and ->releasepage on clean pages with PagePrivate set.
612 Pages are normally kept in a radix tree index by ->index. This tree
616 The Dirty tag is primarily used by mpage_writepages - the default
617 ->writepages method. It uses the tag to find dirty pages to call
618 ->writepage on. If mpage_writepages is not used (i.e. the address
619 provides its own ->writepages) , the PAGECACHE_TAG_DIRTY tag is almost
621 __sync_single_inode) to check if ->writepages has been successful in
636 by memory-mapping the page. Data is written into the address space by
637 the application, and then written-back to storage typically in whole
663 --------------------------------
691 file->fsync operation, they should call file_check_and_advance_wb_err to
697 -------------------------------
702 .. code-block:: c
726 /* put migration-failed page back to right list */
742 wbc->sync_mode. The PG_Dirty flag has been cleared and
748 If wbc->sync_mode is WB_SYNC_NONE, ->writepage doesn't have to
753 keep calling ->writepage on that page.
760 and marked uptodate once the read completes. If ->readpage
764 ->readpage will be called again.
768 address_space object. If wbc->sync_mode is WBC_SYNC_ALL, then
772 ->writepages is given, then mpage_writepages is used instead.
774 DIRTY and will pass them to ->writepage.
788 readpages is only used for read-ahead, so read errors are
797 basic-blocks on storage, then those blocks should be pre-read
830 physical block number. This method is used by the FIBMAP ioctl
831 and for working with swap-files. To be able to swap to a file,
847 discarded. This may be done by calling the ->releasepage
852 page should be freed if possible. ->releasepage should remove
858 ->releasepage succeeds, the page will be removed from the
879 called by the generic read/write routines to perform direct_IO -
885 Called by the VM when isolating a movable non-lru page. If page
900 Called before freeing a page - it writes back the dirty page.
946 ----------------------
951 .. code-block:: c
1039 open method for the newly allocated file structure. You might
1040 think that the open method really belongs in "struct
1043 The open() method is a good place to initialize the
1059 (non-blocking) mode is enabled for a file
1076 method is used by the splice(2) system call
1080 method is used by the splice(2) system call
1117 the new open() method for the file. This is how opening a device file
1119 method.
1122 Directory Entry Cache (dcache)
1127 ------------------------
1136 .. code-block:: c
1156 called whenever a name look-up finds a dentry in the dcache.
1165 d_revalidate may be called in rcu-walk mode (flags &
1166 LOOKUP_RCU). If in rcu-walk mode, the filesystem must
1172 If a situation is encountered that rcu-walk cannot handle,
1174 -ECHILD and it will be called again in ref-walk mode.
1178 is called when a path-walk ends at dentry that was not acquired
1180 "." and "..", as well as procfs-style symlinks and mountpoint
1191 d_weak_revalidate is only called after leaving rcu-walk mode.
1214 module. ->d_sb may be used.
1217 under "rcu-walk", ie. without any locks or references on things.
1235 calls iput(). If you define this method, you must call iput()
1255 .. code-block:: c
1260 dentry->d_inode->i_ino);
1271 an error code should be returned. If -EISDIR is returned, then
1278 returned with 2 refs on it to prevent automatic expiration - the
1290 returned to let the calling process continue. -EISDIR can be
1297 pathwalk in RCU-walk mode. Sleeping is not permitted in this
1299 returning -ECHILD. -EISDIR may also be returned to tell
1306 overlay/union type filesystems implement this method to return
1313 mode is selected with a non-NULL inode argument.
1322 Directory Entry Cache API
1323 --------------------------
1335 parent's hash, the "d_delete" method is called to check whether
1348 d_iput() method is called). If there are other references, then
1376 ---------------
1391 ---------------
1396 - options MUST be shown which are not default or their values differ
1399 - options MAY be shown which are enabled by default or have their
1415 (Note some of these resources are not up-to-date with the latest kernel
1421 The Linux Virtual File-system Layer by Neil Brown. 1999
1422 <http://www.cse.unsw.edu.au/~neilb/oss/linux-commentary/vfs.html>