mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 06:01:23 +00:00
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>
This commit is contained in:
parent
ae89254da6
commit
6cd906627b
1 changed files with 2 additions and 4 deletions
|
@ -3766,7 +3766,6 @@ static struct file_lock *nfs4_alloc_init_lease(struct nfs4_file *fp, int flag)
|
||||||
fl = locks_alloc_lock();
|
fl = locks_alloc_lock();
|
||||||
if (!fl)
|
if (!fl)
|
||||||
return NULL;
|
return NULL;
|
||||||
locks_init_lock(fl);
|
|
||||||
fl->fl_lmops = &nfsd_lease_mng_ops;
|
fl->fl_lmops = &nfsd_lease_mng_ops;
|
||||||
fl->fl_flags = FL_DELEG;
|
fl->fl_flags = FL_DELEG;
|
||||||
fl->fl_type = flag == NFS4_OPEN_DELEGATE_READ? F_RDLCK: F_WRLCK;
|
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,
|
||||||
}
|
}
|
||||||
|
|
||||||
fp = lock_stp->st_stid.sc_file;
|
fp = lock_stp->st_stid.sc_file;
|
||||||
locks_init_lock(file_lock);
|
|
||||||
switch (lock->lk_type) {
|
switch (lock->lk_type) {
|
||||||
case NFS4_READ_LT:
|
case NFS4_READ_LT:
|
||||||
case NFS4_READW_LT:
|
case NFS4_READW_LT:
|
||||||
|
@ -5361,7 +5359,7 @@ nfsd4_lockt(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
|
||||||
status = nfserr_jukebox;
|
status = nfserr_jukebox;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
locks_init_lock(file_lock);
|
|
||||||
switch (lockt->lt_type) {
|
switch (lockt->lt_type) {
|
||||||
case NFS4_READ_LT:
|
case NFS4_READ_LT:
|
||||||
case NFS4_READW_LT:
|
case NFS4_READW_LT:
|
||||||
|
@ -5439,7 +5437,7 @@ nfsd4_locku(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
|
||||||
status = nfserr_jukebox;
|
status = nfserr_jukebox;
|
||||||
goto fput;
|
goto fput;
|
||||||
}
|
}
|
||||||
locks_init_lock(file_lock);
|
|
||||||
file_lock->fl_type = F_UNLCK;
|
file_lock->fl_type = F_UNLCK;
|
||||||
file_lock->fl_owner = (fl_owner_t)lockowner(stp->st_stateowner);
|
file_lock->fl_owner = (fl_owner_t)lockowner(stp->st_stateowner);
|
||||||
file_lock->fl_pid = current->tgid;
|
file_lock->fl_pid = current->tgid;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue