From: pschwan Date: Thu, 3 Oct 2002 20:00:29 +0000 (+0000) Subject: - rewrap lustre_lib, so it's readable in an 80-column emacs X-Git-Tag: 0.5.14~79 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=d436506bde44a146337711833d3ae6b8e9c1489d;p=fs%2Flustre-release.git - rewrap lustre_lib, so it's readable in an 80-column emacs - add a touch more debugging to extent locking --- diff --git a/lustre/include/linux/lustre_lib.h b/lustre/include/linux/lustre_lib.h index e1dc9d7..6defd75 100644 --- a/lustre/include/linux/lustre_lib.h +++ b/lustre/include/linux/lustre_lib.h @@ -482,95 +482,95 @@ struct l_wait_info { void *lwi_cb_data; }; -#define LWI_TIMEOUT(time, cb, data) \ -((struct l_wait_info) { \ - lwi_timeout: time, \ - lwi_on_timeout: cb, \ - lwi_cb_data: data \ +#define LWI_TIMEOUT(time, cb, data) \ +((struct l_wait_info) { \ + lwi_timeout: time, \ + lwi_on_timeout: cb, \ + lwi_cb_data: data \ }) -#define LWI_INTR(cb, data) \ -((struct l_wait_info) { \ - lwi_signals: 1, \ - lwi_on_signal: cb, \ - lwi_cb_data: data \ +#define LWI_INTR(cb, data) \ +((struct l_wait_info) { \ + lwi_signals: 1, \ + lwi_on_signal: cb, \ + lwi_cb_data: data \ }) -#define LWI_TIMEOUT_INTR(time, time_cb, sig_cb, data) \ -((struct l_wait_info) { \ - lwi_timeout: time, \ - lwi_on_timeout: time_cb, \ - lwi_signals: 1, \ - lwi_on_signal: sig_cb, \ - lwi_cb_data: data \ +#define LWI_TIMEOUT_INTR(time, time_cb, sig_cb, data) \ +((struct l_wait_info) { \ + lwi_timeout: time, \ + lwi_on_timeout: time_cb, \ + lwi_signals: 1, \ + lwi_on_signal: sig_cb, \ + lwi_cb_data: data \ }) /* XXX this should be one mask-check */ -#define l_killable_pending(task) \ -(sigismember(&(task->pending.signal), SIGKILL) || \ - sigismember(&(task->pending.signal), SIGINT) || \ +#define l_killable_pending(task) \ +(sigismember(&(task->pending.signal), SIGKILL) || \ + sigismember(&(task->pending.signal), SIGINT) || \ sigismember(&(task->pending.signal), SIGTERM)) -#define __l_wait_event(wq, condition, info, ret) \ -do { \ - wait_queue_t __wait; \ - long __state; \ - int __timed_out = 0; \ - init_waitqueue_entry(&__wait, current); \ - \ - add_wait_queue(&wq, &__wait); \ - if (info->lwi_signals && !info->lwi_timeout) \ - __state = TASK_INTERRUPTIBLE; \ - else \ - __state = TASK_UNINTERRUPTIBLE; \ - for (;;) { \ - set_current_state(__state); \ - if (condition) \ - break; \ - if (__state == TASK_INTERRUPTIBLE && l_killable_pending(current)) { \ - CERROR("lwe: interrupt\n"); \ - if (info->lwi_on_signal) \ - info->lwi_on_signal(info->lwi_cb_data); \ - ret = -EINTR; \ - break; \ - } \ - if (info->lwi_timeout && !__timed_out) { \ - if (schedule_timeout(info->lwi_timeout) == 0) { \ - CERROR("lwe: timeout\n"); \ - __timed_out = 1; \ - if (!info->lwi_on_timeout || \ - info->lwi_on_timeout(info->lwi_cb_data)) { \ - ret = -ETIMEDOUT; \ - break; \ - } \ - /* We'll take signals after a timeout. */ \ - if (info->lwi_signals) { \ - __state = TASK_INTERRUPTIBLE; \ - /* Check for a pending interrupt. */ \ - if (info->lwi_signals && l_killable_pending(current)) { \ - CERROR("lwe: pending interrupt\n"); \ - if (info->lwi_on_signal) \ - info->lwi_on_signal(info->lwi_cb_data); \ - ret = -EINTR; \ - break; \ - } \ - } \ - } \ - } else { \ - schedule(); \ - } \ - } \ - current->state = TASK_RUNNING; \ - remove_wait_queue(&wq, &__wait); \ +#define __l_wait_event(wq, condition, info, ret) \ +do { \ + wait_queue_t __wait; \ + long __state; \ + int __timed_out = 0; \ + init_waitqueue_entry(&__wait, current); \ + \ + add_wait_queue(&wq, &__wait); \ + if (info->lwi_signals && !info->lwi_timeout) \ + __state = TASK_INTERRUPTIBLE; \ + else \ + __state = TASK_UNINTERRUPTIBLE; \ + for (;;) { \ + set_current_state(__state); \ + if (condition) \ + break; \ + if (__state == TASK_INTERRUPTIBLE && l_killable_pending(current)) {\ + CERROR("lwe: interrupt\n"); \ + if (info->lwi_on_signal) \ + info->lwi_on_signal(info->lwi_cb_data); \ + ret = -EINTR; \ + break; \ + } \ + if (info->lwi_timeout && !__timed_out) { \ + if (schedule_timeout(info->lwi_timeout) == 0) { \ + CERROR("lwe: timeout\n"); \ + __timed_out = 1; \ + if (!info->lwi_on_timeout || \ + info->lwi_on_timeout(info->lwi_cb_data)) { \ + ret = -ETIMEDOUT; \ + break; \ + } \ + /* We'll take signals after a timeout. */ \ + if (info->lwi_signals) { \ + __state = TASK_INTERRUPTIBLE; \ + /* Check for a pending interrupt. */ \ + if (info->lwi_signals && l_killable_pending(current)) {\ + CERROR("lwe: pending interrupt\n"); \ + if (info->lwi_on_signal) \ + info->lwi_on_signal(info->lwi_cb_data); \ + ret = -EINTR; \ + break; \ + } \ + } \ + } \ + } else { \ + schedule(); \ + } \ + } \ + current->state = TASK_RUNNING; \ + remove_wait_queue(&wq, &__wait); \ } while(0) -#define l_wait_event(wq, condition, info) \ -({ \ - int __ret = 0; \ - struct l_wait_info *__info = (info); \ - if (!(condition)) \ - __l_wait_event(wq, condition, __info, __ret); \ - __ret; \ +#define l_wait_event(wq, condition, info) \ +({ \ + int __ret = 0; \ + struct l_wait_info *__info = (info); \ + if (!(condition)) \ + __l_wait_event(wq, condition, __info, __ret); \ + __ret; \ }) #endif /* _LUSTRE_LIB_H */ diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c index 723b2ee..5917b56 100644 --- a/lustre/ldlm/ldlm_request.c +++ b/lustre/ldlm/ldlm_request.c @@ -252,9 +252,10 @@ int ldlm_cli_enqueue(struct lustre_handle *connh, CDEBUG(D_INFO, "remote handle: %p, flags: %d\n", (void *)(unsigned long)reply->lock_handle.addr, *flags); - CDEBUG(D_INFO, "extent: %Lu -> %Lu\n", - (unsigned long long)reply->lock_extent.start, - (unsigned long long)reply->lock_extent.end); + CDEBUG(D_INFO, "requested extent: "LPU64" -> "LPU64", got extent " + LPU64" -> "LPU64"\n", + body->lock_desc.l_extent.start, body->lock_desc.l_extent.end, + reply->lock_extent.start, reply->lock_extent.end); /* If enqueue returned a blocked lock but the completion handler has * already run, then it fixed up the resource and we don't need to do it