readahead-common.c revision b925e72633bf98438f56a140520e07ec8c959e46
8f51399e75e5d0d0741ecb18c549a57840bd1cc3Harald Hoyer/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
8f51399e75e5d0d0741ecb18c549a57840bd1cc3Harald Hoyer This file is part of systemd.
8f51399e75e5d0d0741ecb18c549a57840bd1cc3Harald Hoyer Copyright 2010 Lennart Poettering
8f51399e75e5d0d0741ecb18c549a57840bd1cc3Harald Hoyer systemd is free software; you can redistribute it and/or modify it
along with systemd; If not, see <http://www.gnu.org/licenses/>.
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <libudev.h>
#include "log.h"
#include "readahead-common.h"
#include "util.h"
return -errno;
log_debug("Not preloading file %s with size out of bounds %llu", fn, (unsigned long long) st->st_size);
int fs_on_ssd(const char *p) {
assert(p);
return -errno;
return -ENOMEM;
goto finish;
if (!look_at)
goto finish;
goto finish;
goto finish;
goto finish;
if (udev_device)
if (udev)
int fs_on_read_only(const char *p) {
const char *read_only;
assert(p);
return -errno;
return -ENOMEM;
goto finish;
goto finish;
if (udev_device)
if (udev)
bool enough_ram(void) {
int open_inotify(void) {
int fd;
return -errno;
return -errno;
return fd;
int fd;
goto finish;
goto finish;
if ((m = mmap(NULL, sizeof(ReadaheadShared), PROT_WRITE|PROT_READ, MAP_SHARED, fd, 0)) == MAP_FAILED) {
m = NULL;
goto finish;
if (fd >= 0)
int bump_request_nr(const char *p) {
const char *nr_requests;
uint64_t u;
assert(p);
return -errno;
return -ENOMEM;
r = -ENOENT;
goto finish;
if (!nr_requests) {
r = -ENOENT;
goto finish;
goto finish;
r = -ENOMEM;
goto finish;
goto finish;
log_info("Bumped block_nr parameter of %s to %lu. This is a temporary hack and should be removed one day.", udev_device_get_devnode(look_at), (unsigned long) BUMP_REQUEST_NR);
if (udev_device)
if (udev)