aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKinglong Mee <kinglongmee@gmail.com>2014-08-14 20:02:55 -0400
committerJ. Bruce Fields <bfields@redhat.com>2014-08-28 15:58:35 -0400
commit6cd906627b4f7438c6f5bb1d1eed63a6d7776e2e (patch)
treebb922c8cddb4ba9c5b4589729d1ea47ea067727d
parentae89254da6879cffa6a17327e5f3f60217b718cf (diff)
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>
-rw-r--r--fs/nfsd/nfs4state.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 4356d32479b2..e773036b03d0 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -3766,7 +3766,6 @@ static struct file_lock *nfs4_alloc_init_lease(struct nfs4_file *fp, int flag)
3766 fl = locks_alloc_lock(); 3766 fl = locks_alloc_lock();
3767 if (!fl) 3767 if (!fl)
3768 return NULL; 3768 return NULL;
3769 locks_init_lock(fl);
3770 fl->fl_lmops = &nfsd_lease_mng_ops; 3769 fl->fl_lmops = &nfsd_lease_mng_ops;
3771 fl->fl_flags = FL_DELEG; 3770 fl->fl_flags = FL_DELEG;
3772 fl->fl_type = flag == NFS4_OPEN_DELEGATE_READ? F_RDLCK: F_WRLCK; 3771 fl->fl_type = flag == NFS4_OPEN_DELEGATE_READ? F_RDLCK: F_WRLCK;
@@ -5217,7 +5216,6 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
5217 } 5216 }
5218 5217
5219 fp = lock_stp->st_stid.sc_file; 5218 fp = lock_stp->st_stid.sc_file;
5220 locks_init_lock(file_lock);
5221 switch (lock->lk_type) { 5219 switch (lock->lk_type) {
5222 case NFS4_READ_LT: 5220 case NFS4_READ_LT:
5223 case NFS4_READW_LT: 5221 case NFS4_READW_LT:
@@ -5361,7 +5359,7 @@ nfsd4_lockt(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
5361 status = nfserr_jukebox; 5359 status = nfserr_jukebox;
5362 goto out; 5360 goto out;
5363 } 5361 }
5364 locks_init_lock(file_lock); 5362
5365 switch (lockt->lt_type) { 5363 switch (lockt->lt_type) {
5366 case NFS4_READ_LT: 5364 case NFS4_READ_LT:
5367 case NFS4_READW_LT: 5365 case NFS4_READW_LT:
@@ -5439,7 +5437,7 @@ nfsd4_locku(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
5439 status = nfserr_jukebox; 5437 status = nfserr_jukebox;
5440 goto fput; 5438 goto fput;
5441 } 5439 }
5442 locks_init_lock(file_lock); 5440
5443 file_lock->fl_type = F_UNLCK; 5441 file_lock->fl_type = F_UNLCK;
5444 file_lock->fl_owner = (fl_owner_t)lockowner(stp->st_stateowner); 5442 file_lock->fl_owner = (fl_owner_t)lockowner(stp->st_stateowner);
5445 file_lock->fl_pid = current->tgid; 5443 file_lock->fl_pid = current->tgid;