fs/notify/inotify/inotify.h
Source file repositories/reference/linux-study-clean/fs/notify/inotify/inotify.h
File Facts
- System
- Linux kernel
- Corpus path
fs/notify/inotify/inotify.h- Extension
.h- Size
- 1860 bytes
- Lines
- 70
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- Inferred role
- Core OS: implementation source
- Status
- source 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 or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/fsnotify_backend.hlinux/inotify.hlinux/slab.h
Detected Declarations
struct inotify_event_infostruct inotify_inode_markfunction inotify_mark_user_maskfunction dec_inotify_instancesfunction dec_inotify_watches
Annotated Snippet
struct inotify_event_info {
struct fsnotify_event fse;
u32 mask;
int wd;
u32 sync_cookie;
int name_len;
char name[];
};
struct inotify_inode_mark {
struct fsnotify_mark fsn_mark;
int wd;
};
static inline struct inotify_event_info *INOTIFY_E(struct fsnotify_event *fse)
{
return container_of(fse, struct inotify_event_info, fse);
}
/*
* INOTIFY_USER_FLAGS represents all of the mask bits that we expose to
* userspace. There is at least one bit (FS_EVENT_ON_CHILD) which is
* used only internally to the kernel.
*/
#define INOTIFY_USER_MASK (IN_ALL_EVENTS)
static inline __u32 inotify_mark_user_mask(struct fsnotify_mark *fsn_mark)
{
__u32 mask = fsn_mark->mask & INOTIFY_USER_MASK;
if (fsn_mark->flags & FSNOTIFY_MARK_FLAG_EXCL_UNLINK)
mask |= IN_EXCL_UNLINK;
if (fsn_mark->flags & FSNOTIFY_MARK_FLAG_IN_ONESHOT)
mask |= IN_ONESHOT;
return mask;
}
extern void inotify_ignored_and_remove_idr(struct fsnotify_mark *fsn_mark,
struct fsnotify_group *group);
extern int inotify_handle_inode_event(struct fsnotify_mark *inode_mark,
u32 mask, struct inode *inode,
struct inode *dir,
const struct qstr *name, u32 cookie);
extern const struct fsnotify_ops inotify_fsnotify_ops;
extern struct kmem_cache *inotify_inode_mark_cachep;
#ifdef CONFIG_INOTIFY_USER
static inline void dec_inotify_instances(struct ucounts *ucounts)
{
dec_ucount(ucounts, UCOUNT_INOTIFY_INSTANCES);
}
static inline struct ucounts *inc_inotify_watches(struct ucounts *ucounts)
{
return inc_ucount(ucounts->ns, ucounts->uid, UCOUNT_INOTIFY_WATCHES);
}
static inline void dec_inotify_watches(struct ucounts *ucounts)
{
dec_ucount(ucounts, UCOUNT_INOTIFY_WATCHES);
}
#endif
Annotation
- Immediate include surface: `linux/fsnotify_backend.h`, `linux/inotify.h`, `linux/slab.h`.
- Detected declarations: `struct inotify_event_info`, `struct inotify_inode_mark`, `function inotify_mark_user_mask`, `function dec_inotify_instances`, `function dec_inotify_watches`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source implementation candidate.
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.