Skip to content

Commit

Permalink
gfs2: Remove dead code in gfs2_file_read_iter
Browse files Browse the repository at this point in the history
Function iomap_dio_rw() only returns -ENOTBLK for write requests and
gfs2_file_direct_read() no longer returns -ENOTBLK since commit
1d45bb7 ("gfs2: Use iomap for stuffed direct I/O reads"), so there
is no need to check for -ENOTBLK in gfs2_file_read_iter() anymore.

Signed-off-by: Andreas Gruenbacher <[email protected]>
  • Loading branch information
Andreas Gruenbacher committed Mar 24, 2022
1 parent 46f3e04 commit 1166183
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions fs/gfs2/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -951,12 +951,9 @@ static ssize_t gfs2_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
* and retry.
*/

if (iocb->ki_flags & IOCB_DIRECT) {
ret = gfs2_file_direct_read(iocb, to, &gh);
if (likely(ret != -ENOTBLK))
return ret;
iocb->ki_flags &= ~IOCB_DIRECT;
}
if (iocb->ki_flags & IOCB_DIRECT)
return gfs2_file_direct_read(iocb, to, &gh);

pagefault_disable();
iocb->ki_flags |= IOCB_NOIO;
ret = generic_file_read_iter(iocb, to);
Expand Down

0 comments on commit 1166183

Please sign in to comment.