Page MenuHomeFreeBSD

D47356.id145737.diff
No OneTemporary

D47356.id145737.diff

diff --git a/sys/fs/tarfs/tarfs_vnops.c b/sys/fs/tarfs/tarfs_vnops.c
--- a/sys/fs/tarfs/tarfs_vnops.c
+++ b/sys/fs/tarfs/tarfs_vnops.c
@@ -38,11 +38,19 @@
#include <sys/mount.h>
#include <sys/namei.h>
#include <sys/proc.h>
+#include <sys/sysctl.h>
#include <sys/vnode.h>
#include <fs/tarfs/tarfs.h>
#include <fs/tarfs/tarfs_dbg.h>
+static int bmap_readbehind = 1;
+SYSCTL_INT(_vfs_tarfs, OID_AUTO, bmap_readbehind, CTLFLAG_RWTUN,
+ &bmap_readbehind, 0, "Enable read-behind for block mapping operations");
+static int readahead_max = -1;
+SYSCTL_INT(_vfs_tarfs, OID_AUTO, readahead_max, CTLFLAG_RWTUN,
+ &readahead_max, 0, "Maximum read-ahead in blocks");
+
static int
tarfs_open(struct vop_open_args *ap)
{
@@ -173,9 +181,11 @@
}
rmax = vp->v_mount->mnt_iosize_max / iosize - 1;
+ if (readahead_max >= 0 && rmax > readahead_max)
+ rmax = readahead_max;
*ap->a_runp = imin(ra, rmax);
if (ap->a_runb != NULL)
- *ap->a_runb = imin(rb, rmax);
+ *ap->a_runb = bmap_readbehind ? imin(rb, rmax) : 0;
return (0);
}

File Metadata

Mime Type
text/plain
Expires
Mon, Aug 17, 7:47 AM (20 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36852131
Default Alt Text
D47356.id145737.diff (1 KB)

Event Timeline