Commit 24523e45 authored by Mike Marshall's avatar Mike Marshall
Browse files

orangefs: readahead adjustment



Matthew Wilcox suggested that perhaps it could be "possible for
rac->file to be NULL if the caller doesn't have a struct file"...

Signed-off-by: default avatarMike Marshall <hubcap@omnibond.com>
parent 13311e74
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -249,8 +249,7 @@ static void orangefs_readahead(struct readahead_control *rac)
{
	loff_t offset;
	struct iov_iter iter;
	struct file *file = rac->file;
	struct inode *inode = file->f_mapping->host;
	struct inode *inode = rac->mapping->host;
	struct xarray *i_pages;
	struct page *page;
	loff_t new_start = readahead_pos(rac);
@@ -269,14 +268,14 @@ static void orangefs_readahead(struct readahead_control *rac)
		readahead_expand(rac, new_start, new_len);

	offset = readahead_pos(rac);
	i_pages = &file->f_mapping->i_pages;
	i_pages = &rac->mapping->i_pages;

	iov_iter_xarray(&iter, READ, i_pages, offset, readahead_length(rac));

	/* read in the pages. */
	if ((ret = wait_for_direct_io(ORANGEFS_IO_READ, inode,
			&offset, &iter, readahead_length(rac),
			inode->i_size, NULL, NULL, file)) < 0)
			inode->i_size, NULL, NULL, rac->file)) < 0)
		gossip_debug(GOSSIP_FILE_DEBUG,
			"%s: wait_for_direct_io failed. \n", __func__);
	else