mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-11-20 15:06:33 -05:00
Cap getdents64 requests at 128 KiB for virtiofs compatibility
This commit is contained in:
parent
bdfbedad8b
commit
2513d3c067
2 changed files with 9 additions and 1 deletions
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
#include "to_neg_errno.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <sys/types.h>
|
||||
|
||||
#if defined __linux__
|
||||
|
|
@ -36,7 +37,10 @@ namespace fs
|
|||
#if defined SYS_getdents64
|
||||
ssize_t rv;
|
||||
|
||||
rv = ::syscall(SYS_getdents64,fd_,dirp_,count_);
|
||||
// Avoid oversized requests on virtiofs-backed branches.
|
||||
const size_t count = std::min<size_t>(count_,128 * 1024);
|
||||
|
||||
rv = ::syscall(SYS_getdents64,fd_,dirp_,count);
|
||||
|
||||
return ::to_neg_errno(rv);
|
||||
#else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue