diff options
| author | Christian Brauner <brauner@kernel.org> | 2026-01-14 17:17:53 +0100 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-01-14 17:17:53 +0100 |
| commit | f97f020075e83d05695d3f86469d50e21eccffab (patch) | |
| tree | 7c5c8707b5d94fec65c041710a463a1af4e53335 /include/linux | |
| parent | 8f0b4cce4481fb22653697cced8d0d04027cb1e8 (diff) | |
| parent | 6c91c776a92315a02e020fd558c5319864f1f104 (diff) | |
Merge patch series "btrfs: stop duplicating VFS code for subvolume/snapshot dentry"
Filipe Manana <fdmanana@suse.com> says:
Currently btrfs has copies of two unexported functions from fs/namei.c
used in the snapshot/subvolume creation and deletion. This patchset
exports those functions and makes btrfs use them, to avoid duplication
and the burden of keeping the copies up to date.
* patches from https://patch.msgid.link/cover.1768307858.git.fdmanana@suse.com:
btrfs: use may_create_dentry() in btrfs_mksubvol()
btrfs: use may_delete_dentry() in btrfs_ioctl_snap_destroy()
fs: export may_create() as may_create_dentry()
fs: export may_delete() as may_delete_dentry()
Link: https://patch.msgid.link/cover.1768307858.git.fdmanana@suse.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/fs.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 04ceeca12a0d..2d28eff6eb6a 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2657,6 +2657,11 @@ static inline int path_permission(const struct path *path, int mask) int __check_sticky(struct mnt_idmap *idmap, struct inode *dir, struct inode *inode); +int may_delete_dentry(struct mnt_idmap *idmap, struct inode *dir, + struct dentry *victim, bool isdir); +int may_create_dentry(struct mnt_idmap *idmap, + struct inode *dir, struct dentry *child); + static inline bool execute_ok(struct inode *inode) { return (inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode); |
