summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_ioctl.c
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2002-01-14 00:13:45 +0000
committeralfred <alfred@FreeBSD.org>2002-01-14 00:13:45 +0000
commit1f82bc18d1d1e906cd9ed68039acb051fa6e11cf (patch)
treefe7842143c9585ef2ebb793d812ec71cc4488a51 /sys/compat/linux/linux_ioctl.c
parentc4988e25d265bba2c63409a8c8b8708c13d8525e (diff)
downloadFreeBSD-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_ioctl.c')
-rw-r--r--sys/compat/linux/linux_ioctl.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c
index baafb5b..acf71d9 100644
--- a/sys/compat/linux/linux_ioctl.c
+++ b/sys/compat/linux/linux_ioctl.c
@@ -109,9 +109,8 @@ linux_ioctl_disk(struct thread *td, struct linux_ioctl_args *args)
int error;
struct disklabel dl;
- fp = ffind_hold(td, args->fd);
- if (fp == NULL)
- return (EBADF);
+ if ((error = fget(td, args->fd, &fp)) != 0)
+ return (error);
switch (args->cmd & 0xffff) {
case LINUX_BLKGETSIZE:
error = fo_ioctl(fp, DIOCGDINFO, (caddr_t)&dl, td);
@@ -555,9 +554,9 @@ linux_ioctl_termio(struct thread *td, struct linux_ioctl_args *args)
struct file *fp;
int error;
- fp = ffind_hold(td, args->fd);
- if (fp == NULL)
- return (EBADF);
+ if ((error = fget(td, args->fd, &fp)) != 0)
+ return (error);
+
switch (args->cmd & 0xffff) {
case LINUX_TCGETS:
@@ -1249,9 +1248,8 @@ linux_ioctl_cdrom(struct thread *td, struct linux_ioctl_args *args)
struct file *fp;
int error;
- fp = ffind_hold(td, args->fd);
- if (fp == NULL)
- return (EBADF);
+ if ((error = fget(td, args->fd, &fp)) != 0)
+ return (error);
switch (args->cmd & 0xffff) {
case LINUX_CDROMPAUSE:
@@ -1706,9 +1704,8 @@ linux_ioctl_console(struct thread *td, struct linux_ioctl_args *args)
struct file *fp;
int error;
- fp = ffind_hold(td, args->fd);
- if (fp == NULL)
- return (EBADF);
+ if ((error = fget(td, args->fd, &fp)) != 0)
+ return (error);
switch (args->cmd & 0xffff) {
case LINUX_KIOCSOUND:
@@ -2259,9 +2256,8 @@ linux_ioctl(struct thread *td, struct linux_ioctl_args *args)
(unsigned long)args->cmd);
#endif
- fp = ffind_hold(td, args->fd);
- if (fp == NULL)
- return (EBADF);
+ if ((error = fget(td, args->fd, &fp)) != 0)
+ return (error);
if ((fp->f_flag & (FREAD|FWRITE)) == 0) {
fdrop(fp, td);
return (EBADF);
OpenPOWER on IntegriCloud