Skip to content

Commit d0449b9

Browse files
JoePerchesJeff Layton
authored andcommitted
locks: Remove unused conf argument from lm_grant
This argument is always NULL so don't pass it around. [jlayton: remove dependencies on previous patches in series] Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jeff Layton <jlayton@primarydata.com>
1 parent f39b913 commit d0449b9

3 files changed

Lines changed: 8 additions & 14 deletions

File tree

‎fs/dlm/plock.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct plock_op {
3030

3131
struct plock_xop {
3232
struct plock_op xop;
33-
void *callback;
33+
int (*callback)(struct file_lock *fl, int result);
3434
void *fl;
3535
void *file;
3636
struct file_lock flc;
@@ -190,7 +190,7 @@ static int dlm_plock_callback(struct plock_op *op)
190190
struct file *file;
191191
struct file_lock *fl;
192192
struct file_lock *flc;
193-
int (*notify)(void *, void *, int) = NULL;
193+
int (*notify)(struct file_lock *fl, int result) = NULL;
194194
struct plock_xop *xop = (struct plock_xop *)op;
195195
int rv = 0;
196196

@@ -209,7 +209,7 @@ static int dlm_plock_callback(struct plock_op *op)
209209
notify = xop->callback;
210210

211211
if (op->info.rv) {
212-
notify(fl, NULL, op->info.rv);
212+
notify(fl, op->info.rv);
213213
goto out;
214214
}
215215

@@ -228,7 +228,7 @@ static int dlm_plock_callback(struct plock_op *op)
228228
(unsigned long long)op->info.number, file, fl);
229229
}
230230

231-
rv = notify(fl, NULL, 0);
231+
rv = notify(fl, 0);
232232
if (rv) {
233233
/* XXX: We need to cancel the fs lock here: */
234234
log_print("dlm_plock_callback: lock granted after lock request "

‎fs/lockd/svclock.c‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -667,22 +667,16 @@ nlmsvc_cancel_blocked(struct net *net, struct nlm_file *file, struct nlm_lock *l
667667
* deferred rpc for GETLK and SETLK.
668668
*/
669669
static void
670-
nlmsvc_update_deferred_block(struct nlm_block *block, struct file_lock *conf,
671-
int result)
670+
nlmsvc_update_deferred_block(struct nlm_block *block, int result)
672671
{
673672
block->b_flags |= B_GOT_CALLBACK;
674673
if (result == 0)
675674
block->b_granted = 1;
676675
else
677676
block->b_flags |= B_TIMED_OUT;
678-
if (conf) {
679-
if (block->b_fl)
680-
__locks_copy_lock(block->b_fl, conf);
681-
}
682677
}
683678

684-
static int nlmsvc_grant_deferred(struct file_lock *fl, struct file_lock *conf,
685-
int result)
679+
static int nlmsvc_grant_deferred(struct file_lock *fl, int result)
686680
{
687681
struct nlm_block *block;
688682
int rc = -ENOENT;
@@ -697,7 +691,7 @@ static int nlmsvc_grant_deferred(struct file_lock *fl, struct file_lock *conf,
697691
rc = -ENOLCK;
698692
break;
699693
}
700-
nlmsvc_update_deferred_block(block, conf, result);
694+
nlmsvc_update_deferred_block(block, result);
701695
} else if (result == 0)
702696
block->b_granted = 1;
703697

‎include/linux/fs.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ struct lock_manager_operations {
869869
int (*lm_compare_owner)(struct file_lock *, struct file_lock *);
870870
unsigned long (*lm_owner_key)(struct file_lock *);
871871
void (*lm_notify)(struct file_lock *); /* unblock callback */
872-
int (*lm_grant)(struct file_lock *, struct file_lock *, int);
872+
int (*lm_grant)(struct file_lock *, int);
873873
void (*lm_break)(struct file_lock *);
874874
int (*lm_change)(struct file_lock **, int);
875875
};

0 commit comments

Comments
 (0)