kern: Make fileops and filterops tables const where possible

No functional change intended.

MFC after:	1 week

(cherry picked from commit ef9ffb8594eee294334ced627755bf5b46b48f9f)
This commit is contained in:
Mark Johnston 2024-11-25 22:39:31 +00:00 committed by Franco Fichtner
parent 7d3d1c9c15
commit de1b92e2b4
44 changed files with 91 additions and 90 deletions

View file

@ -789,7 +789,7 @@ ti_pruss_mmap(struct cdev *cdev, vm_ooffset_t offset, vm_paddr_t *paddr,
return (0);
}
static struct filterops ti_pruss_kq_read = {
static const struct filterops ti_pruss_kq_read = {
.f_isfd = 1,
.f_detach = ti_pruss_irq_kqread_detach,
.f_event = ti_pruss_irq_kqevent,

View file

@ -203,7 +203,7 @@ static struct cdevsw pass_cdevsw = {
.d_name = "pass",
};
static struct filterops passread_filtops = {
static const struct filterops passread_filtops = {
.f_isfd = 1,
.f_detach = passreadfiltdetach,
.f_event = passreadfilt

View file

@ -105,7 +105,7 @@ static d_poll_t targpoll;
static d_kqfilter_t targkqfilter;
static void targreadfiltdetach(struct knote *kn);
static int targreadfilt(struct knote *kn, long hint);
static struct filterops targread_filtops = {
static const struct filterops targread_filtops = {
.f_isfd = 1,
.f_detach = targreadfiltdetach,
.f_event = targreadfilt,

View file

@ -43,7 +43,7 @@ struct linux_file;
#undef file
extern struct fileops linuxfileops;
extern const struct fileops linuxfileops;
static inline struct linux_file *
linux_fget(unsigned int fd)

View file

@ -1113,13 +1113,13 @@ linux_file_kqfilter_write_event(struct knote *kn, long hint)
return ((filp->f_kqflags & LINUX_KQ_FLAG_NEED_WRITE) ? 1 : 0);
}
static struct filterops linux_dev_kqfiltops_read = {
static const struct filterops linux_dev_kqfiltops_read = {
.f_isfd = 1,
.f_detach = linux_file_kqfilter_detach,
.f_event = linux_file_kqfilter_read_event,
};
static struct filterops linux_dev_kqfiltops_write = {
static const struct filterops linux_dev_kqfiltops_write = {
.f_isfd = 1,
.f_detach = linux_file_kqfilter_detach,
.f_event = linux_file_kqfilter_write_event,
@ -1738,7 +1738,7 @@ linux_file_kcmp(struct file *fp1, struct file *fp2, struct thread *td)
return (kcmp_cmp((uintptr_t)filp1->f_cdev, (uintptr_t)filp2->f_cdev));
}
struct fileops linuxfileops = {
const struct fileops linuxfileops = {
.fo_read = linux_file_read,
.fo_write = linux_file_write,
.fo_truncate = invfo_truncate,

View file

@ -366,14 +366,14 @@ beri_kqdetach(struct knote *kn)
knlist_remove(&sc->beri_rsel.si_note, kn, 0);
}
static struct filterops beri_read_filterops = {
static const struct filterops beri_read_filterops = {
.f_isfd = 1,
.f_attach = NULL,
.f_detach = beri_kqdetach,
.f_event = beri_kqread,
};
static struct filterops beri_write_filterops = {
static const struct filterops beri_write_filterops = {
.f_isfd = 1,
.f_attach = NULL,
.f_detach = beri_kqdetach,

View file

@ -1100,7 +1100,7 @@ again:
static void cyapafiltdetach(struct knote *);
static int cyapafilt(struct knote *, long);
static struct filterops cyapa_filtops = {
static const struct filterops cyapa_filtops = {
.f_isfd = 1,
.f_detach = cyapafiltdetach,
.f_event = cyapafilt

View file

@ -91,7 +91,7 @@ static struct cdevsw evdev_cdevsw = {
.d_name = "evdev",
};
static struct filterops evdev_cdev_filterops = {
static const struct filterops evdev_cdev_filterops = {
.f_isfd = 1,
.f_attach = NULL,
.f_detach = evdev_kqdetach,

View file

@ -93,13 +93,13 @@ static struct cdevsw uinput_cdevsw = {
static struct cdev *uinput_cdev;
static struct evdev_methods uinput_ev_methods = {
static const struct evdev_methods uinput_ev_methods = {
.ev_open = NULL,
.ev_close = NULL,
.ev_event = uinput_ev_event,
};
static struct filterops uinput_filterops = {
static const struct filterops uinput_filterops = {
.f_isfd = 1,
.f_attach = NULL,
.f_detach = uinput_kqdetach,

View file

@ -152,7 +152,7 @@ static struct cdevsw gpioc_cdevsw = {
.d_name = "gpioc",
};
static struct filterops gpioc_read_filterops = {
static const struct filterops gpioc_read_filterops = {
.f_isfd = true,
.f_attach = NULL,
.f_detach = gpioc_kqdetach,

View file

@ -172,7 +172,7 @@ static int hidraw_kqread(struct knote *, long);
static void hidraw_kqdetach(struct knote *);
static void hidraw_notify(struct hidraw_softc *);
static struct filterops hidraw_filterops_read = {
static const struct filterops hidraw_filterops_read = {
.f_isfd = 1,
.f_detach = hidraw_kqdetach,
.f_event = hidraw_kqread,

View file

@ -1397,13 +1397,13 @@ netmap_knwrite(struct knote *kn, long hint)
return netmap_knrw(kn, hint, POLLOUT);
}
static struct filterops netmap_rfiltops = {
static const struct filterops netmap_rfiltops = {
.f_isfd = 1,
.f_detach = netmap_knrdetach,
.f_event = netmap_knread,
};
static struct filterops netmap_wfiltops = {
static const struct filterops netmap_wfiltops = {
.f_isfd = 1,
.f_detach = netmap_knwdetach,
.f_event = netmap_knwrite,

View file

@ -85,7 +85,7 @@ static struct cdevsw adf_state_cdevsw = {
.d_name = ADF_DEV_STATE_NAME,
};
static struct filterops adf_state_read_filterops = {
static const struct filterops adf_state_read_filterops = {
.f_isfd = 1,
.f_attach = NULL,
.f_detach = adf_state_kqread_detach,

View file

@ -1228,13 +1228,13 @@ usb_filter_read(struct knote *kn, long hint)
return (m ? 1 : 0);
}
static struct filterops usb_filtops_write = {
static const struct filterops usb_filtops_write = {
.f_isfd = 1,
.f_detach = usb_filter_detach,
.f_event = usb_filter_write,
};
static struct filterops usb_filtops_read = {
static const struct filterops usb_filtops_read = {
.f_isfd = 1,
.f_detach = usb_filter_detach,
.f_event = usb_filter_read,

View file

@ -191,13 +191,13 @@ static void cuse_client_kqfilter_write_detach(struct knote *kn);
static int cuse_client_kqfilter_read_event(struct knote *kn, long hint);
static int cuse_client_kqfilter_write_event(struct knote *kn, long hint);
static struct filterops cuse_client_kqfilter_read_ops = {
static const struct filterops cuse_client_kqfilter_read_ops = {
.f_isfd = 1,
.f_detach = cuse_client_kqfilter_read_detach,
.f_event = cuse_client_kqfilter_read_event,
};
static struct filterops cuse_client_kqfilter_write_ops = {
static const struct filterops cuse_client_kqfilter_write_ops = {
.f_isfd = 1,
.f_detach = cuse_client_kqfilter_write_detach,
.f_event = cuse_client_kqfilter_write_event,

View file

@ -68,7 +68,7 @@
static struct vop_vector devfs_vnodeops;
static struct vop_vector devfs_specops;
static struct fileops devfs_ops_f;
static const struct fileops devfs_ops_f;
#include <fs/devfs/devfs.h>
#include <fs/devfs/devfs_int.h>
@ -2039,7 +2039,7 @@ devfs_cmp_f(struct file *fp1, struct file *fp2, struct thread *td)
return (kcmp_cmp((uintptr_t)fp1->f_data, (uintptr_t)fp2->f_data));
}
static struct fileops devfs_ops_f = {
static const struct fileops devfs_ops_f = {
.fo_read = devfs_read_f,
.fo_write = devfs_write_f,
.fo_truncate = devfs_truncate_f,

View file

@ -121,13 +121,13 @@ static int fuse_device_filt_read(struct knote *kn, long hint);
static int fuse_device_filt_write(struct knote *kn, long hint);
static void fuse_device_filt_detach(struct knote *kn);
struct filterops fuse_device_rfiltops = {
static const struct filterops fuse_device_rfiltops = {
.f_isfd = 1,
.f_detach = fuse_device_filt_detach,
.f_event = fuse_device_filt_read,
};
struct filterops fuse_device_wfiltops = {
static const struct filterops fuse_device_wfiltops = {
.f_isfd = 1,
.f_event = fuse_device_filt_write,
};

View file

@ -79,7 +79,7 @@ static d_kqfilter_t g_dev_kqfilter;
static void gdev_filter_detach(struct knote *kn);
static int gdev_filter_vnode(struct knote *kn, long hint);
static struct filterops gdev_filterops_vnode = {
static const struct filterops gdev_filterops_vnode = {
.f_isfd = 1,
.f_detach = gdev_filter_detach,
.f_event = gdev_filter_vnode,

View file

@ -2861,7 +2861,8 @@ closef_nothread(struct file *fp)
* called with bad data.
*/
void
finit(struct file *fp, u_int flag, short type, void *data, struct fileops *ops)
finit(struct file *fp, u_int flag, short type, void *data,
const struct fileops *ops)
{
fp->f_data = data;
fp->f_flag = flag;
@ -2870,7 +2871,7 @@ finit(struct file *fp, u_int flag, short type, void *data, struct fileops *ops)
}
void
finit_vnode(struct file *fp, u_int flag, void *data, struct fileops *ops)
finit_vnode(struct file *fp, u_int flag, void *data, const struct fileops *ops)
{
fp->f_seqcount[UIO_READ] = 1;
fp->f_seqcount[UIO_WRITE] = 1;
@ -5267,7 +5268,7 @@ badfo_fill_kinfo(struct file *fp, struct kinfo_file *kif, struct filedesc *fdp)
return (0);
}
struct fileops badfileops = {
const struct fileops badfileops = {
.fo_read = badfo_readwrite,
.fo_write = badfo_readwrite,
.fo_truncate = badfo_truncate,
@ -5298,7 +5299,7 @@ path_close(struct file *fp, struct thread *td)
return (0);
}
struct fileops path_fileops = {
const struct fileops path_fileops = {
.fo_read = badfo_readwrite,
.fo_write = badfo_readwrite,
.fo_truncate = badfo_truncate,

View file

@ -126,7 +126,7 @@ static struct cdevsw dev_cdevsw = {
static void filt_devctl_detach(struct knote *kn);
static int filt_devctl_read(struct knote *kn, long hint);
static struct filterops devctl_rfiltops = {
static const struct filterops devctl_rfiltops = {
.f_isfd = 1,
.f_detach = filt_devctl_detach,
.f_event = filt_devctl_read,

View file

@ -127,7 +127,7 @@ static fo_stat_t kqueue_stat;
static fo_close_t kqueue_close;
static fo_fill_kinfo_t kqueue_fill_kinfo;
static struct fileops kqueueops = {
static const struct fileops kqueueops = {
.fo_read = invfo_rdwr,
.fo_write = invfo_rdwr,
.fo_truncate = invfo_truncate,
@ -173,30 +173,30 @@ static int filt_user(struct knote *kn, long hint);
static void filt_usertouch(struct knote *kn, struct kevent *kev,
u_long type);
static struct filterops file_filtops = {
static const struct filterops file_filtops = {
.f_isfd = 1,
.f_attach = filt_fileattach,
};
static struct filterops kqread_filtops = {
static const struct filterops kqread_filtops = {
.f_isfd = 1,
.f_detach = filt_kqdetach,
.f_event = filt_kqueue,
};
/* XXX - move to kern_proc.c? */
static struct filterops proc_filtops = {
static const struct filterops proc_filtops = {
.f_isfd = 0,
.f_attach = filt_procattach,
.f_detach = filt_procdetach,
.f_event = filt_proc,
};
static struct filterops timer_filtops = {
static const struct filterops timer_filtops = {
.f_isfd = 0,
.f_attach = filt_timerattach,
.f_detach = filt_timerdetach,
.f_event = filt_timer,
.f_touch = filt_timertouch,
};
static struct filterops user_filtops = {
static const struct filterops user_filtops = {
.f_attach = filt_userattach,
.f_detach = filt_userdetach,
.f_event = filt_user,
@ -327,14 +327,14 @@ filt_nullattach(struct knote *kn)
return (ENXIO);
};
struct filterops null_filtops = {
static const struct filterops null_filtops = {
.f_isfd = 0,
.f_attach = filt_nullattach,
};
/* XXX - make SYSINIT to add these, and move into respective modules. */
extern struct filterops sig_filtops;
extern struct filterops fs_filtops;
extern const struct filterops sig_filtops;
extern const struct filterops fs_filtops;
/*
* Table for all system-defined filters.

View file

@ -119,7 +119,7 @@ static void sigqueue_start(void);
static void sigfastblock_setpend(struct thread *td, bool resched);
static uma_zone_t ksiginfo_zone = NULL;
struct filterops sig_filtops = {
const struct filterops sig_filtops = {
.f_isfd = 0,
.f_attach = filt_sigattach,
.f_detach = filt_sigdetach,

View file

@ -77,7 +77,7 @@ static struct cdevsw log_cdevsw = {
static int logkqread(struct knote *note, long hint);
static void logkqdetach(struct knote *note);
static struct filterops log_read_filterops = {
static const struct filterops log_read_filterops = {
.f_isfd = 1,
.f_attach = NULL,
.f_detach = logkqdetach,

View file

@ -64,7 +64,7 @@ static fo_stat_t eventfd_stat;
static fo_close_t eventfd_close;
static fo_fill_kinfo_t eventfd_fill_kinfo;
static struct fileops eventfdops = {
static const struct fileops eventfdops = {
.fo_read = eventfd_read,
.fo_write = eventfd_write,
.fo_truncate = invfo_truncate,
@ -85,13 +85,13 @@ static void filt_eventfddetach(struct knote *kn);
static int filt_eventfdread(struct knote *kn, long hint);
static int filt_eventfdwrite(struct knote *kn, long hint);
static struct filterops eventfd_rfiltops = {
static const struct filterops eventfd_rfiltops = {
.f_isfd = 1,
.f_detach = filt_eventfddetach,
.f_event = filt_eventfdread
};
static struct filterops eventfd_wfiltops = {
static const struct filterops eventfd_wfiltops = {
.f_isfd = 1,
.f_detach = filt_eventfddetach,
.f_event = filt_eventfdwrite

View file

@ -154,7 +154,7 @@ static fo_chmod_t pipe_chmod;
static fo_chown_t pipe_chown;
static fo_fill_kinfo_t pipe_fill_kinfo;
struct fileops pipeops = {
const struct fileops pipeops = {
.fo_read = pipe_read,
.fo_write = pipe_write,
.fo_truncate = pipe_truncate,
@ -177,17 +177,17 @@ static int filt_pipenotsup(struct knote *kn, long hint);
static int filt_piperead(struct knote *kn, long hint);
static int filt_pipewrite(struct knote *kn, long hint);
static struct filterops pipe_nfiltops = {
static const struct filterops pipe_nfiltops = {
.f_isfd = 1,
.f_detach = filt_pipedetach_notsup,
.f_event = filt_pipenotsup
};
static struct filterops pipe_rfiltops = {
static const struct filterops pipe_rfiltops = {
.f_isfd = 1,
.f_detach = filt_pipedetach,
.f_event = filt_piperead
};
static struct filterops pipe_wfiltops = {
static const struct filterops pipe_wfiltops = {
.f_isfd = 1,
.f_detach = filt_pipedetach,
.f_event = filt_pipewrite

View file

@ -99,7 +99,7 @@ static fo_close_t procdesc_close;
static fo_fill_kinfo_t procdesc_fill_kinfo;
static fo_cmp_t procdesc_cmp;
static struct fileops procdesc_ops = {
static const struct fileops procdesc_ops = {
.fo_read = invfo_rdwr,
.fo_write = invfo_rdwr,
.fo_truncate = invfo_truncate,
@ -484,7 +484,7 @@ procdesc_kqops_event(struct knote *kn, long hint)
return (kn->kn_fflags != 0);
}
static struct filterops procdesc_kqops = {
static const struct filterops procdesc_kqops = {
.f_isfd = 1,
.f_detach = procdesc_kqops_detach,
.f_event = procdesc_kqops_event,

View file

@ -98,7 +98,7 @@ static fo_aio_queue_t soo_aio_queue;
static void soo_aio_cancel(struct kaiocb *job);
struct fileops socketops = {
const struct fileops socketops = {
.fo_read = soo_read,
.fo_write = soo_write,
.fo_truncate = invfo_truncate,

View file

@ -284,7 +284,7 @@ filt_timerfdread(struct knote *kn, long hint)
return (tfd->tfd_count > 0);
}
static struct filterops timerfd_rfiltops = {
static const struct filterops timerfd_rfiltops = {
.f_isfd = 1,
.f_detach = filt_timerfddetach,
.f_event = filt_timerfdread,
@ -359,7 +359,7 @@ timerfd_fill_kinfo(struct file *fp, struct kinfo_file *kif,
return (0);
}
static struct fileops timerfdops = {
static const struct fileops timerfdops = {
.fo_read = timerfd_read,
.fo_write = invfo_rdwr,
.fo_truncate = invfo_truncate,

View file

@ -751,13 +751,13 @@ tty_kqops_write_event(struct knote *kn, long hint __unused)
}
}
static struct filterops tty_kqops_read = {
static const struct filterops tty_kqops_read = {
.f_isfd = 1,
.f_detach = tty_kqops_read_detach,
.f_event = tty_kqops_read_event,
};
static struct filterops tty_kqops_write = {
static const struct filterops tty_kqops_write = {
.f_isfd = 1,
.f_detach = tty_kqops_write_detach,
.f_event = tty_kqops_write_event,

View file

@ -488,12 +488,12 @@ pts_kqops_write_event(struct knote *kn, long hint)
}
}
static struct filterops pts_kqops_read = {
static const struct filterops pts_kqops_read = {
.f_isfd = 1,
.f_detach = pts_kqops_read_detach,
.f_event = pts_kqops_read_event,
};
static struct filterops pts_kqops_write = {
static const struct filterops pts_kqops_write = {
.f_isfd = 1,
.f_detach = pts_kqops_write_detach,
.f_event = pts_kqops_write_event,
@ -597,7 +597,7 @@ ptsdev_fill_kinfo(struct file *fp, struct kinfo_file *kif, struct filedesc *fdp)
return (0);
}
static struct fileops ptsdev_ops = {
static const struct fileops ptsdev_ops = {
.fo_read = ptsdev_read,
.fo_write = ptsdev_write,
.fo_truncate = invfo_truncate,

View file

@ -226,7 +226,7 @@ static uma_zone_t mqueue_zone;
static uma_zone_t mvdata_zone;
static uma_zone_t mqnoti_zone;
static struct vop_vector mqfs_vnodeops;
static struct fileops mqueueops;
static const struct fileops mqueueops;
static unsigned mqfs_osd_jail_slot;
/*
@ -273,12 +273,12 @@ static void filt_mqdetach(struct knote *kn);
static int filt_mqread(struct knote *kn, long hint);
static int filt_mqwrite(struct knote *kn, long hint);
struct filterops mq_rfiltops = {
static const struct filterops mq_rfiltops = {
.f_isfd = 1,
.f_detach = filt_mqdetach,
.f_event = filt_mqread,
};
struct filterops mq_wfiltops = {
static const struct filterops mq_wfiltops = {
.f_isfd = 1,
.f_detach = filt_mqdetach,
.f_event = filt_mqwrite,
@ -2648,7 +2648,7 @@ mqf_fill_kinfo(struct file *fp, struct kinfo_file *kif, struct filedesc *fdp)
return (0);
}
static struct fileops mqueueops = {
static const struct fileops mqueueops = {
.fo_read = invfo_rdwr,
.fo_write = invfo_rdwr,
.fo_truncate = invfo_truncate,

View file

@ -140,7 +140,7 @@ static fo_chown_t ksem_chown;
static fo_fill_kinfo_t ksem_fill_kinfo;
/* File descriptor operations. */
static struct fileops ksem_ops = {
static const struct fileops ksem_ops = {
.fo_read = invfo_rdwr,
.fo_write = invfo_rdwr,
.fo_truncate = invfo_truncate,

View file

@ -150,7 +150,7 @@ static fo_fallocate_t shm_fallocate;
static fo_fspacectl_t shm_fspacectl;
/* File descriptor operations. */
struct fileops shm_ops = {
const struct fileops shm_ops = {
.fo_read = shm_read,
.fo_write = shm_write,
.fo_truncate = shm_truncate,

View file

@ -191,17 +191,17 @@ static int filt_soempty(struct knote *kn, long hint);
static int inline hhook_run_socket(struct socket *so, void *hctx, int32_t h_id);
fo_kqfilter_t soo_kqfilter;
static struct filterops soread_filtops = {
static const struct filterops soread_filtops = {
.f_isfd = 1,
.f_detach = filt_sordetach,
.f_event = filt_soread,
};
static struct filterops sowrite_filtops = {
static const struct filterops sowrite_filtops = {
.f_isfd = 1,
.f_detach = filt_sowdetach,
.f_event = filt_sowrite,
};
static struct filterops soempty_filtops = {
static const struct filterops soempty_filtops = {
.f_isfd = 1,
.f_detach = filt_sowdetach,
.f_event = filt_soempty,

View file

@ -347,13 +347,13 @@ static int filt_lio(struct knote *kn, long hint);
static uma_zone_t kaio_zone, aiocb_zone, aiolio_zone;
/* kqueue filters for aio */
static struct filterops aio_filtops = {
static const struct filterops aio_filtops = {
.f_isfd = 0,
.f_attach = filt_aioattach,
.f_detach = filt_aiodetach,
.f_event = filt_aio,
};
static struct filterops lio_filtops = {
static const struct filterops lio_filtops = {
.f_isfd = 0,
.f_attach = filt_lioattach,
.f_detach = filt_liodetach,

View file

@ -6409,7 +6409,7 @@ static int filt_fsattach(struct knote *kn);
static void filt_fsdetach(struct knote *kn);
static int filt_fsevent(struct knote *kn, long hint);
struct filterops fs_filtops = {
const struct filterops fs_filtops = {
.f_isfd = 0,
.f_attach = filt_fsattach,
.f_detach = filt_fsdetach,
@ -6489,17 +6489,17 @@ static int filt_vfsread(struct knote *kn, long hint);
static int filt_vfswrite(struct knote *kn, long hint);
static int filt_vfsvnode(struct knote *kn, long hint);
static void filt_vfsdetach(struct knote *kn);
static struct filterops vfsread_filtops = {
static const struct filterops vfsread_filtops = {
.f_isfd = 1,
.f_detach = filt_vfsdetach,
.f_event = filt_vfsread
};
static struct filterops vfswrite_filtops = {
static const struct filterops vfswrite_filtops = {
.f_isfd = 1,
.f_detach = filt_vfsdetach,
.f_event = filt_vfswrite
};
static struct filterops vfsvnode_filtops = {
static const struct filterops vfsvnode_filtops = {
.f_isfd = 1,
.f_detach = filt_vfsdetach,
.f_event = filt_vfsvnode

View file

@ -108,7 +108,7 @@ static fo_mmap_t vn_mmap;
static fo_fallocate_t vn_fallocate;
static fo_fspacectl_t vn_fspacectl;
struct fileops vnops = {
const struct fileops vnops = {
.fo_read = vn_io_fault,
.fo_write = vn_io_fault,
.fo_truncate = vn_truncate,

View file

@ -251,13 +251,13 @@ static struct cdevsw bpf_cdevsw = {
.d_kqfilter = bpfkqfilter,
};
static struct filterops bpfread_filtops = {
static const struct filterops bpfread_filtops = {
.f_isfd = 1,
.f_detach = filt_bpfdetach,
.f_event = filt_bpfread,
};
static struct filterops bpfwrite_filtops = {
static const struct filterops bpfwrite_filtops = {
.f_isfd = 1,
.f_detach = filt_bpfdetach,
.f_event = filt_bpfwrite,

View file

@ -253,14 +253,14 @@ static int tunkqread(struct knote *, long);
static int tunkqwrite(struct knote *, long);
static void tunkqdetach(struct knote *);
static struct filterops tun_read_filterops = {
static const struct filterops tun_read_filterops = {
.f_isfd = 1,
.f_attach = NULL,
.f_detach = tunkqdetach,
.f_event = tunkqread,
};
static struct filterops tun_write_filterops = {
static const struct filterops tun_write_filterops = {
.f_isfd = 1,
.f_attach = NULL,
.f_detach = tunkqdetach,

View file

@ -239,7 +239,7 @@ static struct cdevsw audit_pipe_cdevsw = {
static int audit_pipe_kqread(struct knote *note, long hint);
static void audit_pipe_kqdetach(struct knote *note);
static struct filterops audit_pipe_read_filterops = {
static const struct filterops audit_pipe_read_filterops = {
.f_isfd = 1,
.f_attach = NULL,
.f_detach = audit_pipe_kqdetach,

View file

@ -248,10 +248,10 @@ struct xfile {
#ifdef _KERNEL
extern struct fileops vnops;
extern struct fileops badfileops;
extern struct fileops path_fileops;
extern struct fileops socketops;
extern const struct fileops vnops;
extern const struct fileops badfileops;
extern const struct fileops path_fileops;
extern const struct fileops socketops;
extern int maxfiles; /* kernel limit on number of open files */
extern int maxfilesperproc; /* per process limit on number of open files */
@ -283,8 +283,8 @@ fo_kqfilter_t vn_kqfilter_opath;
int vn_fill_kinfo_vnode(struct vnode *vp, struct kinfo_file *kif);
int file_kcmp_generic(struct file *fp1, struct file *fp2, struct thread *td);
void finit(struct file *, u_int, short, void *, struct fileops *);
void finit_vnode(struct file *, u_int, void *, struct fileops *);
void finit(struct file *, u_int, short, void *, const struct fileops *);
void finit_vnode(struct file *, u_int, void *, const struct fileops *);
int fgetvp(struct thread *td, int fd, cap_rights_t *rightsp,
struct vnode **vpp);
int fgetvp_exec(struct thread *td, int fd, cap_rights_t *rightsp,

View file

@ -312,7 +312,7 @@ bool shm_largepage(struct shmfd *shmfd);
void shm_remove_prison(struct prison *pr);
int shm_get_path(struct vm_object *obj, char *path, size_t sz);
extern struct fileops shm_ops;
extern const struct fileops shm_ops;
#define MAP_32BIT_MAX_ADDR ((vm_offset_t)1 << 31)

View file

@ -52,7 +52,7 @@
* See sys_pipe.c for info on what these limits mean.
*/
extern long maxpipekva;
extern struct fileops pipeops;
extern const struct fileops pipeops;
#endif
/*

View file

@ -61,7 +61,7 @@ static d_poll_t apmpoll;
static d_kqfilter_t apmkqfilter;
static void apmreadfiltdetach(struct knote *kn);
static int apmreadfilt(struct knote *kn, long hint);
static struct filterops apm_readfiltops = {
static const struct filterops apm_readfiltops = {
.f_isfd = 1,
.f_detach = apmreadfiltdetach,
.f_event = apmreadfilt,