aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Somers <asomers@FreeBSD.org>2019-06-17 14:42:27 +0000
committerAlan Somers <asomers@FreeBSD.org>2019-06-17 14:42:27 +0000
commiteadd12d35d89e35abc6179f0c6417260686ac033 (patch)
tree478f68ecb279774cc018c03a15464ecacef9a2ea
parentb5aaf286eabead9f764595b989d9f3d04e0a4847 (diff)
Notes
-rw-r--r--tests/sys/fs/fusefs/read.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/sys/fs/fusefs/read.cc b/tests/sys/fs/fusefs/read.cc
index 81730ed719d11..e986c1310144e 100644
--- a/tests/sys/fs/fusefs/read.cc
+++ b/tests/sys/fs/fusefs/read.cc
@@ -628,8 +628,11 @@ TEST_F(Read_7_8, read)
/* Deliberately leak fd. close(2) will be tested in release.cc */
}
-/* If the filesystem allows it, the kernel should try to readahead */
-TEST_F(ReadCacheable, default_readahead)
+/*
+ * If cacheing is enabled, the kernel should try to read an entire cache block
+ * at a time.
+ */
+TEST_F(ReadCacheable, cache_block)
{
const char FULLPATH[] = "mountpoint/some_file.txt";
const char RELPATH[] = "some_file.txt";
@@ -637,9 +640,7 @@ TEST_F(ReadCacheable, default_readahead)
uint64_t ino = 42;
int fd;
ssize_t bufsize = 8;
- /* hard-coded in fuse_internal.c */
- size_t default_maxreadahead = 65536;
- ssize_t filesize = default_maxreadahead * 2;
+ ssize_t filesize = m_maxbcachebuf * 2;
char *contents;
char buf[bufsize];
const char *contents1 = CONTENTS0 + bufsize;
@@ -650,7 +651,7 @@ TEST_F(ReadCacheable, default_readahead)
expect_lookup(RELPATH, ino, filesize);
expect_open(ino, 0, 1);
- expect_read(ino, 0, default_maxreadahead, default_maxreadahead,
+ expect_read(ino, 0, m_maxbcachebuf, m_maxbcachebuf,
contents);
fd = open(FULLPATH, O_RDONLY);