0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-28 19:58:53 +02:00

ircd::fs: Add prefetch skeleton linkage.

This commit is contained in:
Jason Volk 2018-08-18 23:08:55 -07:00
parent adee757303
commit b5c2270e8c
3 changed files with 22 additions and 3 deletions

View file

@ -148,6 +148,18 @@ ircd::fs::write__aio(const fd &fd,
return view;
}
//
// request::prefetch
//
void
ircd::fs::prefetch__aio(const fd &fd,
const size_t &size,
const read_opts &opts)
{
}
//
// aio
//

View file

@ -76,6 +76,7 @@ struct ircd::fs::aio::request
namespace ircd::fs
{
void prefetch__aio(const fd &, const size_t &, const read_opts &);
const_buffer write__aio(const fd &, const const_buffer &, const write_opts &);
const_buffer read__aio(const fd &, const mutable_buffer &, const read_opts &);
void fdsync__aio(const fd &, const fsync_opts &);

View file

@ -237,10 +237,16 @@ ircd::fs::prefetch(const fd &fd,
syscall(::fcntl, fd, F_GETFL)
};
if(flags & O_DIRECT)
return; //TODO: AIO prefetch scheme
if(~flags & O_DIRECT)
{
syscall(::readahead, fd, opts.offset, count);
return;
}
syscall(::readahead, fd, opts.offset, count);
#ifdef IRCD_USE_AIO
if(likely(aioctx))
prefetch__aio(fd, count, opts);
#endif
}
#else
void