From 2b8a16f29862f45b9ac54105021ef52940344d1a Mon Sep 17 00:00:00 2001 From: Timothy Day Date: Fri, 15 Dec 2023 21:17:18 +0000 Subject: [PATCH] LU-16502 lutf: add headers to lutf C code Add SPDX text and documentation to lutf C code. This will make it easier for developers to find where different functionality lives. Test-Parameters: @lnet Signed-off-by: Timothy Day Change-Id: I67d8acc6b5968e76667130f38018ddcf0fcfd3b0 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53480 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Frank Sehr Reviewed-by: Arshad Hussain Reviewed-by: Oleg Drokin --- lustre/tests/lutf/src/Makefile.am | 8 ++++++++ lustre/tests/lutf/src/liblutf_agent.c | 13 +++++++++++++ lustre/tests/lutf/src/liblutf_connect.c | 14 ++++++++++++++ lustre/tests/lutf/src/liblutf_global.c | 14 ++++++++++++++ lustre/tests/lutf/src/lutf.c | 14 ++++++++++++++ lustre/tests/lutf/src/lutf.h | 11 +++++++++++ lustre/tests/lutf/src/lutf_agent.h | 11 +++++++++++ lustre/tests/lutf/src/lutf_agent.swg | 11 +++++++++++ lustre/tests/lutf/src/lutf_common.h | 11 +++++++++++ lustre/tests/lutf/src/lutf_global.h | 11 +++++++++++ lustre/tests/lutf/src/lutf_global.swg | 11 +++++++++++ lustre/tests/lutf/src/lutf_listener.c | 14 ++++++++++++++ lustre/tests/lutf/src/lutf_listener.h | 11 +++++++++++ lustre/tests/lutf/src/lutf_message.h | 11 +++++++++++ lustre/tests/lutf/src/lutf_python.c | 28 +++++++++++++++------------- lustre/tests/lutf/src/lutf_python.h | 11 +++++++++++ 16 files changed, 191 insertions(+), 13 deletions(-) diff --git a/lustre/tests/lutf/src/Makefile.am b/lustre/tests/lutf/src/Makefile.am index 85273a2..d05e31c 100644 --- a/lustre/tests/lutf/src/Makefile.am +++ b/lustre/tests/lutf/src/Makefile.am @@ -1,4 +1,12 @@ +# SPDX-License-Identifier: GPL-2.0 + +# +# This file is part of Lustre, http://www.lustre.org/ +# +# lustre/tests/lutf/src/Makefile.am +# # Administration utilities Makefile +# SWIG_COMPFLAGS=-g -Wall -fPIC -c SWIG_FLAGS=-D__x86_64__ diff --git a/lustre/tests/lutf/src/liblutf_agent.c b/lustre/tests/lutf/src/liblutf_agent.c index 4f024ed..ed08680 100644 --- a/lustre/tests/lutf/src/liblutf_agent.c +++ b/lustre/tests/lutf/src/liblutf_agent.c @@ -1,3 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* + * This file is part of Lustre, http://www.lustre.org/ + * + * lustre/tests/lutf/liblutf_agent.c + * + * LUTF agent setup (and some RPC code) + * + * Author: Amir Shehata + * + */ + #include #include #include diff --git a/lustre/tests/lutf/src/liblutf_connect.c b/lustre/tests/lutf/src/liblutf_connect.c index a14cbbd..a992635 100644 --- a/lustre/tests/lutf/src/liblutf_connect.c +++ b/lustre/tests/lutf/src/liblutf_connect.c @@ -1,3 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* + * This file is part of Lustre, http://www.lustre.org/ + * + * lustre/tests/lutf/liblutf_connect.c + * + * Routines for communicating with other LUTF nodes + * over TCP. + * + * Author: Amir Shehata + * + */ + #include #include #include diff --git a/lustre/tests/lutf/src/liblutf_global.c b/lustre/tests/lutf/src/liblutf_global.c index b099a6c..5bf3da0 100644 --- a/lustre/tests/lutf/src/liblutf_global.c +++ b/lustre/tests/lutf/src/liblutf_global.c @@ -1,3 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* + * This file is part of Lustre, http://www.lustre.org/ + * + * lustre/tests/lutf/liblutf_global.c + * + * Friendly wrapper functions to get configuration + * values from LUTF configuration. + * + * Author: Amir Shehata + * + */ + #include #include #include diff --git a/lustre/tests/lutf/src/lutf.c b/lustre/tests/lutf/src/lutf.c index 4ed1bf0..bfe82e4 100644 --- a/lustre/tests/lutf/src/lutf.c +++ b/lustre/tests/lutf/src/lutf.c @@ -1,3 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* + * This file is part of Lustre, http://www.lustre.org/ + * + * lustre/tests/lutf/lutf.c + * + * Main entry point for LUTF. Provide command line parsing + * and YAML configuration parsing. + * + * Author: Amir Shehata + * + */ + #include #include #include diff --git a/lustre/tests/lutf/src/lutf.h b/lustre/tests/lutf/src/lutf.h index 00b887b..85d0163 100644 --- a/lustre/tests/lutf/src/lutf.h +++ b/lustre/tests/lutf/src/lutf.h @@ -1,3 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* + * This file is part of Lustre, http://www.lustre.org/ + * + * lustre/tests/lutf/lutf.h + * + * Author: Amir Shehata + * + */ + #ifndef LUTF_H #define LUTF_H diff --git a/lustre/tests/lutf/src/lutf_agent.h b/lustre/tests/lutf/src/lutf_agent.h index 7e769b9..dca5a07 100644 --- a/lustre/tests/lutf/src/lutf_agent.h +++ b/lustre/tests/lutf/src/lutf_agent.h @@ -1,3 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* + * This file is part of Lustre, http://www.lustre.org/ + * + * lustre/tests/lutf/lutf_agent.h + * + * Author: Amir Shehata + * + */ + #ifndef LUTF_AGENTS_H #define LUTF_AGENTS_H diff --git a/lustre/tests/lutf/src/lutf_agent.swg b/lustre/tests/lutf/src/lutf_agent.swg index 881c29a..5c0f881 100644 --- a/lustre/tests/lutf/src/lutf_agent.swg +++ b/lustre/tests/lutf/src/lutf_agent.swg @@ -1,3 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* + * This file is part of Lustre, http://www.lustre.org/ + * + * lustre/tests/lutf/lutf_agent.swg + * + * Author: Amir Shehata + * + */ + %module clutf_agent %{ diff --git a/lustre/tests/lutf/src/lutf_common.h b/lustre/tests/lutf/src/lutf_common.h index 8db40cb..dde0dbc 100644 --- a/lustre/tests/lutf/src/lutf_common.h +++ b/lustre/tests/lutf/src/lutf_common.h @@ -1,3 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* + * This file is part of Lustre, http://www.lustre.org/ + * + * lustre/tests/lutf/lutf_common.h + * + * Author: Amir Shehata + * + */ + #ifndef LUTF_COMMON_H #define LUTF_COMMON_H diff --git a/lustre/tests/lutf/src/lutf_global.h b/lustre/tests/lutf/src/lutf_global.h index 29b808a..09ff6df 100644 --- a/lustre/tests/lutf/src/lutf_global.h +++ b/lustre/tests/lutf/src/lutf_global.h @@ -1,3 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* + * This file is part of Lustre, http://www.lustre.org/ + * + * lustre/tests/lutf/lutf_global.h + * + * Author: Amir Shehata + * + */ + #ifndef LUTF_CONNECT_H #define LUTF_CONNECT_H diff --git a/lustre/tests/lutf/src/lutf_global.swg b/lustre/tests/lutf/src/lutf_global.swg index 1cb2666..9ea54ed 100644 --- a/lustre/tests/lutf/src/lutf_global.swg +++ b/lustre/tests/lutf/src/lutf_global.swg @@ -1,3 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* + * This file is part of Lustre, http://www.lustre.org/ + * + * lustre/tests/lutf/lutf_global.swg + * + * Author: Amir Shehata + * + */ + %module clutf_global %{ diff --git a/lustre/tests/lutf/src/lutf_listener.c b/lustre/tests/lutf/src/lutf_listener.c index 3d0939b..1dabe92 100644 --- a/lustre/tests/lutf/src/lutf_listener.c +++ b/lustre/tests/lutf/src/lutf_listener.c @@ -1,3 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* + * This file is part of Lustre, http://www.lustre.org/ + * + * lustre/tests/lutf/lutf_listener.c + * + * Routines for communicating with other LUTF nodes + * over TCP. + * + * Author: Amir Shehata + * + */ + #include #include #include diff --git a/lustre/tests/lutf/src/lutf_listener.h b/lustre/tests/lutf/src/lutf_listener.h index 8327c47..612ba6a 100644 --- a/lustre/tests/lutf/src/lutf_listener.h +++ b/lustre/tests/lutf/src/lutf_listener.h @@ -1,3 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* + * This file is part of Lustre, http://www.lustre.org/ + * + * lustre/tests/lutf/lutf_listener.h + * + * Author: Amir Shehata + * + */ + #ifndef LUTF_LISTENER_H #define LUTF_LISTENER_H diff --git a/lustre/tests/lutf/src/lutf_message.h b/lustre/tests/lutf/src/lutf_message.h index efbd918..0091041 100644 --- a/lustre/tests/lutf/src/lutf_message.h +++ b/lustre/tests/lutf/src/lutf_message.h @@ -1,3 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* + * This file is part of Lustre, http://www.lustre.org/ + * + * lustre/tests/lutf/lutf_message.h + * + * Author: Amir Shehata + * + */ + #ifndef LUTF_MESSAGE_H #define LUTF_MESSAGE_H diff --git a/lustre/tests/lutf/src/lutf_python.c b/lustre/tests/lutf/src/lutf_python.c index d1b6e97..7e73f76 100644 --- a/lustre/tests/lutf/src/lutf_python.c +++ b/lustre/tests/lutf/src/lutf_python.c @@ -1,3 +1,18 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* + * This file is part of Lustre, http://www.lustre.org/ + * + * lustre/tests/lutf/lutf_python.c + * + * Functions used by LUTF to interact with cPython. LUTF + * test suites are run from python_run_interactive_shell() + * on the master LUTF node. + * + * Author: Amir Shehata + * + */ + #include #include #include "lutf.h" @@ -200,10 +215,6 @@ python_shutdown: return rc; } -/* - * gcc py.c -o py -I/usr/local/include/python2.7 - * -L/usr/local/lib/python2.7/config -lm -ldl -lpthread -lutil -lpython2.7 - */ lutf_rc_t python_init(void) { lutf_rc_t rc = EN_LUTF_RC_FAIL; @@ -226,19 +237,10 @@ lutf_rc_t python_init(void) if (PyStatus_Exception(status)) Py_ExitStatusException(status); #else - //char *path; - //char new_path[MAX_STR_LEN]; Py_SetProgramName(program); - //char *py_args[1]; - - //py_args[0] = argv[0]; Py_Initialize(); - //sprintf(new_path, "%s:%s", path, script_path); - //PySys_SetPath(new_path); - //path = Py_GetPath(); - rc = python_run_interactive_shell(); PDEBUG("Python finalizing"); diff --git a/lustre/tests/lutf/src/lutf_python.h b/lustre/tests/lutf/src/lutf_python.h index 02298f5..a31eb93 100644 --- a/lustre/tests/lutf/src/lutf_python.h +++ b/lustre/tests/lutf/src/lutf_python.h @@ -1,3 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0 + +/* + * This file is part of Lustre, http://www.lustre.org/ + * + * lustre/tests/lutf/lutf_python.h + * + * Author: Amir Shehata + * + */ + #ifndef LUTF_PYTHON_H #define LUTF_PYTHON_H -- 1.8.3.1