[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2cn6o6b4wkjdx6bxz3r7nrfgxe5tx52q7qyd2wdl432tjqaclk@njcvjewd4pta>
Date: Thu, 15 May 2025 13:28:00 +0200
From: Jan Kara <jack@...e.cz>
To: Max Kellermann <max.kellermann@...os.com>
Cc: viro@...iv.linux.org.uk, brauner@...nel.org, jack@...e.cz,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/4] include/linux/fs.h: add inode_lock_killable()
On Tue 13-05-25 17:03:24, Max Kellermann wrote:
> Prepare for making inode operations killable while they're waiting for
> the lock.
>
> Signed-off-by: Max Kellermann <max.kellermann@...os.com>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@...e.cz>
Honza
> ---
> include/linux/fs.h | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 016b0fe1536e..5e4ac873228d 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);
> --
> 2.47.2
>
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists