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@xxxxxxxxx> Looks good. Feel free to add: Reviewed-by: Jan Kara <jack@xxxxxxx> 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@xxxxxxxx> SUSE Labs, CR