diff options
| author | Christian Brauner <brauner@kernel.org> | 2025-05-15 13:03:18 +0300 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2025-05-15 13:03:18 +0300 |
| commit | 4fae90d04a58cd9882c5158b6b1d22d0cf544fc0 (patch) | |
| tree | 87d15c942c066ccb631fbb43b79c93be231fc160 /include/linux | |
| parent | e0410e956b97e8b50b2aa7b02ba70e5f09b31ebe (diff) | |
| parent | 2e1a8fbff51bb9bdf0fe9c6602855e308efcfcdb (diff) | |
| download | linux-4fae90d04a58cd9882c5158b6b1d22d0cf544fc0.tar.xz | |
Merge patch series "include/linux/fs.h: add inode_lock_killable()"
Try and make a few filesystem operations killable on the VFS
inode->i_mutex level.
* patches from https://lore.kernel.org/20250513150327.1373061-1-max.kellermann@ionos.com:
fs/read_write: make default_llseek() killable
fs/open: make do_truncate() killable
fs/open: make chmod_common() and chown_common() killable
include/linux/fs.h: add inode_lock_killable()
Link: https://lore.kernel.org/20250513150327.1373061-1-max.kellermann@ionos.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/fs.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index ddd54a664916..82c6093b8582 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -867,6 +867,11 @@ static inline void inode_lock(struct inode *inode) down_write(&inode->i_rwsem); } +static inline __must_check int inode_lock_killable(struct inode *inode) +{ + return down_write_killable(&inode->i_rwsem); +} + static inline void inode_unlock(struct inode *inode) { up_write(&inode->i_rwsem); @@ -877,6 +882,11 @@ static inline void inode_lock_shared(struct inode *inode) down_read(&inode->i_rwsem); } +static inline __must_check int inode_lock_shared_killable(struct inode *inode) +{ + return down_read_killable(&inode->i_rwsem); +} + static inline void inode_unlock_shared(struct inode *inode) { up_read(&inode->i_rwsem); |
