fs/overlayfs/overlayfs.h
Source file repositories/reference/linux-study-clean/fs/overlayfs/overlayfs.h
File Facts
- System
- Linux kernel
- Corpus path
fs/overlayfs/overlayfs.h- Extension
.h- Size
- 31761 bytes
- Lines
- 955
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- Inferred role
- Core OS: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/uuid.hlinux/fs.hlinux/fsverity.hlinux/namei.hlinux/posix_acl.hlinux/posix_acl_xattr.hovl_entry.h
Detected Declarations
struct ovl_fbstruct ovl_fhstruct ovl_metacopystruct ovl_inode_paramsstruct ovl_cattrstruct ovl_fileenum ovl_path_typeenum ovl_xattrenum ovl_inode_flagenum ovl_entry_flagfunction ovl_metadata_digest_sizefunction ovl_do_notify_changefunction ovl_do_rmdirfunction ovl_do_unlinkfunction ovl_do_linkfunction ovl_do_createfunction ovl_do_mknodfunction ovl_do_symlinkfunction ovl_do_getxattrfunction ovl_getxattr_upperfunction ovl_path_getxattrfunction ovl_do_setxattrfunction ovl_setxattrfunction ovl_do_removexattrfunction ovl_removexattrfunction ovl_do_set_aclfunction ovl_do_remove_aclfunction ovl_do_rename_rdfunction ovl_do_renamefunction ovl_do_whiteoutfunction ovl_open_flags_need_copy_upfunction ovl_dentry_casefoldedfunction ovl_upper_is_whiteoutfunction ovl_check_origin_xattrfunction ovl_set_flagfunction ovl_clear_flagfunction ovl_test_flagfunction ovl_is_impuredirfunction ovl_get_opaquedir_valfunction ovl_redirect_followfunction ovl_redirect_dirfunction ovl_origin_uuidfunction ovl_has_fsidfunction ovl_xino_warnfunction ovl_should_syncfunction ovl_should_sync_metadatafunction ovl_is_volatilefunction ovl_allow_offline_changes
Annotated Snippet
extern const struct file_operations ovl_dir_operations;
struct file *ovl_dir_real_file(const struct file *file, bool want_upper);
int ovl_check_empty_dir(struct dentry *dentry, struct list_head *list);
void ovl_cleanup_whiteouts(struct ovl_fs *ofs, struct dentry *upper,
struct list_head *list);
void ovl_cache_free(struct list_head *list);
void ovl_dir_cache_free(struct inode *inode);
int ovl_check_d_type_supported(const struct path *realpath);
int ovl_workdir_cleanup(struct ovl_fs *ofs, struct dentry *parent,
struct vfsmount *mnt, struct dentry *dentry, int level);
int ovl_indexdir_cleanup(struct ovl_fs *ofs);
/*
* Can we iterate real dir directly?
*
* Non-merge dir may contain whiteouts from a time it was a merge upper, before
* lower dir was removed under it and possibly before it was rotated from upper
* to lower layer.
*/
static inline bool ovl_dir_is_real(struct inode *dir)
{
return !ovl_test_flag(OVL_WHITEOUTS, dir);
}
/* inode.c */
int ovl_set_nlink_upper(struct dentry *dentry);
int ovl_set_nlink_lower(struct dentry *dentry);
unsigned int ovl_get_nlink(struct ovl_fs *ofs, struct dentry *lowerdentry,
struct dentry *upperdentry,
unsigned int fallback);
int ovl_permission(struct mnt_idmap *idmap, struct inode *inode,
int mask);
#ifdef CONFIG_FS_POSIX_ACL
struct posix_acl *do_ovl_get_acl(struct mnt_idmap *idmap,
struct inode *inode, int type,
bool rcu, bool noperm);
static inline struct posix_acl *ovl_get_inode_acl(struct inode *inode, int type,
bool rcu)
{
return do_ovl_get_acl(&nop_mnt_idmap, inode, type, rcu, true);
}
static inline struct posix_acl *ovl_get_acl(struct mnt_idmap *idmap,
struct dentry *dentry, int type)
{
return do_ovl_get_acl(idmap, d_inode(dentry), type, false, false);
}
int ovl_set_acl(struct mnt_idmap *idmap, struct dentry *dentry,
struct posix_acl *acl, int type);
struct posix_acl *ovl_get_acl_path(const struct path *path,
const char *acl_name, bool noperm);
#else
#define ovl_get_inode_acl NULL
#define ovl_get_acl NULL
#define ovl_set_acl NULL
static inline struct posix_acl *ovl_get_acl_path(const struct path *path,
const char *acl_name,
bool noperm)
{
return NULL;
}
#endif
int ovl_update_time(struct inode *inode, enum fs_update_time type,
unsigned int flags);
bool ovl_is_private_xattr(struct super_block *sb, const char *name);
struct ovl_inode_params {
struct inode *newinode;
struct dentry *upperdentry;
struct ovl_entry *oe;
bool index;
char *redirect;
char *lowerdata_redirect;
};
void ovl_inode_init(struct inode *inode, struct ovl_inode_params *oip,
unsigned long ino, int fsid);
struct inode *ovl_new_inode(struct super_block *sb, umode_t mode, dev_t rdev);
struct inode *ovl_lookup_inode(struct super_block *sb, struct dentry *real,
bool is_upper);
bool ovl_lookup_trap_inode(struct super_block *sb, struct dentry *dir);
struct inode *ovl_get_trap_inode(struct super_block *sb, struct dentry *dir);
struct inode *ovl_get_inode(struct super_block *sb,
struct ovl_inode_params *oip);
void ovl_copyattr(struct inode *to);
/* vfs fileattr flags read from overlay.protattr xattr to ovl inode */
#define OVL_PROT_I_FLAGS_MASK (S_APPEND | S_IMMUTABLE)
/* vfs fileattr flags copied from real to ovl inode */
#define OVL_FATTR_I_FLAGS_MASK (OVL_PROT_I_FLAGS_MASK | S_SYNC | S_NOATIME)
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/uuid.h`, `linux/fs.h`, `linux/fsverity.h`, `linux/namei.h`, `linux/posix_acl.h`, `linux/posix_acl_xattr.h`, `ovl_entry.h`.
- Detected declarations: `struct ovl_fb`, `struct ovl_fh`, `struct ovl_metacopy`, `struct ovl_inode_params`, `struct ovl_cattr`, `struct ovl_file`, `enum ovl_path_type`, `enum ovl_xattr`, `enum ovl_inode_flag`, `enum ovl_entry_flag`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.