Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F166762821
D47356.id145737.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D47356.id145737.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D47356: tarfs: Add some sysctls to control readahead/behind
Attached
Detach File
Event Timeline
Log In to Comment