[XFS] When issuing metadata readahead, submit bio with READA not READ.
authorNathan Scott <nathans@sgi.com>
Thu, 28 Sep 2006 01:01:57 +0000 (11:01 +1000)
committerTim Shimmin <tes@sgi.com>
Thu, 28 Sep 2006 01:01:57 +0000 (11:01 +1000)
SGI-PV: 944409
SGI-Modid: xfs-linux-melb:xfs-kern:26603a

Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
fs/xfs/linux-2.6/xfs_buf.c

index f13503508c4618cf4c302e56ccd7756c1f5272b3..247adced6e1b2bdc215b8e20dfa0eab0090da78e 100644 (file)
@@ -1156,16 +1156,16 @@ _xfs_buf_ioapply(
        total_nr_pages = bp->b_page_count;
        map_i = 0;
 
-       if (bp->b_flags & _XBF_RUN_QUEUES) {
-               bp->b_flags &= ~_XBF_RUN_QUEUES;
-               rw = (bp->b_flags & XBF_READ) ? READ_SYNC : WRITE_SYNC;
-       } else {
-               rw = (bp->b_flags & XBF_READ) ? READ : WRITE;
-       }
-
        if (bp->b_flags & XBF_ORDERED) {
                ASSERT(!(bp->b_flags & XBF_READ));
                rw = WRITE_BARRIER;
+       } else if (bp->b_flags & _XBF_RUN_QUEUES) {
+               ASSERT(!(bp->b_flags & XBF_READ_AHEAD));
+               bp->b_flags &= ~_XBF_RUN_QUEUES;
+               rw = (bp->b_flags & XBF_WRITE) ? WRITE_SYNC : READ_SYNC;
+       } else {
+               rw = (bp->b_flags & XBF_WRITE) ? WRITE :
+                    (bp->b_flags & XBF_READ_AHEAD) ? READA : READ;
        }
 
        /* Special code path for reading a sub page size buffer in --