readahead: put limit on files we read ahead

This commit is contained in:
Lennart Poettering 2010-09-23 17:35:16 +02:00
parent 746f890636
commit 6e3eb5ba18
2 changed files with 4 additions and 0 deletions

View File

@ -255,6 +255,9 @@ static int collect(const char *root) {
ssize_t n;
struct fanotify_event_metadata *m;
if (hashmap_size(files) > READAHEAD_FILES_MAX)
break;
if (poll(pollfd, _FD_MAX, -1) < 0) {
if (errno == EINTR)

View File

@ -25,6 +25,7 @@
#include <sys/stat.h>
#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);