1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
6 This file is part of systemd.
8 Copyright 2010 Lennart Poettering
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
25 #include <sys/types.h>
30 #define READAHEAD_FILE_SIZE_MAX (10*1024*1024)
32 #define READAHEAD_PACK_FILE_VERSION ";VERSION=2\n"
34 extern unsigned arg_files_max;
35 extern off_t arg_file_size_max;
36 extern usec_t arg_timeout;
38 int file_verify(int fd, const char *fn, off_t file_size_max, struct stat *st);
40 int fs_on_ssd(const char *p);
41 int fs_on_read_only(const char *p);
43 bool enough_ram(void);
45 int open_inotify(void);
47 typedef struct ReadaheadShared {
50 } _packed_ ReadaheadShared;
52 ReadaheadShared *shared_get(void);
54 int block_bump_request_nr(const char *p);
56 int block_get_readahead(const char *p, uint64_t *bytes);
57 int block_set_readahead(const char *p, uint64_t bytes);
59 int main_collect(const char *root);
60 int main_replay(const char *root);
61 int main_analyze(const char *pack_path);