diff options
| author | Jiri Olsa <jolsa@kernel.org> | 2018-09-13 08:54:11 -0400 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-09-19 09:25:12 -0400 |
| commit | ed93d0a26012a4a12231c16b18628a324079dc45 (patch) | |
| tree | ae7837b78747c58f4de3b6aff43899e762675fb9 | |
| parent | ded2b8fe2e431d8029ab50238744fcce06a2f0c6 (diff) | |
perf util: Make copyfile_offset() global
It will be used outside of util object in following patches.
Committer note:
We need to have the header with the definition for loff_t in util.h
since we now use it in the copyfile_offset() signature.
Also move that prototype closer to the other copyfile_ prefixed
functions.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180913125450.21342-10-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
| -rw-r--r-- | tools/perf/util/util.c | 2 | ||||
| -rw-r--r-- | tools/perf/util/util.h | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c index eac5b858a371..093352e93d50 100644 --- a/tools/perf/util/util.c +++ b/tools/perf/util/util.c | |||
| @@ -221,7 +221,7 @@ out: | |||
| 221 | return err; | 221 | return err; |
| 222 | } | 222 | } |
| 223 | 223 | ||
| 224 | static int copyfile_offset(int ifd, loff_t off_in, int ofd, loff_t off_out, u64 size) | 224 | int copyfile_offset(int ifd, loff_t off_in, int ofd, loff_t off_out, u64 size) |
| 225 | { | 225 | { |
| 226 | void *ptr; | 226 | void *ptr; |
| 227 | loff_t pgoff; | 227 | loff_t pgoff; |
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h index dc58254a2b69..14508ee7707a 100644 --- a/tools/perf/util/util.h +++ b/tools/perf/util/util.h | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | /* glibc 2.20 deprecates _BSD_SOURCE in favour of _DEFAULT_SOURCE */ | 6 | /* glibc 2.20 deprecates _BSD_SOURCE in favour of _DEFAULT_SOURCE */ |
| 7 | #define _DEFAULT_SOURCE 1 | 7 | #define _DEFAULT_SOURCE 1 |
| 8 | 8 | ||
| 9 | #include <fcntl.h> | ||
| 9 | #include <stdbool.h> | 10 | #include <stdbool.h> |
| 10 | #include <stddef.h> | 11 | #include <stddef.h> |
| 11 | #include <stdlib.h> | 12 | #include <stdlib.h> |
| @@ -35,6 +36,7 @@ bool lsdir_no_dot_filter(const char *name, struct dirent *d); | |||
| 35 | int copyfile(const char *from, const char *to); | 36 | int copyfile(const char *from, const char *to); |
| 36 | int copyfile_mode(const char *from, const char *to, mode_t mode); | 37 | int copyfile_mode(const char *from, const char *to, mode_t mode); |
| 37 | int copyfile_ns(const char *from, const char *to, struct nsinfo *nsi); | 38 | int copyfile_ns(const char *from, const char *to, struct nsinfo *nsi); |
| 39 | int copyfile_offset(int ifd, loff_t off_in, int ofd, loff_t off_out, u64 size); | ||
| 38 | 40 | ||
| 39 | ssize_t readn(int fd, void *buf, size_t n); | 41 | ssize_t readn(int fd, void *buf, size_t n); |
| 40 | ssize_t writen(int fd, const void *buf, size_t n); | 42 | ssize_t writen(int fd, const void *buf, size_t n); |
