Commit 615f9a68 authored by Shivani Bhardwaj's avatar Shivani Bhardwaj Committed by Greg Kroah-Hartman

Staging: lustre: statahead: Remove sa_received_empty wrapper

Remove the wrapper sa_received_empty() and replace its calls with the
function it wrapped.
Signed-off-by: default avatarShivani Bhardwaj <shivanib134@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6c3d0ea6
...@@ -518,7 +518,7 @@ static void ll_sai_put(struct ll_statahead_info *sai) ...@@ -518,7 +518,7 @@ static void ll_sai_put(struct ll_statahead_info *sai)
do_sa_entry_fini(sai, entry); do_sa_entry_fini(sai, entry);
LASSERT(list_empty(&sai->sai_entries)); LASSERT(list_empty(&sai->sai_entries));
LASSERT(sa_received_empty(sai)); LASSERT(list_empty(&sai->sai_entries_received));
LASSERT(list_empty(&sai->sai_entries_stated)); LASSERT(list_empty(&sai->sai_entries_stated));
LASSERT(atomic_read(&sai->sai_cache_count) == 0); LASSERT(atomic_read(&sai->sai_cache_count) == 0);
...@@ -602,7 +602,7 @@ static void ll_post_statahead(struct ll_statahead_info *sai) ...@@ -602,7 +602,7 @@ static void ll_post_statahead(struct ll_statahead_info *sai)
int rc = 0; int rc = 0;
spin_lock(&lli->lli_sa_lock); spin_lock(&lli->lli_sa_lock);
if (unlikely(sa_received_empty(sai))) { if (unlikely(list_empty(&sai->sai_entries_received))) {
spin_unlock(&lli->lli_sa_lock); spin_unlock(&lli->lli_sa_lock);
return; return;
} }
...@@ -738,7 +738,7 @@ static int ll_statahead_interpret(struct ptlrpc_request *req, ...@@ -738,7 +738,7 @@ static int ll_statahead_interpret(struct ptlrpc_request *req,
* for readpage and other tries to enqueue lock on child * for readpage and other tries to enqueue lock on child
* with parent's lock held, for example: unlink. */ * with parent's lock held, for example: unlink. */
entry->se_handle = handle; entry->se_handle = handle;
wakeup = sa_received_empty(sai); wakeup = list_empty(&sai->sai_entries_received);
list_add_tail(&entry->se_list, list_add_tail(&entry->se_list,
&sai->sai_entries_received); &sai->sai_entries_received);
} }
...@@ -1120,13 +1120,13 @@ static int ll_statahead_thread(void *arg) ...@@ -1120,13 +1120,13 @@ static int ll_statahead_thread(void *arg)
keep_it: keep_it:
l_wait_event(thread->t_ctl_waitq, l_wait_event(thread->t_ctl_waitq,
!sa_sent_full(sai) || !sa_sent_full(sai) ||
!sa_received_empty(sai) || !list_empty(&sai->sai_entries_received) ||
!agl_list_empty(sai) || !agl_list_empty(sai) ||
!thread_is_running(thread), !thread_is_running(thread),
&lwi); &lwi);
interpret_it: interpret_it:
while (!sa_received_empty(sai)) while (!list_empty(&sai->sai_entries_received))
ll_post_statahead(sai); ll_post_statahead(sai);
if (unlikely(!thread_is_running(thread))) { if (unlikely(!thread_is_running(thread))) {
...@@ -1148,7 +1148,7 @@ static int ll_statahead_thread(void *arg) ...@@ -1148,7 +1148,7 @@ static int ll_statahead_thread(void *arg)
ll_agl_trigger(&clli->lli_vfs_inode, ll_agl_trigger(&clli->lli_vfs_inode,
sai); sai);
if (!sa_received_empty(sai)) if (!list_empty(&sai->sai_entries_received))
goto interpret_it; goto interpret_it;
if (unlikely( if (unlikely(
...@@ -1179,12 +1179,12 @@ static int ll_statahead_thread(void *arg) ...@@ -1179,12 +1179,12 @@ static int ll_statahead_thread(void *arg)
ll_release_page(page, 0); ll_release_page(page, 0);
while (1) { while (1) {
l_wait_event(thread->t_ctl_waitq, l_wait_event(thread->t_ctl_waitq,
!sa_received_empty(sai) || !list_empty(&sai->sai_entries_received) ||
sai->sai_sent == sai->sai_replied || sai->sai_sent == sai->sai_replied ||
!thread_is_running(thread), !thread_is_running(thread),
&lwi); &lwi);
while (!sa_received_empty(sai)) while (!list_empty(&sai->sai_entries_received))
ll_post_statahead(sai); ll_post_statahead(sai);
if (unlikely(!thread_is_running(thread))) { if (unlikely(!thread_is_running(thread))) {
...@@ -1193,7 +1193,7 @@ static int ll_statahead_thread(void *arg) ...@@ -1193,7 +1193,7 @@ static int ll_statahead_thread(void *arg)
} }
if (sai->sai_sent == sai->sai_replied && if (sai->sai_sent == sai->sai_replied &&
sa_received_empty(sai)) list_empty(&sai->sai_entries_received))
break; break;
} }
...@@ -1246,12 +1246,12 @@ static int ll_statahead_thread(void *arg) ...@@ -1246,12 +1246,12 @@ static int ll_statahead_thread(void *arg)
} }
ll_dir_chain_fini(&chain); ll_dir_chain_fini(&chain);
spin_lock(&plli->lli_sa_lock); spin_lock(&plli->lli_sa_lock);
if (!sa_received_empty(sai)) { if (!list_empty(&sai->sai_entries_received)) {
thread_set_flags(thread, SVC_STOPPING); thread_set_flags(thread, SVC_STOPPING);
spin_unlock(&plli->lli_sa_lock); spin_unlock(&plli->lli_sa_lock);
/* To release the resources held by received entries. */ /* To release the resources held by received entries. */
while (!sa_received_empty(sai)) while (!list_empty(&sai->sai_entries_received))
ll_post_statahead(sai); ll_post_statahead(sai);
spin_lock(&plli->lli_sa_lock); spin_lock(&plli->lli_sa_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment