-/* $OpenBSD: fuse.c,v 1.23 2014/05/20 13:22:06 syl Exp $ */
+/* $OpenBSD: fuse.c,v 1.24 2014/05/20 13:32:22 syl Exp $ */
/*
* Copyright (c) 2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
}
fargs.fd = fc->fd;
+ fargs.max_read = max_read;
if (mount(MOUNT_FUSEFS, fc->dir, 0, &fargs)) {
switch (errno) {
case EMFILE:
-/* $OpenBSD: fuse_vfsops.c,v 1.8 2013/12/10 13:43:05 pelikan Exp $ */
+/* $OpenBSD: fuse_vfsops.c,v 1.9 2014/05/20 13:32:22 syl Exp $ */
/*
* Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
fmp->mp = mp;
fmp->sess_init = 0;
fmp->dev = vp->v_rdev;
- mp->mnt_data = fmp;
+ if (args.max_read > 0)
+ fmp->max_read = MIN(args.max_read, FUSEBUFMAXSIZE);
+ else
+ fmp->max_read = FUSEBUFMAXSIZE;
+ mp->mnt_data = fmp;
mp->mnt_flag |= MNT_LOCAL;
vfs_getnewfsid(mp);
-/* $OpenBSD: fuse_vnops.c,v 1.17 2014/05/19 13:55:29 syl Exp $ */
+/* $OpenBSD: fuse_vnops.c,v 1.18 2014/05/20 13:32:22 syl Exp $ */
/*
* Copyright (c) 2012-2013 Sylvestre Gallon <ccna.syl@gmail.com>
*
}
fbuf->fb_io_fd = ip->fufh[FUFH_RDONLY].fh_id;
fbuf->fb_io_off = uio->uio_offset;
- fbuf->fb_io_len = MIN(uio->uio_resid, FUSEBUFMAXSIZE);
+ fbuf->fb_io_len = MIN(uio->uio_resid, fmp->max_read);
error = fb_queue(fmp->dev, fbuf);
while (uio->uio_resid > 0) {
fbuf = fb_setup(0, ip->ufs_ino.i_number, FBT_READ, p);
- size = MIN(uio->uio_resid, FUSEBUFMAXSIZE);
+ size = MIN(uio->uio_resid, fmp->max_read);
fbuf->fb_io_fd = fusefs_fd_get(ip, FUFH_RDONLY);
fbuf->fb_io_off = uio->uio_offset;
fbuf->fb_io_len = size;
}
while (uio->uio_resid > 0) {
- len = MIN(uio->uio_resid, FUSEBUFMAXSIZE);
+ len = MIN(uio->uio_resid, fmp->max_read);
fbuf = fb_setup(len, ip->ufs_ino.i_number, FBT_WRITE, p);
fbuf->fb_io_fd = fusefs_fd_get(ip, FUFH_WRONLY);
-/* $OpenBSD: mount.h,v 1.118 2014/03/24 00:19:48 guenther Exp $ */
+/* $OpenBSD: mount.h,v 1.119 2014/05/20 13:32:22 syl Exp $ */
/* $NetBSD: mount.h,v 1.48 1996/02/18 11:55:47 fvdl Exp $ */
/*
*/
struct fusefs_args {
char *name;
- char *url;
int fd;
- int flags;
+ int max_read;
};
/*