Initialize struct fileops with C99 sparse initialization.

This commit is contained in:
Poul-Henning Kamp 2003-06-18 18:16:40 +00:00
parent d58a33063a
commit 7c2d2efd58
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=116546
7 changed files with 52 additions and 31 deletions

View File

@ -90,8 +90,13 @@ static dev_t dt_ptm, dt_arp, dt_icmp, dt_ip, dt_tcp, dt_udp, dt_rawip,
dt_unix_dgram, dt_unix_stream, dt_unix_ord_stream;
static struct fileops svr4_netops = {
soo_read, soo_write, soo_ioctl, soo_poll, soo_kqfilter,
soo_stat, svr4_soo_close
.fo_read = soo_read,
.fo_write = soo_write,
.fo_ioctl = soo_ioctl,
.fo_poll = soo_poll,
.fo_kqfilter = soo_kqfilter,
.fo_stat = soo_stat,
.fo_close = svr4_soo_close
};
#define CDEV_MAJOR 103

View File

@ -2367,14 +2367,13 @@ static fo_stat_t badfo_stat;
static fo_close_t badfo_close;
struct fileops badfileops = {
badfo_readwrite,
badfo_readwrite,
badfo_ioctl,
badfo_poll,
badfo_kqfilter,
badfo_stat,
badfo_close,
0
.fo_read = badfo_readwrite,
.fo_write = badfo_readwrite,
.fo_ioctl = badfo_ioctl,
.fo_poll = badfo_poll,
.fo_kqfilter = badfo_kqfilter,
.fo_stat = badfo_stat,
.fo_close = badfo_close,
};
static int

View File

@ -69,14 +69,13 @@ static fo_stat_t kqueue_stat;
static fo_close_t kqueue_close;
static struct fileops kqueueops = {
kqueue_read,
kqueue_write,
kqueue_ioctl,
kqueue_poll,
kqueue_kqfilter,
kqueue_stat,
kqueue_close,
0
.fo_read = kqueue_read,
.fo_write = kqueue_write,
.fo_ioctl = kqueue_ioctl,
.fo_poll = kqueue_poll,
.fo_kqfilter = kqueue_kqfilter,
.fo_stat = kqueue_stat,
.fo_close = kqueue_close,
};
static void knote_attach(struct knote *kn, struct filedesc *fdp);

View File

@ -104,8 +104,14 @@ static fo_stat_t pipe_stat;
static fo_close_t pipe_close;
static struct fileops pipeops = {
pipe_read, pipe_write, pipe_ioctl, pipe_poll, pipe_kqfilter,
pipe_stat, pipe_close, DFLAG_PASSABLE
.fo_read = pipe_read,
.fo_write = pipe_write,
.fo_ioctl = pipe_ioctl,
.fo_poll = pipe_poll,
.fo_kqfilter = pipe_kqfilter,
.fo_stat = pipe_stat,
.fo_close = pipe_close,
.fo_flags = DFLAG_PASSABLE
};
static void filt_pipedetach(struct knote *kn);

View File

@ -57,8 +57,14 @@ __FBSDID("$FreeBSD$");
#include <net/route.h>
struct fileops socketops = {
soo_read, soo_write, soo_ioctl, soo_poll, soo_kqfilter,
soo_stat, soo_close, DFLAG_PASSABLE
.fo_read = soo_read,
.fo_write = soo_write,
.fo_ioctl = soo_ioctl,
.fo_poll = soo_poll,
.fo_kqfilter = soo_kqfilter,
.fo_stat = soo_stat,
.fo_close = soo_close,
.fo_flags = DFLAG_PASSABLE
};
/* ARGSUSED */

View File

@ -73,8 +73,14 @@ static fo_stat_t vn_statfile;
static fo_close_t vn_closefile;
struct fileops vnops = {
vn_read, vn_write, vn_ioctl, vn_poll, vn_kqfilter,
vn_statfile, vn_closefile, DFLAG_PASSABLE
.fo_read = vn_read,
.fo_write = vn_write,
.fo_ioctl = vn_ioctl,
.fo_poll = vn_poll,
.fo_kqfilter = vn_kqfilter,
.fo_stat = vn_statfile,
.fo_close = vn_closefile,
.fo_flags = DFLAG_PASSABLE
};
int

View File

@ -93,13 +93,13 @@ static int cryptof_stat(struct file *, struct stat *,
static int cryptof_close(struct file *, struct thread *);
static struct fileops cryptofops = {
cryptof_rw,
cryptof_rw,
cryptof_ioctl,
cryptof_poll,
cryptof_kqfilter,
cryptof_stat,
cryptof_close
.fo_read = cryptof_rw,
.fo_write = cryptof_rw,
.fo_ioctl = cryptof_ioctl,
.fo_poll = cryptof_poll,
.fo_kqfilter = cryptof_kqfilter,
.fo_stat = cryptof_stat,
.fo_close = cryptof_close
};
static struct csession *csefind(struct fcrypt *, u_int);