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
This commit is contained in:
phk 2002-12-23 22:46:47 +00:00
parent eb600c56aa
commit 26984a4003
3 changed files with 14 additions and 22 deletions

View File

@ -107,8 +107,6 @@ u_int sf_buf_alloc_want;
#define COMPAT_OLDSOCK
#endif
extern struct fileops socketops;
/*
* MPSAFE
*/

View File

@ -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)

View File

@ -338,31 +338,11 @@ 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
*/