summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2002-12-23 22:46:47 +0000
committerphk <phk@FreeBSD.org>2002-12-23 22:46:47 +0000
commit26984a400376cf63b49953e6661acbf02e70c62d (patch)
treeb57dea81cd1322b5b4ab3aafad76899af83884fd
parenteb600c56aafb2d036bc322767902838dd016b57c (diff)
downloadFreeBSD-src-26984a400376cf63b49953e6661acbf02e70c62d.zip
FreeBSD-src-26984a400376cf63b49953e6661acbf02e70c62d.tar.gz
Move the declaration of the socket fileops from socketvar.h to file.h.
This allows us to use the new typedefs and removes the needs for a number of forward struct declarations in socketvar.h
-rw-r--r--sys/kern/uipc_syscalls.c2
-rw-r--r--sys/sys/file.h14
-rw-r--r--sys/sys/socketvar.h20
3 files changed, 14 insertions, 22 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index 21aa343..48ba50d 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -107,8 +107,6 @@ u_int sf_buf_alloc_want;
#define COMPAT_OLDSOCK
#endif
-extern struct fileops socketops;
-
/*
* MPSAFE
*/
diff --git a/sys/sys/file.h b/sys/sys/file.h
index 77344d0..5161b83 100644
--- a/sys/sys/file.h
+++ b/sys/sys/file.h
@@ -161,6 +161,20 @@ int fget_write(struct thread *td, int fd, struct file **fpp);
int fdrop(struct file *fp, struct thread *td);
int fdrop_locked(struct file *fp, struct thread *td);
+/*
+ * The socket operations are used a couple of places.
+ * XXX: This is wrong, they should go through the operations vector for
+ * XXX: sockets instead of going directly for the individual functions. /phk
+ */
+fo_rdwr_t soo_read;
+fo_rdwr_t soo_write;
+fo_ioctl_t soo_ioctl;
+fo_poll_t soo_poll;
+fo_kqfilter_t soo_kqfilter;
+fo_stat_t soo_stat;
+fo_close_t soo_close;
+extern struct fileops socketops;
+
/* Lock a file. */
#define FILE_LOCK(f) mtx_lock((f)->f_mtxp)
#define FILE_UNLOCK(f) mtx_unlock((f)->f_mtxp)
diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h
index 20cb365..7046c45 100644
--- a/sys/sys/socketvar.h
+++ b/sys/sys/socketvar.h
@@ -338,32 +338,12 @@ extern u_long sb_max;
extern struct uma_zone *socket_zone;
extern so_gen_t so_gencnt;
-struct file;
-struct filedesc;
-struct knote;
struct mbuf;
struct sockaddr;
-struct stat;
struct ucred;
struct uio;
/*
- * File operations on sockets.
- */
-int soo_read(struct file *fp, struct uio *uio, struct ucred *active_cred,
- int flags, struct thread *td);
-int soo_write(struct file *fp, struct uio *uio,
- struct ucred *active_cred, int flags, struct thread *td);
-int soo_close(struct file *fp, struct thread *td);
-int soo_ioctl(struct file *fp, u_long cmd, void *data,
- struct ucred *active_cred, struct thread *td);
-int soo_poll(struct file *fp, int events, struct ucred *active_cred,
- struct thread *td);
-int soo_stat(struct file *fp, struct stat *ub, struct ucred *active_cred,
- struct thread *td);
-int soo_kqfilter(struct file *fp, struct knote *kn);
-
-/*
* From uipc_socket and friends
*/
struct sockaddr *dup_sockaddr(struct sockaddr *sa, int canwait);
OpenPOWER on IntegriCloud