mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-25 18:59:33 +03:00
Use enum type(zfetch_dirn_t) instead
Fix code with zfetch_dirn_t, which is more readable and clear. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #2068
This commit is contained in:
parent
4461aa6118
commit
93292b3081
@ -138,7 +138,8 @@ dmu_zfetch_colinear(zfetch_t *zf, zstream_t *zh)
|
|||||||
diff = z_comp->zst_offset - z_walk->zst_offset;
|
diff = z_comp->zst_offset - z_walk->zst_offset;
|
||||||
if (z_comp->zst_offset + diff == zh->zst_offset) {
|
if (z_comp->zst_offset + diff == zh->zst_offset) {
|
||||||
z_walk->zst_offset = zh->zst_offset;
|
z_walk->zst_offset = zh->zst_offset;
|
||||||
z_walk->zst_direction = diff < 0 ? -1 : 1;
|
z_walk->zst_direction = diff < 0 ?
|
||||||
|
ZFETCH_BACKWARD : ZFETCH_FORWARD;
|
||||||
z_walk->zst_stride =
|
z_walk->zst_stride =
|
||||||
diff * z_walk->zst_direction;
|
diff * z_walk->zst_direction;
|
||||||
z_walk->zst_ph_offset =
|
z_walk->zst_ph_offset =
|
||||||
@ -156,7 +157,8 @@ dmu_zfetch_colinear(zfetch_t *zf, zstream_t *zh)
|
|||||||
diff = z_walk->zst_offset - z_comp->zst_offset;
|
diff = z_walk->zst_offset - z_comp->zst_offset;
|
||||||
if (z_walk->zst_offset + diff == zh->zst_offset) {
|
if (z_walk->zst_offset + diff == zh->zst_offset) {
|
||||||
z_walk->zst_offset = zh->zst_offset;
|
z_walk->zst_offset = zh->zst_offset;
|
||||||
z_walk->zst_direction = diff < 0 ? -1 : 1;
|
z_walk->zst_direction = diff < 0 ?
|
||||||
|
ZFETCH_BACKWARD : ZFETCH_FORWARD;
|
||||||
z_walk->zst_stride =
|
z_walk->zst_stride =
|
||||||
diff * z_walk->zst_direction;
|
diff * z_walk->zst_direction;
|
||||||
z_walk->zst_ph_offset =
|
z_walk->zst_ph_offset =
|
||||||
|
Loading…
Reference in New Issue
Block a user