Index: sys/fs/pseudofs/pseudofs_vnops.c =================================================================== --- sys/fs/pseudofs/pseudofs_vnops.c +++ sys/fs/pseudofs/pseudofs_vnops.c @@ -68,6 +68,26 @@ KASSERT((pn)->pn_type == pfstype_symlink, \ ("%s(): VLNK vnode refers to non-link pfs_node", __func__)) +static int pfs_bufsiz = MAXPHYS; + +static int +sysctl_pfs_bufsiz(SYSCTL_HANDLER_ARGS) +{ + int error, limit; + + limit = pfs_bufsiz; + error = sysctl_handle_int(oidp, &limit, 0, req); + if (error || !req->newptr) + return (error); + if (limit < 1 || limit > IOSIZE_MAX) + return (EINVAL); + pfs_bufsiz = limit; + return (0); +} +SYSCTL_PROC(_vfs_pfs, OID_AUTO, bufsiz, CTLTYPE_INT|CTLFLAG_RW, + 0, 0, sysctl_pfs_bufsiz, "I", + "storage buffer size"); + /* * Returns the fileno, adjusted for target pid */ @@ -663,8 +683,8 @@ goto ret; } buflen = uio->uio_offset + uio->uio_resid; - if (buflen > MAXPHYS) - buflen = MAXPHYS; + if (buflen > pfs_bufsiz) + buflen = pfs_bufsiz; sb = sbuf_new(sb, NULL, buflen + 1, 0); if (sb == NULL) {