1
0
mirror of https://github.com/ceph/ceph synced 2024-12-17 17:05:42 +00:00

build: check if posix_fadvise() exists

Signed-off-by: Yan, Zheng <zyan@redhat.com>
This commit is contained in:
Yan, Zheng 2016-05-27 17:17:56 +08:00
parent ddb4a28f40
commit c26b14649c
4 changed files with 10 additions and 1 deletions
src
os/filestore
tools/rbd/action

View File

@ -3339,7 +3339,9 @@ int FileStore::_write(const coll_t& cid, const ghobject_t& oid,
if (replaying || m_disable_wbthrottle) {
if (fadvise_flags & CEPH_OSD_OP_FLAG_FADVISE_DONTNEED) {
#ifdef HAVE_POSIX_FADVISE
posix_fadvise(**fd, 0, 0, POSIX_FADV_DONTNEED);
#endif
}
} else {
wbthrottle.queue_wb(fd, oid, offset, len,

View File

@ -110,7 +110,9 @@ static int do_export(librbd::Image& image, const char *path, bool no_progress)
if (fd < 0) {
return -errno;
}
#ifdef HAVE_POSIX_FADVISE
posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL);
#endif
}
utils::ProgressContext pc("Exporting image", no_progress);

View File

@ -126,8 +126,9 @@ static int do_import(librbd::RBD &rbd, librados::IoCtx& io_ctx,
assert(bdev_size >= 0);
size = (uint64_t) bdev_size;
}
#ifdef HAVE_POSIX_FADVISE
posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL);
#endif
}
uint64_t format;

View File

@ -511,7 +511,9 @@ static int do_export_journal(librados::IoCtx& io_ctx,
std::cerr << "rbd: error creating " << path << std::endl;
return r;
}
#ifdef HAVE_POSIX_FADVISE
posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL);
#endif
}
JournalExporter exporter(io_ctx, journal_id, fd, no_error, verbose);
@ -719,7 +721,9 @@ static int do_import_journal(librados::IoCtx& io_ctx,
std::cerr << "rbd: error opening " << path << std::endl;
return r;
}
#ifdef HAVE_POSIX_FADVISE
posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL);
#endif
}
JournalImporter importer(io_ctx, journal_id, fd, no_error, verbose);