Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jiri Olsa and committed by
Arnaldo Carvalho de Melo
ed93d0a2 ded2b8fe

+3 -1
+1 -1
tools/perf/util/util.c
··· 221 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 226 void *ptr; 227 227 loff_t pgoff;
+2
tools/perf/util/util.h
··· 6 6 /* glibc 2.20 deprecates _BSD_SOURCE in favour of _DEFAULT_SOURCE */ 7 7 #define _DEFAULT_SOURCE 1 8 8 9 + #include <fcntl.h> 9 10 #include <stdbool.h> 10 11 #include <stddef.h> 11 12 #include <stdlib.h> ··· 36 35 int copyfile(const char *from, const char *to); 37 36 int copyfile_mode(const char *from, const char *to, mode_t mode); 38 37 int copyfile_ns(const char *from, const char *to, struct nsinfo *nsi); 38 + int copyfile_offset(int ifd, loff_t off_in, int ofd, loff_t off_out, u64 size); 39 39 40 40 ssize_t readn(int fd, void *buf, size_t n); 41 41 ssize_t writen(int fd, const void *buf, size_t n);