@@ -677,7 +677,6 @@ nlmsvc_cancel_blocked(struct net *net, struct nlm_file *file, struct nlm_lock *l
{
struct nlm_block *block;
int status = 0;
- int mode;
dprintk("lockd: nlmsvc_cancel(%s/%ld, pi=%d, %Ld-%Ld)\n",
nlmsvc_file_inode(file)->i_sb->s_id,
@@ -695,8 +694,7 @@ nlmsvc_cancel_blocked(struct net *net, struct nlm_file *file, struct nlm_lock *l
if (block != NULL) {
struct file_lock *fl = &block->b_call->a_args.lock.fl;
- mode = lock_to_openmode(fl);
- vfs_cancel_lock(block->b_file->f_file[mode], fl);
+ vfs_cancel_lock(fl);
status = nlmsvc_unlink_block(block);
nlmsvc_release_block(block);
}
@@ -2657,14 +2657,14 @@ void locks_remove_file(struct file *filp)
/**
* vfs_cancel_lock - file byte range unblock lock
- * @filp: The file to apply the unblock to
* @fl: The lock to be unblocked
*
* Used by lock managers to cancel blocked requests
*/
-int vfs_cancel_lock(struct file *filp, struct file_lock *fl)
+int vfs_cancel_lock(struct file_lock *fl)
{
- WARN_ON_ONCE(filp != fl->fl_file);
+ struct file *filp = fl->fl_file;
+
if (filp->f_op->lock)
return filp->f_op->lock(filp, F_CANCELLK, fl);
return 0;
@@ -1169,7 +1169,7 @@ extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *
extern int locks_delete_block(struct file_lock *);
extern int vfs_test_lock(struct file_lock *);
extern int vfs_lock_file(unsigned int, struct file_lock *, struct file_lock *);
-extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl);
+extern int vfs_cancel_lock(struct file_lock *fl);
bool vfs_file_has_locks(struct file *file);
extern int locks_lock_inode_wait(struct inode *inode, struct file_lock *fl);
extern int __break_lease(struct inode *inode, unsigned int flags, unsigned int type);
@@ -1280,7 +1280,7 @@ static inline int vfs_lock_file(unsigned int cmd, struct file_lock *fl,
return -ENOLCK;
}
-static inline int vfs_cancel_lock(struct file *filp, struct file_lock *fl)
+static inline int vfs_cancel_lock(struct file_lock *fl)
{
return 0;
}
struct file_lock already has a fl_file field that must be populated, so the @filp argument to this function is redundant. Remove it and use fl_file instead. Signed-off-by: Jeff Layton <jlayton@kernel.org> --- fs/lockd/svclock.c | 4 +--- fs/locks.c | 6 +++--- include/linux/fs.h | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-)