HomeFreeBSD

When read requests are sent from a filesystem running above g_journal,

Description

When read requests are sent from a filesystem running above g_journal,
the g_journal level needs to check whether it is holding a newer
copy of the block than that which exists on the disk. If so, it
needs to return its copy. If not, it should pass the request down
to the disk to fulfill. It currently considers six queues:

0) delayed queue,

  1. unsent (current queue),
  2. in-flight to the journal (flush queue),
  3. active journal (active queue),
  4. inactive journal (inactive queue), and
  5. inflight to the disk (copy queue).

Checking on two of these queues is unnecessary:

0) The delayed requests should not be used for reads because they

have not yet been entered into the journal, so their value should
reflect the disk contents, not the future contents that are not
yet committed.
  1. Because all the bio's in the flush queue are also found on the active queue, there is no need to inspect the flush queue for reads since they will be found when searching the active queue.

Submitted by: Dr. Andreas Longwitz <longwitz@incore.de>
Discussed with: kib
MFC after: 1 week

Details

Provenance
mckusickAuthored on
Parents
rS322463: Eliminate a variable that is only ever set.
Branches
Unknown
Tags
Unknown