mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2025-04-06 17:49:11 +03:00
Align code with Illumos
Align code in traverse_visitbp() with that in Illumos in preparation for applying Illumos-5694. No functional change: use a temporary variable pd to replace multiple occurrences of td->td_pfd. This increases our stack use slightly more then normal because the function is called recursively. Signed-off-by: Chris Dunlop <chris@onthe.net.au> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Issue #3230
This commit is contained in:
parent
a4069eef2e
commit
ee2f17aa2a
@ -213,6 +213,7 @@ traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp,
|
|||||||
{
|
{
|
||||||
int err = 0;
|
int err = 0;
|
||||||
arc_buf_t *buf = NULL;
|
arc_buf_t *buf = NULL;
|
||||||
|
prefetch_data_t *pd = td->td_pfd;
|
||||||
|
|
||||||
switch (resume_skip_check(td, dnp, zb)) {
|
switch (resume_skip_check(td, dnp, zb)) {
|
||||||
case RESUME_SKIP_ALL:
|
case RESUME_SKIP_ALL:
|
||||||
@ -249,16 +250,14 @@ traverse_visitbp(traverse_data_t *td, const dnode_phys_t *dnp,
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (td->td_pfd != NULL && !td->td_pfd->pd_exited &&
|
if (pd != NULL && !pd->pd_exited && prefetch_needed(pd, bp)) {
|
||||||
prefetch_needed(td->td_pfd, bp)) {
|
mutex_enter(&pd->pd_mtx);
|
||||||
mutex_enter(&td->td_pfd->pd_mtx);
|
ASSERT(pd->pd_blks_fetched >= 0);
|
||||||
ASSERT(td->td_pfd->pd_blks_fetched >= 0);
|
while (pd->pd_blks_fetched == 0 && !pd->pd_exited)
|
||||||
while (td->td_pfd->pd_blks_fetched == 0 &&
|
cv_wait(&pd->pd_cv, &pd->pd_mtx);
|
||||||
!td->td_pfd->pd_exited)
|
pd->pd_blks_fetched--;
|
||||||
cv_wait(&td->td_pfd->pd_cv, &td->td_pfd->pd_mtx);
|
cv_broadcast(&pd->pd_cv);
|
||||||
td->td_pfd->pd_blks_fetched--;
|
mutex_exit(&pd->pd_mtx);
|
||||||
cv_broadcast(&td->td_pfd->pd_cv);
|
|
||||||
mutex_exit(&td->td_pfd->pd_mtx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BP_IS_HOLE(bp)) {
|
if (BP_IS_HOLE(bp)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user