diff options
| author | Filipe Manana <fdmanana@suse.com> | 2026-01-13 12:39:50 +0000 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-01-14 17:17:47 +0100 |
| commit | 173e937552432db9406f04eb7905541b774ac7cd (patch) | |
| tree | 955d11473e0d2ff307fe7802160e7baf467ef4bd /include | |
| parent | 8f0b4cce4481fb22653697cced8d0d04027cb1e8 (diff) | |
fs: export may_delete() as may_delete_dentry()
For many years btrfs as been using a copy of may_delete() in
fs/btrfs/ioctl.c:btrfs_may_delete(). Everytime may_delete() is updated we
need to update the btrfs copy, and this is a maintenance burden. Currently
there are minor differences between both because the btrfs side lacks
updates done in may_delete().
Export may_delete() so that btrfs can use it and with the less generic
name may_delete_dentry(). While at it change the calls in vfs_rmdir() to
pass a boolean literal instead of 1 and 0 as the last argument since the
argument has a bool type.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Link: https://patch.msgid.link/e09128fd53f01b19d0a58f0e7d24739f79f47f6d.1768307858.git.fdmanana@suse.com
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/fs.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 04ceeca12a0d..06632783a76c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2657,6 +2657,9 @@ 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); + static inline bool execute_ok(struct inode *inode) { return (inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode); |
