-/* $OpenBSD: init_main.c,v 1.279 2018/07/20 21:57:26 deraadt Exp $ */
+/* $OpenBSD: init_main.c,v 1.280 2018/08/13 15:26:17 visa Exp $ */
/* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */
/*
int main(void *);
void check_console(struct proc *);
void start_init(void *);
-void start_cleaner(void *);
-void start_update(void *);
-void start_reaper(void *);
void crypto_init(void);
void db_ctf_init(void);
void prof_init(void);
panic("fork pagedaemon");
/* Create the reaper daemon kernel thread. */
- if (kthread_create(start_reaper, NULL, &reaperproc, "reaper"))
+ if (kthread_create(reaper, NULL, &reaperproc, "reaper"))
panic("fork reaper");
/* Create the cleaner daemon kernel thread. */
- if (kthread_create(start_cleaner, NULL, NULL, "cleaner"))
+ if (kthread_create(buf_daemon, NULL, &cleanerproc, "cleaner"))
panic("fork cleaner");
/* Create the update daemon kernel thread. */
- if (kthread_create(start_update, NULL, NULL, "update"))
+ if (kthread_create(syncer_thread, NULL, &syncerproc, "update"))
panic("fork update");
/* Create the aiodone daemon kernel thread. */
printf("init: not found\n");
panic("no init");
}
-
-void
-start_update(void *arg)
-{
- sched_sync(curproc);
- /* NOTREACHED */
-}
-
-void
-start_cleaner(void *arg)
-{
- buf_daemon(curproc);
- /* NOTREACHED */
-}
-
-void
-start_reaper(void *arg)
-{
- reaper();
- /* NOTREACHED */
-}
-/* $OpenBSD: kern_exit.c,v 1.165 2018/07/13 09:25:23 beck Exp $ */
+/* $OpenBSD: kern_exit.c,v 1.166 2018/08/13 15:26:17 visa Exp $ */
/* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */
/*
* a zombie, and the parent is allowed to read the undead's status.
*/
void
-reaper(void)
+reaper(void *arg)
{
struct proc *p;
-/* $OpenBSD: vfs_bio.c,v 1.185 2017/08/27 01:59:30 beck Exp $ */
+/* $OpenBSD: vfs_bio.c,v 1.186 2018/08/13 15:26:17 visa Exp $ */
/* $NetBSD: vfs_bio.c,v 1.44 1996/06/11 11:15:36 pk Exp $ */
/*
* Buffer cleaning daemon.
*/
void
-buf_daemon(struct proc *p)
+buf_daemon(void *arg)
{
struct buf *bp = NULL;
int s, pushed = 0;
- cleanerproc = curproc;
-
s = splbio();
for (;;) {
if (bp == NULL || (pushed >= 16 &&
-/* $OpenBSD: vfs_sync.c,v 1.59 2018/05/27 06:02:14 visa Exp $ */
+/* $OpenBSD: vfs_sync.c,v 1.60 2018/08/13 15:26:17 visa Exp $ */
/*
* Portions of this code are:
* System filesystem synchronizer daemon.
*/
void
-sched_sync(struct proc *p)
+syncer_thread(void *arg)
{
+ struct proc *p = curproc;
struct synclist *slp;
struct vnode *vp;
time_t starttime;
int s;
- syncerproc = curproc;
-
for (;;) {
starttime = time_second;
if (vp->v_mount != NULL)
printf("mounted on: %s\n",
vp->v_mount->mnt_stat.f_mntonname);
- panic("sched_sync: fsync failed");
+ panic("%s: fsync failed", __func__);
}
#endif /* DIAGNOSTIC */
/*
-/* $OpenBSD: buf.h,v 1.106 2017/04/16 14:25:42 beck Exp $ */
+/* $OpenBSD: buf.h,v 1.107 2018/08/13 15:26:17 visa Exp $ */
/* $NetBSD: buf.h,v 1.25 1997/04/09 21:12:17 mycroft Exp $ */
/*
void bgetvp(struct vnode *, struct buf *);
void buf_replacevnode(struct buf *, struct vnode *);
-void buf_daemon(struct proc *);
+void buf_daemon(void *);
void buf_replacevnode(struct buf *, struct vnode *);
int bread_cluster(struct vnode *, daddr_t, int, struct buf **);
-/* $OpenBSD: proc.h,v 1.255 2018/08/05 14:23:57 beck Exp $ */
+/* $OpenBSD: proc.h,v 1.256 2018/08/13 15:26:17 visa Exp $ */
/* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */
/*-
void setrunnable(struct proc *);
void endtsleep(void *);
void unsleep(struct proc *);
-void reaper(void);
+void reaper(void *);
void exit1(struct proc *, int, int);
void exit2(struct proc *);
int dowait4(struct proc *, pid_t, int *, int, struct rusage *,
-/* $OpenBSD: vnode.h,v 1.147 2018/07/13 09:25:23 beck Exp $ */
+/* $OpenBSD: vnode.h,v 1.148 2018/08/13 15:26:17 visa Exp $ */
/* $NetBSD: vnode.h,v 1.38 1996/02/29 20:59:05 cgd Exp $ */
/*
void vn_marktext(struct vnode *);
/* vfs_sync.c */
-void sched_sync(struct proc *);
+void syncer_thread(void *);
void vn_initialize_syncerd(void);
void vn_syncer_add_to_worklist(struct vnode *, int);