summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhelg <helg@openbsd.org>2018-06-25 12:03:53 +0000
committerhelg <helg@openbsd.org>2018-06-25 12:03:53 +0000
commitb7e69da42c1ff65d81db2cc60ba6ad384fdd6dc2 (patch)
tree424e473346e84938004e29c447987490542eb1d4
parentAssert that the NET_LOCK() is held when iterating over `ipsec_acquire_head'. (diff)
downloadwireguard-openbsd-b7e69da42c1ff65d81db2cc60ba6ad384fdd6dc2.tar.xz
wireguard-openbsd-b7e69da42c1ff65d81db2cc60ba6ad384fdd6dc2.zip
Remove unused fbuf parameter from fuse_device_cleanup().
ok mpi@
-rw-r--r--sys/miscfs/fuse/fuse_device.c54
-rw-r--r--sys/miscfs/fuse/fuse_vfsops.c4
-rw-r--r--sys/miscfs/fuse/fusefs.h4
3 files changed, 28 insertions, 34 deletions
diff --git a/sys/miscfs/fuse/fuse_device.c b/sys/miscfs/fuse/fuse_device.c
index 85ced5d01e7..b1d073276db 100644
--- a/sys/miscfs/fuse/fuse_device.c
+++ b/sys/miscfs/fuse/fuse_device.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fuse_device.c,v 1.27 2018/06/21 14:53:36 helg Exp $ */
+/* $OpenBSD: fuse_device.c,v 1.28 2018/06/25 12:03:53 helg Exp $ */
/*
* Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
@@ -161,11 +161,10 @@ fuse_destroy(dev_t dev, struct fuse_d *fd)
}
/*
- * if fbuf == NULL cleanup all msgs else remove fbuf from
- * sc_fbufs_in and sc_fbufs_wait.
+ * Cleanup all msgs from sc_fbufs_in and sc_fbufs_wait.
*/
void
-fuse_device_cleanup(dev_t dev, struct fusebuf *fbuf)
+fuse_device_cleanup(dev_t dev)
{
struct fuse_d *fd;
struct fusebuf *f, *ftmp, *lprev;
@@ -177,37 +176,32 @@ fuse_device_cleanup(dev_t dev, struct fusebuf *fbuf)
/* clear FIFO IN*/
lprev = NULL;
SIMPLEQ_FOREACH_SAFE(f, &fd->fd_fbufs_in, fb_next, ftmp) {
- if (fbuf == f || fbuf == NULL) {
- DPRINTF("cleanup unprocessed msg in sc_fbufs_in\n");
- if (lprev == NULL)
- SIMPLEQ_REMOVE_HEAD(&fd->fd_fbufs_in, fb_next);
- else
- SIMPLEQ_REMOVE_AFTER(&fd->fd_fbufs_in, lprev,
- fb_next);
-
- stat_fbufs_in--;
- f->fb_err = ENXIO;
- wakeup(f);
- }
+ DPRINTF("cleanup unprocessed msg in sc_fbufs_in\n");
+ if (lprev == NULL)
+ SIMPLEQ_REMOVE_HEAD(&fd->fd_fbufs_in, fb_next);
+ else
+ SIMPLEQ_REMOVE_AFTER(&fd->fd_fbufs_in, lprev,
+ fb_next);
+
+ stat_fbufs_in--;
+ f->fb_err = ENXIO;
+ wakeup(f);
lprev = f;
}
/* clear FIFO WAIT*/
lprev = NULL;
SIMPLEQ_FOREACH_SAFE(f, &fd->fd_fbufs_wait, fb_next, ftmp) {
- if (fbuf == f || fbuf == NULL) {
- DPRINTF("umount unprocessed msg in sc_fbufs_wait\n");
- if (lprev == NULL)
- SIMPLEQ_REMOVE_HEAD(&fd->fd_fbufs_wait,
- fb_next);
- else
- SIMPLEQ_REMOVE_AFTER(&fd->fd_fbufs_wait, lprev,
- fb_next);
-
- stat_fbufs_wait--;
- f->fb_err = ENXIO;
- wakeup(f);
- }
+ DPRINTF("umount unprocessed msg in sc_fbufs_wait\n");
+ if (lprev == NULL)
+ SIMPLEQ_REMOVE_HEAD(&fd->fd_fbufs_wait, fb_next);
+ else
+ SIMPLEQ_REMOVE_AFTER(&fd->fd_fbufs_wait, lprev,
+ fb_next);
+
+ stat_fbufs_wait--;
+ f->fb_err = ENXIO;
+ wakeup(f);
lprev = f;
}
}
@@ -272,7 +266,7 @@ fuseclose(dev_t dev, int flags, int fmt, struct proc *p)
if (fd->fd_fmp) {
printf("fuse: device close without umount\n");
fd->fd_fmp->sess_init = 0;
- fuse_device_cleanup(dev, NULL);
+ fuse_device_cleanup(dev);
if ((vfs_busy(fd->fd_fmp->mp, VB_WRITE|VB_NOWAIT)) != 0)
goto end;
error = dounmount(fd->fd_fmp->mp, MNT_FORCE, curproc);
diff --git a/sys/miscfs/fuse/fuse_vfsops.c b/sys/miscfs/fuse/fuse_vfsops.c
index 2b9db65077b..486c50476ed 100644
--- a/sys/miscfs/fuse/fuse_vfsops.c
+++ b/sys/miscfs/fuse/fuse_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fuse_vfsops.c,v 1.38 2018/06/19 13:01:34 helg Exp $ */
+/* $OpenBSD: fuse_vfsops.c,v 1.39 2018/06/25 12:03:53 helg Exp $ */
/*
* Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
@@ -168,7 +168,7 @@ fusefs_unmount(struct mount *mp, int mntflags, struct proc *p)
fb_delete(fbuf);
}
- fuse_device_cleanup(fmp->dev, NULL);
+ fuse_device_cleanup(fmp->dev);
fuse_device_set_fmp(fmp, 0);
free(fmp, M_FUSEFS, sizeof(*fmp));
mp->mnt_data = NULL;
diff --git a/sys/miscfs/fuse/fusefs.h b/sys/miscfs/fuse/fusefs.h
index ef57d837955..c0b3fb89126 100644
--- a/sys/miscfs/fuse/fusefs.h
+++ b/sys/miscfs/fuse/fusefs.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: fusefs.h,v 1.11 2018/06/21 14:53:36 helg Exp $ */
+/* $OpenBSD: fusefs.h,v 1.12 2018/06/25 12:03:53 helg Exp $ */
/*
* Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
@@ -79,7 +79,7 @@ int fusefs_file_close(struct fusefs_mnt *, struct fusefs_node *,
enum fufh_type, int, int, struct proc *);
/* device helpers. */
-void fuse_device_cleanup(dev_t, struct fusebuf *);
+void fuse_device_cleanup(dev_t);
void fuse_device_queue_fbuf(dev_t, struct fusebuf *);
void fuse_device_set_fmp(struct fusefs_mnt *, int);