Commit 6e3eb5ba authored by Lennart Poettering's avatar Lennart Poettering
Browse files

readahead: put limit on files we read ahead

parent 746f8906
...@@ -255,6 +255,9 @@ static int collect(const char *root) { ...@@ -255,6 +255,9 @@ static int collect(const char *root) {
ssize_t n; ssize_t n;
struct fanotify_event_metadata *m; struct fanotify_event_metadata *m;
if (hashmap_size(files) > READAHEAD_FILES_MAX)
break;
if (poll(pollfd, _FD_MAX, -1) < 0) { if (poll(pollfd, _FD_MAX, -1) < 0) {
if (errno == EINTR) if (errno == EINTR)
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#define READAHEAD_FILE_SIZE_MAX (128*1024*1024) #define READAHEAD_FILE_SIZE_MAX (128*1024*1024)
#define READAHEAD_FILES_MAX (16*1024)
int file_verify(int fd, const char *fn, struct stat *st); int file_verify(int fd, const char *fn, struct stat *st);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment