diff options
| author | Maarten Lankhorst <dev@lankhorst.se> | 2026-07-13 11:32:29 +0200 |
|---|---|---|
| committer | Maarten Lankhorst <dev@lankhorst.se> | 2026-07-13 11:32:29 +0200 |
| commit | ac3ee180a8cf9e00ffd4fc8cc670a8b2d6f9b2f2 (patch) | |
| tree | 389dd45860aaa6d9386b9396bb63fc057ab6ffac /fs/bpf_fs_kfuncs.c | |
| parent | e4159045c2704dfe146f0ccb0445d9d074cd6882 (diff) | |
| parent | a13c140cc289c0b7b3770bce5b3ad42ab35074aa (diff) | |
| download | linux-next-ac3ee180a8cf9e00ffd4fc8cc670a8b2d6f9b2f2.tar.gz linux-next-ac3ee180a8cf9e00ffd4fc8cc670a8b2d6f9b2f2.zip | |
Merge v7.2-rc3 into drm-misc-fixes
Forward from rc1 to rc3 to track upstream closer again.
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
Diffstat (limited to 'fs/bpf_fs_kfuncs.c')
| -rw-r--r-- | fs/bpf_fs_kfuncs.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/fs/bpf_fs_kfuncs.c b/fs/bpf_fs_kfuncs.c index 768aca2dc0f0..f1863a891db6 100644 --- a/fs/bpf_fs_kfuncs.c +++ b/fs/bpf_fs_kfuncs.c @@ -360,18 +360,23 @@ __bpf_kfunc int bpf_cgroup_read_xattr(struct cgroup *cgroup, const char *name__s #endif /* CONFIG_CGROUPS */ /** - * bpf_real_inode - get the real inode backing a dentry - * @dentry: dentry to resolve + * bpf_real_data_inode - get the real inode hosting a file's data + * @file: file to resolve * - * If the dentry is on a union/overlay filesystem, return the underlying, real - * inode that hosts the data. Otherwise return the inode attached to the - * dentry itself. + * Resolve @file to the inode that hosts its data. For a regular file on a + * union/overlay filesystem this is the underlying (upper or lower) inode that + * stores the data, not the overlay inode. * - * Return: The real inode backing the dentry, or NULL for a negative dentry. + * Data resolution only applies to regular files. For a non-regular file (e.g. + * a device node, fifo or socket) on a union/overlay filesystem the overlay + * inode itself is returned; for any file on a non-union filesystem the inode + * attached to @file is returned. + * + * Return: The inode hosting @file's data, or NULL. */ -__bpf_kfunc struct inode *bpf_real_inode(struct dentry *dentry) +__bpf_kfunc struct inode *bpf_real_data_inode(struct file *file) { - return d_real_inode(dentry); + return d_real_inode(file_dentry(file)); } __bpf_kfunc_end_defs(); @@ -384,7 +389,7 @@ BTF_ID_FLAGS(func, bpf_get_dentry_xattr, KF_SLEEPABLE) BTF_ID_FLAGS(func, bpf_get_file_xattr, KF_SLEEPABLE) BTF_ID_FLAGS(func, bpf_set_dentry_xattr, KF_SLEEPABLE) BTF_ID_FLAGS(func, bpf_remove_dentry_xattr, KF_SLEEPABLE) -BTF_ID_FLAGS(func, bpf_real_inode, KF_SLEEPABLE | KF_RET_NULL) +BTF_ID_FLAGS(func, bpf_real_data_inode, KF_SLEEPABLE | KF_RET_NULL) BTF_KFUNCS_END(bpf_fs_kfunc_set_ids) static int bpf_fs_kfuncs_filter(const struct bpf_prog *prog, u32 kfunc_id) |
