diff options
author | Shen Yan <[email protected]> | 2014-01-22 12:44:35 +0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2014-01-23 12:56:33 -0800 |
commit | 93292b308178cb885e1b11ca1a270c36f5b08a23 (patch) | |
tree | 1d03497b732a76795cf6ab6ae7a9295da0295b91 /module/zfs/dmu_zfetch.c | |
parent | 4461aa6118fa55dc83f5d75c6d428767c3634fba (diff) |
Use enum type(zfetch_dirn_t) instead
Fix code with zfetch_dirn_t, which is more readable and clear.
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #2068
Diffstat (limited to 'module/zfs/dmu_zfetch.c')
-rw-r--r-- | module/zfs/dmu_zfetch.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/module/zfs/dmu_zfetch.c b/module/zfs/dmu_zfetch.c index 876ff357f..9bc919184 100644 --- a/module/zfs/dmu_zfetch.c +++ b/module/zfs/dmu_zfetch.c @@ -138,7 +138,8 @@ dmu_zfetch_colinear(zfetch_t *zf, zstream_t *zh) diff = z_comp->zst_offset - z_walk->zst_offset; if (z_comp->zst_offset + diff == 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 = diff * z_walk->zst_direction; 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; if (z_walk->zst_offset + diff == 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 = diff * z_walk->zst_direction; z_walk->zst_ph_offset = |