1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00

Remove unneeded code added in revision 1.188.

This commit is contained in:
Tor Egge 2003-03-01 17:18:28 +00:00
parent 3dc02da1ae
commit c6faf3bf1d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=111708

View File

@ -440,19 +440,6 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg)
vp = fp->f_data;
error = VOP_ADVLOCK(vp, (caddr_t)p->p_leader, F_GETLK, flp,
F_POSIX);
/* Check for race with close */
FILEDESC_LOCK(fdp);
if ((unsigned) fd >= fdp->fd_nfiles ||
fp != fdp->fd_ofiles[fd]) {
FILEDESC_UNLOCK(fdp);
flp->l_whence = SEEK_SET;
flp->l_start = 0;
flp->l_len = 0;
flp->l_type = F_UNLCK;
(void) VOP_ADVLOCK(vp, (caddr_t)p->p_leader,
F_UNLCK, flp, F_POSIX);
} else
FILEDESC_UNLOCK(fdp);
fdrop(fp, td);
break;
default:
@ -1659,25 +1646,15 @@ closef(fp, td)
* If the descriptor was in a message, POSIX-style locks
* aren't passed with the descriptor.
*/
if (td != NULL && fp->f_type == DTYPE_VNODE) {
struct proc *p = td->td_proc;
int pflagcopy;
if (p->p_leader != p ||
p->p_peers != NULL) {
PROC_LOCK(p->p_leader);
pflagcopy = p->p_leader->p_flag;
PROC_UNLOCK(p->p_leader);
} else
pflagcopy = p->p_flag;
if ((pflagcopy & P_ADVLOCK) != 0) {
lf.l_whence = SEEK_SET;
lf.l_start = 0;
lf.l_len = 0;
lf.l_type = F_UNLCK;
vp = fp->f_data;
(void) VOP_ADVLOCK(vp, (caddr_t)td->td_proc->p_leader,
F_UNLCK, &lf, F_POSIX);
}
if (td != NULL && (td->td_proc->p_leader->p_flag & P_ADVLOCK) != 0 &&
fp->f_type == DTYPE_VNODE) {
lf.l_whence = SEEK_SET;
lf.l_start = 0;
lf.l_len = 0;
lf.l_type = F_UNLCK;
vp = fp->f_data;
(void) VOP_ADVLOCK(vp, (caddr_t)td->td_proc->p_leader,
F_UNLCK, &lf, F_POSIX);
}
return (fdrop(fp, td));
}