• Home
  • Raw
  • Download

Lines Matching +full:int +full:- +full:map +full:- +full:mask

1 .. SPDX-License-Identifier: GPL-2.0
9 - Copyright (C) 1999 Richard Gooch
10 - Copyright (C) 2005 Pekka Enberg
27 ------------------------------
32 cache or dcache). This provides a very fast look-up mechanism to
44 ----------------
64 ---------------
67 structure (this is the kernel-side implementation of file descriptors).
88 .. code-block:: c
92 extern int register_filesystem(struct file_system_type *);
93 extern int unregister_filesystem(struct file_system_type *);
99 ->mount() will be attached to the mountpoint, so that when pathname
108 -----------------------
113 .. code-block:: c
117 int fs_flags;
118 int (*init_fs_context)(struct fs_context *);
120 struct dentry *(*mount) (struct file_system_type *, int,
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
182 ``int flags``
202 ->mount() may choose to return a subtree of existing filesystem - it
234 ``int silent``
245 -----------------------
250 .. code-block:: c
257 void (*dirty_inode) (struct inode *, int flags);
258 int (*write_inode) (struct inode *, struct writeback_control *wbc);
259 int (*drop_inode) (struct inode *);
262 int (*sync_fs)(struct super_block *sb, int wait);
263 int (*freeze_super) (struct super_block *sb,
265 int (*freeze_fs) (struct super_block *);
266 int (*thaw_super) (struct super_block *sb,
268 int (*unfreeze_fs) (struct super_block *);
269 int (*statfs) (struct dentry *, struct kstatfs *);
270 int (*remount_fs) (struct super_block *, int *, char *);
273 int (*show_options)(struct seq_file *, struct dentry *);
274 int (*show_devname)(struct seq_file *, struct dentry *);
275 int (*show_path)(struct seq_file *, struct dentry *);
276 int (*show_stats)(struct seq_file *, struct dentry *);
278 ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t);
279 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t);
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.
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.
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
493 int (*create) (struct mnt_idmap *, struct inode *,struct dentry *, umode_t, bool);
494 struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int);
495 int (*link) (struct dentry *,struct inode *,struct dentry *);
496 int (*unlink) (struct inode *,struct dentry *);
497 int (*symlink) (struct mnt_idmap *, struct inode *,struct dentry *,const char *);
498 int (*mkdir) (struct mnt_idmap *, struct inode *,struct dentry *,umode_t);
499 int (*rmdir) (struct inode *,struct dentry *);
500 int (*mknod) (struct mnt_idmap *, struct inode *,struct dentry *,umode_t,dev_t);
501 int (*rename) (struct mnt_idmap *, struct inode *, struct dentry *,
502 struct inode *, struct dentry *, unsigned int);
503 int (*readlink) (struct dentry *, char __user *,int);
506 int (*permission) (struct mnt_idmap *, struct inode *, int);
507 struct posix_acl * (*get_inode_acl)(struct inode *, int, bool);
508 int (*setattr) (struct mnt_idmap *, struct dentry *, struct iattr *);
509 int (*getattr) (struct mnt_idmap *, const struct path *, struct kstat *, u32, unsigned int);
511 void (*update_time)(struct inode *, struct timespec *, int);
512 int (*atomic_open)(struct inode *, struct dentry *, struct file *,
514 int (*tmpfile) (struct mnt_idmap *, struct inode *, struct file *, umode_t);
515 struct posix_acl * (*get_acl)(struct mnt_idmap *, struct dentry *, int);
516 int (*set_acl)(struct mnt_idmap *, struct dentry *, struct posix_acl *, int);
517 int (*fileattr_set)(struct mnt_idmap *idmap,
519 int (*fileattr_get)(struct dentry *dentry, struct fileattr *fa);
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().
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
803 int (*writepage)(struct page *page, struct writeback_control *wbc);
804 int (*read_folio)(struct file *, struct folio *);
805 int (*writepages)(struct address_space *, struct writeback_control *);
808 int (*write_begin)(struct file *, struct address_space *mapping,
811 int (*write_end)(struct file *, struct address_space *mapping,
819 int (*migrate_folio)(struct mapping *, struct folio *dst,
821 int (*launder_folio) (struct folio *);
826 int (*error_remove_folio)(struct mapping *mapping, struct folio *);
827 int (*swap_activate)(struct swap_info_struct *sis, struct file *f, sector_t *span)
828 int (*swap_deactivate)(struct file *);
829 int (*swap_rw)(struct kiocb *iocb, struct iov_iter *iter);
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()
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
953 called by the VFS to map a logical block offset within object to
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
1076 loff_t (*llseek) (struct file *, loff_t, int);
1081 int (*iopoll)(struct kiocb *kiocb, bool spin);
1082 int (*iterate_shared) (struct file *, struct dir_context *);
1084 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
1085 long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
1086 int (*mmap) (struct file *, struct vm_area_struct *);
1087 int (*open) (struct inode *, struct file *);
1088 int (*flush) (struct file *, fl_owner_t id);
1089 int (*release) (struct inode *, struct file *);
1090 int (*fsync) (struct file *, loff_t, loff_t, int datasync);
1091 int (*fasync) (int, struct file *, int);
1092 int (*lock) (struct file *, int, struct file_lock *);
1094 int (*check_flags)(int);
1095 int (*flock) (struct file *, int, struct file_lock *);
1096 ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
1097 ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
1098 int (*setlease)(struct file *, long, struct file_lock **, void **);
1099 long (*fallocate)(struct file *file, int mode, loff_t offset,
1105 ssize_t (*copy_file_range)(struct file *, loff_t, struct file *, loff_t, size_t, unsigned int);
1108 loff_t len, unsigned int remap_flags);
1109 int (*fadvise)(struct file *, loff_t, loff_t, int);
1174 (non-blocking) mode is enabled for a file
1242 ------------------------
1251 .. code-block:: c
1254 int (*d_revalidate)(struct dentry *, unsigned int);
1255 int (*d_weak_revalidate)(struct dentry *, unsigned int);
1256 int (*d_hash)(const struct dentry *, struct qstr *);
1257 int (*d_compare)(const struct dentry *,
1258 unsigned int, const char *, const struct qstr *);
1259 int (*d_delete)(const struct dentry *);
1260 int (*d_init)(struct dentry *);
1263 char *(*d_dname)(struct dentry *, char *, int);
1265 int (*d_manage)(const struct path *, bool);
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.
1370 .. code-block:: c
1372 static char *pipefs_dname(struct dentry *dent, char *buffer, int buflen)
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.
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>