Commit 6cd906627b4f7438c6f5bb1d1eed63a6d7776e2e
Committed by
J. Bruce Fields
1 parent
ae89254da6
NFSD: Remove duplicate initialization of file_lock
locks_alloc_lock() has initialized struct file_lock, no need to re-initialize it here. Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Reviewed-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Showing 1 changed file with 2 additions and 4 deletions Side-by-side Diff
fs/nfsd/nfs4state.c
... | ... | @@ -3766,7 +3766,6 @@ |
3766 | 3766 | fl = locks_alloc_lock(); |
3767 | 3767 | if (!fl) |
3768 | 3768 | return NULL; |
3769 | - locks_init_lock(fl); | |
3770 | 3769 | fl->fl_lmops = &nfsd_lease_mng_ops; |
3771 | 3770 | fl->fl_flags = FL_DELEG; |
3772 | 3771 | fl->fl_type = flag == NFS4_OPEN_DELEGATE_READ? F_RDLCK: F_WRLCK; |
... | ... | @@ -5217,7 +5216,6 @@ |
5217 | 5216 | } |
5218 | 5217 | |
5219 | 5218 | fp = lock_stp->st_stid.sc_file; |
5220 | - locks_init_lock(file_lock); | |
5221 | 5219 | switch (lock->lk_type) { |
5222 | 5220 | case NFS4_READ_LT: |
5223 | 5221 | case NFS4_READW_LT: |
... | ... | @@ -5361,7 +5359,7 @@ |
5361 | 5359 | status = nfserr_jukebox; |
5362 | 5360 | goto out; |
5363 | 5361 | } |
5364 | - locks_init_lock(file_lock); | |
5362 | + | |
5365 | 5363 | switch (lockt->lt_type) { |
5366 | 5364 | case NFS4_READ_LT: |
5367 | 5365 | case NFS4_READW_LT: |
... | ... | @@ -5439,7 +5437,7 @@ |
5439 | 5437 | status = nfserr_jukebox; |
5440 | 5438 | goto fput; |
5441 | 5439 | } |
5442 | - locks_init_lock(file_lock); | |
5440 | + | |
5443 | 5441 | file_lock->fl_type = F_UNLCK; |
5444 | 5442 | file_lock->fl_owner = (fl_owner_t)lockowner(stp->st_stateowner); |
5445 | 5443 | file_lock->fl_pid = current->tgid; |