if (!pcc_file || !file_inode(pcc_file)->i_fop->mmap)
RETURN(0);
+ /* with PCC, the files are created in an unusual way, then we do some
+ * special magic with mmap to allow Lustre and PCC to share the mmap,
+ * so we must manually set the ra_pages or we can get kernel readahead
+ * occurring (which Lustre does not support)
+ */
+ pcc_file->f_ra.ra_pages = 0;
+ file->f_ra.ra_pages = 0;
+
pcc_inode_lock(inode);
pcci = ll_i2pcci(inode);
if (pcci && pcc_inode_has_layout(pcci)) {
struct inode *inode = file_inode(file);
struct cl_object *clob = ll_i2info(inode)->lli_clob;
struct ll_sb_info *sbi = ll_i2sbi(inode);
+ struct super_block *sb = inode->i_sb;
const struct lu_env *env = NULL;
struct cl_read_ahead ra = { 0 };
struct ll_cl_context *lcc;
struct cl_io *io = NULL;
+ bool ra_assert = false;
struct cl_page *page;
int result;
ENTRY;
}
}
+ /* this is a sequence of checks verifying that kernel readahead is
+ * truly disabled
+ */
+ if (lcc && lcc->lcc_type == LCC_MMAP) {
+ if (io->u.ci_fault.ft_index != vmpage->index) {
+ CERROR("ft_index %lu, vmpage index %lu\n",
+ io->u.ci_fault.ft_index, vmpage->index);
+ ra_assert = true;
+ }
+ }
+
+ if (ra_assert || sb->s_bdi->ra_pages != 0 || file->f_ra.ra_pages != 0) {
+ CERROR("sbi ra pages %lu, file ra pages %d\n",
+ sb->s_bdi->ra_pages, file->f_ra.ra_pages);
+ ra_assert = true;
+ }
+
+
+#ifdef HAVE_BDI_IO_PAGES
+ if (ra_assert || sb->s_bdi->io_pages != 0) {
+ CERROR("bdi io_pages %lu\n", sb->s_bdi->io_pages);
+ ra_assert = true;
+ }
+#endif
+ if (ra_assert)
+ LBUG();
/**
* Direct read can fall back to buffered read, but DIO is done
* with lockless i/o, and buffered requires LDLM locking, so in