perf tools: Make copyfile_offset() static

There are no usage outside util.c and this is the only remaining reason
for fcntl.h to be included in util.h, to get the loff_t definition in
Alpine Linux, so make it static.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-2dzlsao7k6ihozs5karw6kpx@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 55421b4f
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
* *
* Builtin regression testing command: ever growing number of sanity tests * Builtin regression testing command: ever growing number of sanity tests
*/ */
#include <fcntl.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h>
#include "compress.h" #include "compress.h"
#include "path.h" #include "path.h"
#include "symbol.h" #include "symbol.h"
......
#include <dirent.h> #include <dirent.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h>
#include <inttypes.h> #include <inttypes.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/types.h> #include <linux/types.h>
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <linux/refcount.h> #include <linux/refcount.h>
#include <linux/list.h> #include <linux/list.h>
#include <api/fd/array.h> #include <api/fd/array.h>
#include <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include "../perf.h" #include "../perf.h"
#include "event.h" #include "event.h"
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "event.h" #include "event.h"
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h>
#include <limits.h> #include <limits.h>
#include <sched.h> #include <sched.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#include <linux/compiler.h> #include <linux/compiler.h>
#include <sys/types.h> #include <sys/types.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
#include <stdio.h> #include <stdio.h>
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
* *
*/ */
#include <errno.h> #include <errno.h>
#include <fcntl.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/uio.h> #include <sys/uio.h>
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/utsname.h> #include <sys/utsname.h>
#include <dirent.h> #include <dirent.h>
#include <fcntl.h>
#include <inttypes.h> #include <inttypes.h>
#include <signal.h> #include <signal.h>
#include <stdio.h> #include <stdio.h>
...@@ -174,7 +175,7 @@ static int slow_copyfile(const char *from, const char *to, struct nsinfo *nsi) ...@@ -174,7 +175,7 @@ static int slow_copyfile(const char *from, const char *to, struct nsinfo *nsi)
return err; return err;
} }
int copyfile_offset(int ifd, loff_t off_in, int ofd, loff_t off_out, u64 size) static int copyfile_offset(int ifd, loff_t off_in, int ofd, loff_t off_out, u64 size)
{ {
void *ptr; void *ptr;
loff_t pgoff; loff_t pgoff;
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
/* glibc 2.20 deprecates _BSD_SOURCE in favour of _DEFAULT_SOURCE */ /* glibc 2.20 deprecates _BSD_SOURCE in favour of _DEFAULT_SOURCE */
#define _DEFAULT_SOURCE 1 #define _DEFAULT_SOURCE 1
#include <fcntl.h>
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h> #include <stddef.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -35,7 +34,6 @@ bool lsdir_no_dot_filter(const char *name, struct dirent *d); ...@@ -35,7 +34,6 @@ bool lsdir_no_dot_filter(const char *name, struct dirent *d);
int copyfile(const char *from, const char *to); int copyfile(const char *from, const char *to);
int copyfile_mode(const char *from, const char *to, mode_t mode); int copyfile_mode(const char *from, const char *to, mode_t mode);
int copyfile_ns(const char *from, const char *to, struct nsinfo *nsi); int copyfile_ns(const char *from, const char *to, struct nsinfo *nsi);
int copyfile_offset(int fromfd, loff_t from_ofs, int tofd, loff_t to_ofs, u64 size);
ssize_t readn(int fd, void *buf, size_t n); ssize_t readn(int fd, void *buf, size_t n);
ssize_t writen(int fd, const void *buf, size_t n); ssize_t writen(int fd, const void *buf, size_t n);
......
#include <fcntl.h>
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <sys/stat.h> #include <sys/stat.h>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册