diff options
author | alfred <alfred@FreeBSD.org> | 2002-01-14 00:13:45 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2002-01-14 00:13:45 +0000 |
commit | 1f82bc18d1d1e906cd9ed68039acb051fa6e11cf (patch) | |
tree | fe7842143c9585ef2ebb793d812ec71cc4488a51 /sys/compat/linux/linux_file.c | |
parent | c4988e25d265bba2c63409a8c8b8708c13d8525e (diff) | |
download | FreeBSD-src-1f82bc18d1d1e906cd9ed68039acb051fa6e11cf.zip FreeBSD-src-1f82bc18d1d1e906cd9ed68039acb051fa6e11cf.tar.gz |
Replace ffind_* with fget calls.
Make fget MPsafe.
Make fgetvp and fgetsock use the fget subsystem to reduce code bloat.
Push giant down in fpathconf().
Diffstat (limited to 'sys/compat/linux/linux_file.c')
-rw-r--r-- | sys/compat/linux/linux_file.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 54f4584..1dfa4a1 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -137,11 +137,13 @@ linux_open(struct thread *td, struct linux_open_args *args) SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) { struct file *fp; - fp = ffind_hold(td, td->td_retval[0]); + error = fget(td, td->td_retval[0], &fp); PROC_UNLOCK(p); - if (fp->f_type == DTYPE_VNODE) - fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, td); - fdrop(fp, td); + if (!error) { + if (fp->f_type == DTYPE_VNODE) + fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, td); + fdrop(fp, td); + } } else PROC_UNLOCK(p); #ifdef DEBUG @@ -996,9 +998,9 @@ fcntl_common(struct thread *td, struct linux_fcntl64_args *args) * significant effect for pipes (SIGIO is not delivered for * pipes under Linux-2.2.35 at least). */ - fp = ffind_hold(td, args->fd); - if (fp == NULL) - return EBADF; + error = fget(td, args->fd, &fp); + if (error) + return (error); if (fp->f_type == DTYPE_PIPE) { fdrop(fp, td); return (EINVAL); |