svn commit: r349136 - projects/fuse2/tests/sys/fs/fusefs

Alan Somers asomers at FreeBSD.org
Mon Jun 17 14:42:28 UTC 2019


Author: asomers
Date: Mon Jun 17 14:42:27 2019
New Revision: 349136
URL: https://svnweb.freebsd.org/changeset/base/349136

Log:
  fusefs: rename the ReadCacheable.default_readahead test
  
  The test didn't actually have anything to do with readahead.  Rename it to
  "ReadCacheable.cache_block"
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  projects/fuse2/tests/sys/fs/fusefs/read.cc

Modified: projects/fuse2/tests/sys/fs/fusefs/read.cc
==============================================================================
--- projects/fuse2/tests/sys/fs/fusefs/read.cc	Mon Jun 17 11:46:37 2019	(r349135)
+++ projects/fuse2/tests/sys/fs/fusefs/read.cc	Mon Jun 17 14:42:27 2019	(r349136)
@@ -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);


More information about the svn-src-projects mailing list