fs/lock: add helper locks_owner_has_blockers to check for blockers
[ Upstream commit 591502c5cb325b1c6ec59ab161927d606b918aa0 ] Add helper locks_owner_has_blockers to check if there is any blockers for a given lockowner. Reviewed-by: J. Bruce Fields <bfields@fieldses.org> Signed-off-by: Dai Ngo <dai.ngo@oracle.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
461d0b57c9
commit
eb2eb6b6af
@@ -1163,6 +1163,8 @@ extern void lease_unregister_notifier(struct notifier_block *);
|
||||
struct files_struct;
|
||||
extern void show_fd_locks(struct seq_file *f,
|
||||
struct file *filp, struct files_struct *files);
|
||||
extern bool locks_owner_has_blockers(struct file_lock_context *flctx,
|
||||
fl_owner_t owner);
|
||||
#else /* !CONFIG_FILE_LOCKING */
|
||||
static inline int fcntl_getlk(struct file *file, unsigned int cmd,
|
||||
struct flock __user *user)
|
||||
@@ -1303,6 +1305,11 @@ static inline int lease_modify(struct file_lock *fl, int arg,
|
||||
struct files_struct;
|
||||
static inline void show_fd_locks(struct seq_file *f,
|
||||
struct file *filp, struct files_struct *files) {}
|
||||
static inline bool locks_owner_has_blockers(struct file_lock_context *flctx,
|
||||
fl_owner_t owner)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif /* !CONFIG_FILE_LOCKING */
|
||||
|
||||
static inline struct inode *file_inode(const struct file *f)
|
||||
|
Reference in New Issue
Block a user