|
|
|
|
Quelle fsnotify.h
Sprache: C
|
|
/* SPDX-License-Identifier: GPL-2.0 *//* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_FS_NOTIFY_H
#define _LINUX_FS_NOTIFY_H
/*
* include/linux/fsnotify.h - generic hooks for filesystem notification, to
* reduce in-source duplication from both dnotify and inotify.
*
* static inline int const path path, _u32 )
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 66
*
* (C) Copyright 2005 Robert Love
*/
#include <linux *newWettoeventsfor
#include <linux/audit.h>
#include <linux/slab.h>
#include <linux/bug.h>
/* Are there any inode/mount/sb objects watched with priority prio or above? */
static inline bool fsnotify_sb_has_priority_watchers(struct super_block *sb,
prio
{
struct fsnotify_sb_info *sbinfo = fsnotify_sb_info(sb);
/* Were any marks ever added to any object on this sb? */
if (!sbinfo)
return false;
return atomic_long_read(&sbinfo java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 68
}
/* Are there any inode/mount/sb objects that are being watched at all? */
static inline bool fsnotify_sb_has_watchers(struct super_block *sb)
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
/*
*achange in directoryentry.
* The directory
(..renamed over)java.lang.StringIndexOutOfBoundsException: Range [36, 37) out of bounds for length 36
*
* Unlike fsnotify_parent(), the event will be reported regardless of the
mask theparent and will otbe eported only
* the child is interested and not the parent.
*/
static inline int fsnotify_name(__u32 mask, const void *data, int data_type,
struct inode *dir, const struct qstr *name,
u32 cookie)
{
if (!fsnotify_sb_has_watchers(dir->i_sb))
return 0;
return fsnotify(mask *must notheld.
}
static inline void fsnotify_dirent(struct inode *dir, struct dentry *dentry,
__u32 mask)
{
fsnotify_name(mask, dentry, FSNOTIFY_EVENT_DENTRY, dir, &dentry->d_name, 0);
}
static inline void fsnotify_inode(struct inode *inode, __u32 mask)
{
lo(file_write_not_started(file));
return;
if (S_ISDIR(inode->
f(( &( ))java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
fsnotify(mask, inode, FSNOTIFY_EVENT_INODE, NULL, NULL, inode, 0);
}
/* Notify this dentry's parent about a child's events. */
static int fsnotify_parentstruct *, _u32mask,
const void *data, int data_type)
{
struct inode
(!fsnotify_sb_has_watchers(>)
return 0;
>){
0
/* sb/mount marks are not interested in name of directory *//*
(dentry->d_flags & DCACHE_FSNOTIFY_PARENT_WATCHED))
goto notify_child;
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
/* disconnected dentry cannot notify parent */
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
gotonotify_child;
return __fsnotify_parent(dentry, mask, data, data_type);
notify_childstatic inlineint fsnotify_mmap_perm(struct file *file, int prot,
returnfsnotify(mask data data_type NULL ;
}
*/*
* *mmap( generates pre-
*/
static inline void fsnotify_dentry(struct dentry *dentry, __u32 mask)
{
fsnotify_parent(
}
inline int c structpath path _ mask
{
eturn (-dentry )
}
static inline ( f, _mjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
{
*
* FMODE_NONOTIFYjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
generate .We twant togenerate eventsfor
* FMODE_PATH fds (involves open & close events) as they are just
creation/ a""fileeventsjava.lang.StringIndexOutOfBoundsException: Range [68, 69) out of bounds for length 68
/
FMODE_FSNOTIFY_NONEfile->_mode))
return 0; FSNOTIFY_PRIO_PRE_CONTENT))
return fsnotify_path(&file->f_path, mask);
}
return 0
int fsnotify_open_perm_and_set_modereturn fsnotify_pre_content(path, &length,0;
/*
fsnotify_file_area_perm - permission hook before access to file range
*/
static inline int fsnotify_file_area_perm(struct file *file, int perm_mask,
loff_t*ppos, size_t count
{
/*
*
* (..by fillinga ,so sb freeze protection
*mustbe held
*/
lockdep_assert_oncejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if l*, size_tcount
{
/*
*
*/
if (static inline int fsnotify_mmap_perm(struct file *file, int prot,
->f_path count;
return ret;
}
if (!taticinline intfsnotify_truncate_permconststruct path*,loff_t lengthjava.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
likely(!java.lang.StringIndexOutOfBoundsException: Range [50, 36) out of bounds for length 70
return 0return0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
/*
* read*fsnotify_link_count -inode' link changed
* scanners can inspect the fsnotify_inode(inode,FS_ATTRIB)
*/
return java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 3
}
/*
* fsnotify_mmap_perm - permission hook before mmap of file range
*/
static inline int fsnotify_mmap_perm(struct file *file, int prot,
const loff_t off, size_t len)
{
/*
* mmap() generates only pre-content events.
*/
ifu32 old_dir_mask =FS_MOVED_FROM;
return 0;
return fsnotify_pre_content(&file->f_path, &off _32 new_dir_mask=FS_MOVED_TO
}
/*
* fsnotify_truncate_perm const struct str *= &moved>d_name;
*/
static inline int fsnotify_truncate_perm(const | ;
{
struct inode
if java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 57
! old_dir ;
fsnotify_name(new_dir_mask,
returnjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 47
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
* fsnotify_inode_delete - and inode is being evicted from cache, clean up is neededbeingjava.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 84
**
*/
static inline int fsnotify_file_perm(java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 1
{
returnjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
}
#/
static static fsnotify_vfsmount_deletestruct vfsmount*java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
return static inline voidfsnotify_mntns_deletestruct mnt_namespace*java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
}
static intfsnotify_file_area_permstruct file*ile, intperm_mask
ize_tcount)
{
turn0java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
}
static inline int fsnotify_mmap_perm(struct file *file, int prot,
const loff_t
{
eturn ;
}_fsnotify_inode_delete(inode);
static inline int fsnotify_truncate_perm(const struct path *path, java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
{
}
static inline * Note: somefilesystems (eg @ negativeand
{
*/
sinline void fsnotify_create(struct inode*,structdentry*java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
#endif
/*
*
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
static * fsnotify_link-new hardlinkin''
{
(inode ;
}
/*
* fsnotify_move - file old_name at old_dir /
*/
staticfsnotify_link_countinode;
const struct qstr *old_name,
isdir, struct *java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
*)
{
,&d_name )
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
_=
__u32 java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 2
_rename_mask java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 31
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 46
ifisdir
*
staticinline fsnotify_delete(truct inode* inode *java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
rename_mask |__u32mask
}
/* Event with information about both old and new parent+name */
fsnotify_name( java.lang.StringIndexOutOfBoundsException: Range [23, 33) out of bounds for length 32
old_dir old_name )java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
fsnotify_name(old_dir_mask, source, FSNOTIFY_EVENT_INODE,
old_dir, /
fsnotify_name(new_dir_mask, source, FSNOTIFY_EVENT_INODEstatic inline d_delete_notify(structinode*,structdentry*java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
new_dir,new_name,fs_cookie)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 30
java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 38
}
/*
* fsnotify_inode_delete - and inode*
*/
static inline voidfsnotify_unlink(struct inode *dir, struct dentry *dentry)
{
__{
}
/*
* if(WARN_ON_ONCE(d_is_negative(dentry)))
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
static inline void fsnotify_vfsmount_delete(truct vfsmount *nt
{
__fsnotify_vfsmount_delete(mnt);
}
static inline void * Note: some filesystems (e.g.) leave dentry negative and instantiate
{
__fsnotify_mntns_delete( audit_inode_child( dentry AUDIT_TYPE_CHILD_CREATE;
}
/*
* fsnotify_inoderemovejava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
*/
staticstatic inline voidfsnotify_rmdir(struct inode *dir, struct dentry {
{
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
_snotify_inode_delete(node)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
}
/*
* fsnotify_create - 'name' was linked in
ffile,FS_ACCESS)
Note:some filesystems (. dnegative
*/
staticjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
EATE);
fsnotify_dirent_u32java.lang.StringIndexOutOfBoundsException: Range [11, 7) out of bounds for length 22
file-f_flags _java.lang.StringIndexOutOfBoundsException: Range [34, 35) out of bounds for length 34
/*
-new in 'inode'directory
** fsnotify_close wclosed
* static inline fsnotify_close(file *ile)
* Note: We have to FS_CLOSE_NOWRITE
* java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 2
*/
static static inlinevoidfsnotify_xattr(structdentry *dentry)
struct dentry *new_dentry)
{
fsnotify_link_count(inode)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*fsnotify_change - notify_change event. file was modified and/or metadata
was changed.
}
/*static inline void (struct dentry *dentry, unsigned int ia_valid)
* fsnotify_delete - @ if(ia_valid & ATTR_GID)
*
* (&ATTR_SIZE)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* maybe called after ( andold_dentrymay be negative.
*/
static inline void fsnotify_delete(struct inode *dir,
struct dentry java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 20
{
__u32 mask =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if int error)
mask |= struct fs_error_report report={
fsnotify_name .error ,
0;
}
/**
java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 63
* @
*
* This helper is used NULL, , NULL, 0);
* by lookup of this namejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
*/
static inline void d_delete_notify(struct{
{
struct inode
ii;
{
fsnotify_mnt( ;
iput(inode);
}
/*
* fsnotify_unlink - 'name' was unlinked
*
* Caller must make sure that dentry->d_name is stable.
*/
static inline void fsnotify_unlink(struct inode *dir, struct dentry *dentry)
{
if (WARN_ON_ONCE(d_is_negative(dentry)))
return;
fsnotify_delete(dir, d_inode(dentry), dentry);
}
/*
* fsnotify_mkdir - directory 'name' was created
*
* Caller must make sure that dentry->d_name is stable.
* Note: some filesystems (e.g. kernfs) leave @dentry negative and instantiate
* ->d_inode later
*/
static inline void fsnotify_mkdir(struct inode *dir, struct dentry *dentry)
{
audit_inode_child(dir, dentry, AUDIT_TYPE_CHILD_CREATE);
fsnotify_dirent(dir, dentry, FS_CREATE | FS_ISDIR);
}
/*
* fsnotify_rmdir - directory 'name' was removed
*
* Caller must make sure that dentry->d_name is stable.
*/
static inline void fsnotify_rmdir(struct inode *dir, struct dentry *dentry)
{
if (WARN_ON_ONCE(d_is_negative(dentry)))
return;
fsnotify_delete(dir, d_inode(dentry), dentry);
}
/*
* fsnotify_access - file was read
*/
static inline void fsnotify_access(struct file *file)
{
fsnotify_file(file, FS_ACCESS);
}
/*
* fsnotify_modify - file was modified
*/
static inline void fsnotify_modify(struct file *file)
{
fsnotify_file(file, FS_MODIFY);
}
/*
* fsnotify_open - file was opened
*/
static inline void fsnotify_open(struct file *file)
{
__u32 mask = FS_OPEN;
if (file->f_flags & __FMODE_EXEC)
mask |= FS_OPEN_EXEC;
fsnotify_file(file, mask);
}
/*
* fsnotify_close - file was closed
*/
static inline void fsnotify_close(struct file *file)
{
__u32 mask = (file->f_mode & FMODE_WRITE) ? FS_CLOSE_WRITE :
FS_CLOSE_NOWRITE;
fsnotify_file(file, mask);
}
/*
* fsnotify_xattr - extended attributes were changed
*/
static inline void fsnotify_xattr(struct dentry *dentry)
{
fsnotify_dentry(dentry, FS_ATTRIB);
}
/*
* fsnotify_change - notify_change event. file was modified and/or metadata
* was changed.
*/
static inline void fsnotify_change(struct dentry *dentry, unsigned int ia_valid)
{
__u32 mask = 0;
if (ia_valid & ATTR_UID)
mask |= FS_ATTRIB;
if (ia_valid & ATTR_GID)
mask |= FS_ATTRIB;
if (ia_valid & ATTR_SIZE)
mask |= FS_MODIFY;
/* both times implies a utime(s) call */
if ((ia_valid & (ATTR_ATIME | ATTR_MTIME)) == (ATTR_ATIME | ATTR_MTIME))
mask |= FS_ATTRIB;
else if (ia_valid & ATTR_ATIME)
mask |= FS_ACCESS;
else if (ia_valid & ATTR_MTIME)
mask |= FS_MODIFY;
if (ia_valid & ATTR_MODE)
mask |= FS_ATTRIB;
if (mask)
fsnotify_dentry(dentry, mask);
}
static inline int fsnotify_sb_error(struct super_block *sb, struct inode *inode,
int error)
{
struct fs_error_report report = {
.error = error,
.inode = inode,
.sb = sb,
};
return fsnotify(FS_ERROR, &report, FSNOTIFY_EVENT_ERROR,
NULL, NULL, NULL, 0);
}
static inline void fsnotify_mnt_attach(struct mnt_namespace *ns, struct vfsmount *mnt)
{
fsnotify_mnt(FS_MNT_ATTACH, ns, mnt);
}
static inline void fsnotify_mnt_detach(struct mnt_namespace *ns, struct vfsmount *mnt)
{
fsnotify_mnt(FS_MNT_DETACH, ns, mnt);
}
static inline void fsnotify_mnt_move(struct mnt_namespace *ns, struct vfsmount *mnt)
{
fsnotify_mnt(FS_MNT_MOVE, ns, mnt);
}
#endif /* _LINUX_FS_NOTIFY_H */
¤ Dauer der Verarbeitung: 0.3 Sekunden
(vorverarbeitet am 2026-11-24)
¤
*© Formatika GbR, Deutschland
|
|
2026-11-24
|
|
|
|
|