* [LTP] [PATCH v3 0/2] lib: Create tst_tmpdir.h
@ 2024-07-12 8:13 Petr Vorel
2024-07-12 8:13 ` [LTP] [PATCH v3 1/2] " Petr Vorel
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Petr Vorel @ 2024-07-12 8:13 UTC (permalink / raw)
To: ltp
Hi,
changes v2->v3:
* Add tst_tmpdir.h also to include/tst_test.h (Avinesh)
* Split doc change into a separate commit
Petr Vorel (2):
lib: Create tst_tmpdir.h
doc/C API: Add tst_tmpdir.h
doc/developers/api_c_tests.rst | 4 ++++
include/tst_device.h | 6 +-----
include/tst_test.h | 1 +
include/tst_tmpdir.h | 19 +++++++++++++++++++
lib/tst_tmpdir.c | 1 +
5 files changed, 26 insertions(+), 5 deletions(-)
create mode 100644 include/tst_tmpdir.h
--
2.45.2
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 5+ messages in thread* [LTP] [PATCH v3 1/2] lib: Create tst_tmpdir.h 2024-07-12 8:13 [LTP] [PATCH v3 0/2] lib: Create tst_tmpdir.h Petr Vorel @ 2024-07-12 8:13 ` Petr Vorel 2024-07-12 8:13 ` [LTP] [PATCH v3 2/2] doc/C API: Add tst_tmpdir.h Petr Vorel 2024-07-12 9:08 ` [LTP] [PATCH v3 0/2] lib: Create tst_tmpdir.h Avinesh Kumar 2 siblings, 0 replies; 5+ messages in thread From: Petr Vorel @ 2024-07-12 8:13 UTC (permalink / raw) To: ltp This fixes our sparse warning: tst_tmpdir.c:347:6: warning: Symbol 'tst_purge_dir' has no prototype or library ('tst_') prefix. Should it be static? Header needs to be added also to include/tst_test.h (for tests which use tst_purge_dir, e.g. creat08.c). Suggested-by: Cyril Hrubis <chrubis@suse.cz> Reviewed-by: Cyril Hrubis <chrubis@suse.cz> Signed-off-by: Petr Vorel <pvorel@suse.cz> --- include/tst_device.h | 6 +----- include/tst_test.h | 1 + include/tst_tmpdir.h | 19 +++++++++++++++++++ lib/tst_tmpdir.c | 1 + 4 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 include/tst_tmpdir.h diff --git a/include/tst_device.h b/include/tst_device.h index 36258f436c..391fb4e568 100644 --- a/include/tst_device.h +++ b/include/tst_device.h @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) 2016-2019 Cyril Hrubis <chrubis@suse.cz> + * Copyright (c) Linux Test Project, 2019-2024 */ #ifndef TST_DEVICE_H__ @@ -101,11 +102,6 @@ int tst_dev_sync(int fd); */ unsigned long tst_dev_bytes_written(const char *dev); -/* - * Wipe the contents of given directory but keep the directory itself - */ -void tst_purge_dir(const char *path); - /* * Find the file or path belongs to which block dev * @path Path to find the backing dev diff --git a/include/tst_test.h b/include/tst_test.h index eea14469e8..a5fd9a00e2 100644 --- a/include/tst_test.h +++ b/include/tst_test.h @@ -46,6 +46,7 @@ #include "tst_memutils.h" #include "tst_arch.h" #include "tst_fd.h" +#include "tst_tmpdir.h" void tst_res_(const char *file, const int lineno, int ttype, const char *fmt, ...) diff --git a/include/tst_tmpdir.h b/include/tst_tmpdir.h new file mode 100644 index 0000000000..e6c5d962ce --- /dev/null +++ b/include/tst_tmpdir.h @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2017 Cyril Hrubis <chrubis@suse.cz> + * Copyright (c) 2020 Martin Doucha <mdoucha@suse.cz> + */ + +#ifndef TST_TMPDIR_H__ +#define TST_TMPDIR_H__ + +/** + * tst_purge_dir - Wipe the content of given directory. + * + * Wipe the content of given directory but keep the directory itself. + * + * @path: Path of the directory to be wiped. + */ +void tst_purge_dir(const char *path); + +#endif /* TST_TMPDIR_H__ */ diff --git a/lib/tst_tmpdir.c b/lib/tst_tmpdir.c index bcc788390d..0f1b15ca4c 100644 --- a/lib/tst_tmpdir.c +++ b/lib/tst_tmpdir.c @@ -72,6 +72,7 @@ #include "test.h" #include "safe_macros.h" +#include "tst_tmpdir.h" #include "ltp_priv.h" #include "lapi/futex.h" -- 2.45.2 -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [LTP] [PATCH v3 2/2] doc/C API: Add tst_tmpdir.h 2024-07-12 8:13 [LTP] [PATCH v3 0/2] lib: Create tst_tmpdir.h Petr Vorel 2024-07-12 8:13 ` [LTP] [PATCH v3 1/2] " Petr Vorel @ 2024-07-12 8:13 ` Petr Vorel 2024-07-12 8:37 ` Li Wang 2024-07-12 9:08 ` [LTP] [PATCH v3 0/2] lib: Create tst_tmpdir.h Avinesh Kumar 2 siblings, 1 reply; 5+ messages in thread From: Petr Vorel @ 2024-07-12 8:13 UTC (permalink / raw) To: ltp Header created in the previous commit. Signed-off-by: Petr Vorel <pvorel@suse.cz> --- doc/developers/api_c_tests.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/developers/api_c_tests.rst b/doc/developers/api_c_tests.rst index 164f825044..74185c29ec 100644 --- a/doc/developers/api_c_tests.rst +++ b/doc/developers/api_c_tests.rst @@ -37,3 +37,7 @@ Capabilities libltpswap ---------- .. kernel-doc:: ../../include/libswap.h + +Temporary directory +------------------- +.. kernel-doc:: ../../include/tst_tmpdir.h -- 2.45.2 -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH v3 2/2] doc/C API: Add tst_tmpdir.h 2024-07-12 8:13 ` [LTP] [PATCH v3 2/2] doc/C API: Add tst_tmpdir.h Petr Vorel @ 2024-07-12 8:37 ` Li Wang 0 siblings, 0 replies; 5+ messages in thread From: Li Wang @ 2024-07-12 8:37 UTC (permalink / raw) To: Petr Vorel; +Cc: ltp For both: Reviewed-by: Li Wang <liwang@redhat.com> On Fri, Jul 12, 2024 at 4:14 PM Petr Vorel <pvorel@suse.cz> wrote: > Header created in the previous commit. > > Signed-off-by: Petr Vorel <pvorel@suse.cz> > --- > doc/developers/api_c_tests.rst | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/doc/developers/api_c_tests.rst > b/doc/developers/api_c_tests.rst > index 164f825044..74185c29ec 100644 > --- a/doc/developers/api_c_tests.rst > +++ b/doc/developers/api_c_tests.rst > @@ -37,3 +37,7 @@ Capabilities > libltpswap > ---------- > .. kernel-doc:: ../../include/libswap.h > + > +Temporary directory > +------------------- > +.. kernel-doc:: ../../include/tst_tmpdir.h > -- > 2.45.2 > > > -- > Mailing list info: https://lists.linux.it/listinfo/ltp > > -- Regards, Li Wang -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LTP] [PATCH v3 0/2] lib: Create tst_tmpdir.h 2024-07-12 8:13 [LTP] [PATCH v3 0/2] lib: Create tst_tmpdir.h Petr Vorel 2024-07-12 8:13 ` [LTP] [PATCH v3 1/2] " Petr Vorel 2024-07-12 8:13 ` [LTP] [PATCH v3 2/2] doc/C API: Add tst_tmpdir.h Petr Vorel @ 2024-07-12 9:08 ` Avinesh Kumar 2 siblings, 0 replies; 5+ messages in thread From: Avinesh Kumar @ 2024-07-12 9:08 UTC (permalink / raw) To: Petr Vorel; +Cc: ltp Hi Petr, Reviewed-by: Avinesh Kumar <akumar@suse.de> for both patches. Thank you, Avinesh On Friday, July 12, 2024 10:13:57 AM GMT+2 Petr Vorel wrote: > Hi, > > changes v2->v3: > * Add tst_tmpdir.h also to include/tst_test.h (Avinesh) > * Split doc change into a separate commit > > Petr Vorel (2): > lib: Create tst_tmpdir.h > doc/C API: Add tst_tmpdir.h > > doc/developers/api_c_tests.rst | 4 ++++ > include/tst_device.h | 6 +----- > include/tst_test.h | 1 + > include/tst_tmpdir.h | 19 +++++++++++++++++++ > lib/tst_tmpdir.c | 1 + > 5 files changed, 26 insertions(+), 5 deletions(-) > create mode 100644 include/tst_tmpdir.h > > -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-07-12 9:08 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-07-12 8:13 [LTP] [PATCH v3 0/2] lib: Create tst_tmpdir.h Petr Vorel 2024-07-12 8:13 ` [LTP] [PATCH v3 1/2] " Petr Vorel 2024-07-12 8:13 ` [LTP] [PATCH v3 2/2] doc/C API: Add tst_tmpdir.h Petr Vorel 2024-07-12 8:37 ` Li Wang 2024-07-12 9:08 ` [LTP] [PATCH v3 0/2] lib: Create tst_tmpdir.h Avinesh Kumar
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox