[PATCH 1/2] filesetup: make longest_existing_path() static and const-correct
Tomas Winkler <[email protected]> Thu, 31 Jul 2025 15:20:10 +0300
| Newsgroups | org.kernel.vger.fio |
|---|---|
| Message-ID | <[email protected]> |
Mark longest_existing_path() as static since it is only used within filesetup.c. Also, declare the 'path' parameter as const char * because it is not modified within the function. Signed-off-by: Tomas Winkler [email protected] --- filesetup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/filesetup.c b/filesetup.c index a94d3b38..bcbd871e 100644 --- a/filesetup.c +++ b/filesetup.c @@ -1002,7 +1002,8 @@ uint64_t get_start_offset(struct thread_data *td, struct fio_file *f) /* * Find longest path component that exists and return its length */ -int longest_existing_path(char *path) { +static int longest_existing_path(const char *path) +{ char buf[PATH_MAX]; bool done; char *buf_pos; -- 2.45.2