From 56be023a732c4cafda0c0e5a54ed97d567588752 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Tue, 14 Aug 2007 17:03:42 +0000 Subject: [PATCH] - Version changed in scst_user_spec.txt - Minor fixes git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@160 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- doc/scst_user_spec.txt | 5 ++++- usr/fileio/common.c | 2 +- usr/fileio/debug.h | 3 +++ usr/fileio/fileio.c | 12 +++++++++--- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/doc/scst_user_spec.txt b/doc/scst_user_spec.txt index 423e18281..2b57e2812 100644 --- a/doc/scst_user_spec.txt +++ b/doc/scst_user_spec.txt @@ -2,7 +2,7 @@ USER SPACE INTERFACE DESCRIPTION. - Version 0.9.6 + Version 0.9.6/1 I. Description. @@ -570,6 +570,7 @@ struct scst_user_scsi_cmd_on_free_cmd uint64_t pbuf; int32_t resp_data_len; uint8_t buffer_cached; + uint8_t aborted; uint8_t status; }, @@ -582,6 +583,8 @@ where: - buffer_cached - true, if memory reusage is enabled for this command + - aborted - true, if command was aborted + - status - SAM status of the commands execution The user space handler should reply using the corresponding reply diff --git a/usr/fileio/common.c b/usr/fileio/common.c index 163050100..a5209b14f 100644 --- a/usr/fileio/common.c +++ b/usr/fileio/common.c @@ -800,7 +800,7 @@ out_close: close(vcmd.fd); out: - PRINT_INFO_PR("Thread %d exited (res=%d)", gettid(), res); + PRINT_INFO_PR("Thread %d exiting (res=%d)", gettid(), res); TRACE_EXIT_RES(res); return (void*)res; diff --git a/usr/fileio/debug.h b/usr/fileio/debug.h index e2dba9ede..5b28ee14a 100644 --- a/usr/fileio/debug.h +++ b/usr/fileio/debug.h @@ -105,6 +105,9 @@ do { \ #define TRACE_BUFFER(message, buff, len) {} #define TRACE_BUFF_FLAG(flag, message, buff, len) {} +static inline int debug_init(void) { return 0; } +static inline void debug_done(void) {} + #endif /* DEBUG || TRACING */ #ifdef DEBUG diff --git a/usr/fileio/fileio.c b/usr/fileio/fileio.c index 6e392ff5d..5c6af5049 100644 --- a/usr/fileio/fileio.c +++ b/usr/fileio/fileio.c @@ -396,7 +396,7 @@ int main(int argc, char **argv) goto out_close; } -#if 0 +#if 1 { /* Not needed, added here only as a test */ struct scst_user_opt opt; @@ -464,8 +464,11 @@ int main(int argc, char **argv) res = errno; PRINT_ERROR_PR("pthread_join() failed: %s", strerror(res)); - } else if (rc1 != NULL) + } else if (rc1 != NULL) { res = (int)rc1; + PRINT_INFO("Thread %d exited, res %x", i, res); + } else + PRINT_INFO("Thread %d exited", i); } if (dev.prio_thr) { rc = pthread_join(prio, &rc1); @@ -473,8 +476,11 @@ int main(int argc, char **argv) res = errno; PRINT_ERROR_PR("Prio pthread_join() failed: %s", strerror(res)); - } else if (rc1 != NULL) + } else if (rc1 != NULL) { res = (int)rc1; + PRINT_INFO("Prio thread %d exited, res %x", i, res); + } else + PRINT_INFO("Prio thread %d exited", i); } }