diff options
| -rw-r--r-- | drivers/staging/lustre/lustre/llite/statahead.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/staging/lustre/lustre/llite/statahead.c b/drivers/staging/lustre/lustre/llite/statahead.c index b43955f097ab..4769a2230ae1 100644 --- a/drivers/staging/lustre/lustre/llite/statahead.c +++ b/drivers/staging/lustre/lustre/llite/statahead.c | |||
| @@ -659,8 +659,8 @@ static int ll_statahead_interpret(struct ptlrpc_request *req, | |||
| 659 | struct ll_inode_info *lli = ll_i2info(dir); | 659 | struct ll_inode_info *lli = ll_i2info(dir); |
| 660 | struct ll_statahead_info *sai = lli->lli_sai; | 660 | struct ll_statahead_info *sai = lli->lli_sai; |
| 661 | struct sa_entry *entry = (struct sa_entry *)minfo->mi_cbdata; | 661 | struct sa_entry *entry = (struct sa_entry *)minfo->mi_cbdata; |
| 662 | wait_queue_head_t *waitq = NULL; | ||
| 662 | __u64 handle = 0; | 663 | __u64 handle = 0; |
| 663 | bool wakeup; | ||
| 664 | 664 | ||
| 665 | if (it_disposition(it, DISP_LOOKUP_NEG)) | 665 | if (it_disposition(it, DISP_LOOKUP_NEG)) |
| 666 | rc = -ENOENT; | 666 | rc = -ENOENT; |
| @@ -693,7 +693,8 @@ static int ll_statahead_interpret(struct ptlrpc_request *req, | |||
| 693 | 693 | ||
| 694 | spin_lock(&lli->lli_sa_lock); | 694 | spin_lock(&lli->lli_sa_lock); |
| 695 | if (rc) { | 695 | if (rc) { |
| 696 | wakeup = __sa_make_ready(sai, entry, rc); | 696 | if (__sa_make_ready(sai, entry, rc)) |
| 697 | waitq = &sai->sai_waitq; | ||
| 697 | } else { | 698 | } else { |
| 698 | entry->se_minfo = minfo; | 699 | entry->se_minfo = minfo; |
| 699 | entry->se_req = ptlrpc_request_addref(req); | 700 | entry->se_req = ptlrpc_request_addref(req); |
| @@ -704,13 +705,15 @@ static int ll_statahead_interpret(struct ptlrpc_request *req, | |||
| 704 | * with parent's lock held, for example: unlink. | 705 | * with parent's lock held, for example: unlink. |
| 705 | */ | 706 | */ |
| 706 | entry->se_handle = handle; | 707 | entry->se_handle = handle; |
| 707 | wakeup = !sa_has_callback(sai); | 708 | if (!sa_has_callback(sai)) |
| 709 | waitq = &sai->sai_thread.t_ctl_waitq; | ||
| 710 | |||
| 708 | list_add_tail(&entry->se_list, &sai->sai_interim_entries); | 711 | list_add_tail(&entry->se_list, &sai->sai_interim_entries); |
| 709 | } | 712 | } |
| 710 | sai->sai_replied++; | 713 | sai->sai_replied++; |
| 711 | 714 | ||
| 712 | if (wakeup) | 715 | if (waitq) |
| 713 | wake_up(&sai->sai_thread.t_ctl_waitq); | 716 | wake_up(waitq); |
| 714 | spin_unlock(&lli->lli_sa_lock); | 717 | spin_unlock(&lli->lli_sa_lock); |
| 715 | 718 | ||
| 716 | return rc; | 719 | return rc; |
| @@ -1397,10 +1400,10 @@ static int revalidate_statahead_dentry(struct inode *dir, | |||
| 1397 | struct dentry **dentryp, | 1400 | struct dentry **dentryp, |
| 1398 | bool unplug) | 1401 | bool unplug) |
| 1399 | { | 1402 | { |
| 1403 | struct ll_inode_info *lli = ll_i2info(dir); | ||
| 1400 | struct sa_entry *entry = NULL; | 1404 | struct sa_entry *entry = NULL; |
| 1401 | struct l_wait_info lwi = { 0 }; | 1405 | struct l_wait_info lwi = { 0 }; |
| 1402 | struct ll_dentry_data *ldd; | 1406 | struct ll_dentry_data *ldd; |
| 1403 | struct ll_inode_info *lli; | ||
| 1404 | int rc = 0; | 1407 | int rc = 0; |
| 1405 | 1408 | ||
| 1406 | if ((*dentryp)->d_name.name[0] == '.') { | 1409 | if ((*dentryp)->d_name.name[0] == '.') { |
| @@ -1446,7 +1449,9 @@ static int revalidate_statahead_dentry(struct inode *dir, | |||
| 1446 | sa_handle_callback(sai); | 1449 | sa_handle_callback(sai); |
| 1447 | 1450 | ||
| 1448 | if (!sa_ready(entry)) { | 1451 | if (!sa_ready(entry)) { |
| 1452 | spin_lock(&lli->lli_sa_lock); | ||
| 1449 | sai->sai_index_wait = entry->se_index; | 1453 | sai->sai_index_wait = entry->se_index; |
| 1454 | spin_unlock(&lli->lli_sa_lock); | ||
| 1450 | lwi = LWI_TIMEOUT_INTR(cfs_time_seconds(30), NULL, | 1455 | lwi = LWI_TIMEOUT_INTR(cfs_time_seconds(30), NULL, |
| 1451 | LWI_ON_SIGNAL_NOOP, NULL); | 1456 | LWI_ON_SIGNAL_NOOP, NULL); |
| 1452 | rc = l_wait_event(sai->sai_waitq, sa_ready(entry), &lwi); | 1457 | rc = l_wait_event(sai->sai_waitq, sa_ready(entry), &lwi); |
| @@ -1514,7 +1519,6 @@ out_unplug: | |||
| 1514 | * dentry_may_statahead(). | 1519 | * dentry_may_statahead(). |
| 1515 | */ | 1520 | */ |
| 1516 | ldd = ll_d2d(*dentryp); | 1521 | ldd = ll_d2d(*dentryp); |
| 1517 | lli = ll_i2info(dir); | ||
| 1518 | /* ldd can be NULL if llite lookup failed. */ | 1522 | /* ldd can be NULL if llite lookup failed. */ |
| 1519 | if (ldd) | 1523 | if (ldd) |
| 1520 | ldd->lld_sa_generation = lli->lli_sa_generation; | 1524 | ldd->lld_sa_generation = lli->lli_sa_generation; |
