From e267b5232d1d6cc5886d63251b02451690c403c8 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 17 Sep 2019 11:35:50 -0700 Subject: [PATCH] ircd::m::media::block: Add prefetch() to interface. --- include/ircd/m/media.h | 1 + modules/media/media.cc | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/include/ircd/m/media.h b/include/ircd/m/media.h index 8675e1f5f..70f168318 100644 --- a/include/ircd/m/media.h +++ b/include/ircd/m/media.h @@ -48,6 +48,7 @@ namespace ircd::m::media::block { using closure = std::function; + bool prefetch(const string_view &hash); const_buffer get(const mutable_buffer &out, const string_view &hash); void set(const string_view &hash, const const_buffer &block); diff --git a/modules/media/media.cc b/modules/media/media.cc index a0ef0350f..09af8a8eb 100644 --- a/modules/media/media.cc +++ b/modules/media/media.cc @@ -627,6 +627,13 @@ ircd::m::media::block::get(const mutable_buffer &out, return db::read(blocks, b58hash, out); } +bool +IRCD_MODULE_EXPORT +ircd::m::media::block::prefetch(const string_view &b58hash) +{ + return db::prefetch(blocks, b58hash); +} + // // media::mxc //