mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-06-14 20:02:04 +08:00
xfsprogs:fir copy_file_range api
This commit is contained in:
parent
dcc9b1d8f7
commit
7b2d0caa3f
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=xfsprogs
|
PKG_NAME:=xfsprogs
|
||||||
PKG_CPE_ID:=cpe:/a:sgi:xfsprogs
|
PKG_CPE_ID:=cpe:/a:sgi:xfsprogs
|
||||||
PKG_RELEASE:=2
|
PKG_RELEASE:=4
|
||||||
PKG_VERSION:=4.11.0
|
PKG_VERSION:=4.11.0
|
||||||
PKG_SOURCE_URL:=@KERNEL/linux/utils/fs/xfs/xfsprogs
|
PKG_SOURCE_URL:=@KERNEL/linux/utils/fs/xfs/xfsprogs
|
||||||
PKG_HASH:=c3a6d87b564d7738243c507df82276bed982265e345363a95f2c764e8a5f5bb2
|
PKG_HASH:=c3a6d87b564d7738243c507df82276bed982265e345363a95f2c764e8a5f5bb2
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
From 930f9aa8f08759fa739dd6e615ba8b3a1890008d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Rosen Penev <rosenp@gmail.com>
|
||||||
|
Date: Mon, 6 May 2019 13:56:13 -0700
|
||||||
|
Subject: [PATCH] db/malloc: Use posix_memalign instead of deprecated valloc
|
||||||
|
|
||||||
|
valloc is not available with uClibc-ng as well as being deprecated, which
|
||||||
|
causes compilation errors. aligned_alloc is not available before C11 so
|
||||||
|
used posix_memalign.'
|
||||||
|
|
||||||
|
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
||||||
|
---
|
||||||
|
db/malloc.c | 3 +--
|
||||||
|
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||||
|
|
||||||
|
--- a/db/malloc.c
|
||||||
|
+++ b/db/malloc.c
|
||||||
|
@@ -56,8 +56,7 @@ xmalloc(
|
||||||
|
{
|
||||||
|
void *ptr;
|
||||||
|
|
||||||
|
- ptr = valloc(size);
|
||||||
|
- if (ptr)
|
||||||
|
+ if(!posix_memalign(&ptr, sysconf(_SC_PAGESIZE), size))
|
||||||
|
return ptr;
|
||||||
|
badmalloc();
|
||||||
|
/* NOTREACHED */
|
48
package/utils/xfsprogs/patches/140-copy-file-range.patch
Normal file
48
package/utils/xfsprogs/patches/140-copy-file-range.patch
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
From 8041435de7ed028a27ecca64302945ad455c69a6 Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Darrick J. Wong" <darrick.wong@oracle.com>
|
||||||
|
Date: Mon, 5 Feb 2018 14:38:02 -0600
|
||||||
|
Subject: [PATCH] xfs_io: fix copy_file_range symbol name collision
|
||||||
|
|
||||||
|
glibc 2.27 has a copy_file_range wrapper, so we need to change our
|
||||||
|
internal function out of the way to avoid compiler warnings.
|
||||||
|
|
||||||
|
Reported-by: fredrik@crux.nu
|
||||||
|
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
||||||
|
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
|
||||||
|
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
|
||||||
|
---
|
||||||
|
io/copy_file_range.c | 11 ++++++++---
|
||||||
|
1 file changed, 8 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
--- a/io/copy_file_range.c
|
||||||
|
+++ b/io/copy_file_range.c
|
||||||
|
@@ -42,13 +42,18 @@ copy_range_help(void)
|
||||||
|
"));
|
||||||
|
}
|
||||||
|
|
||||||
|
+/*
|
||||||
|
+ * Issue a raw copy_file_range syscall; for our test program we don't want the
|
||||||
|
+ * glibc buffered copy fallback.
|
||||||
|
+ */
|
||||||
|
static loff_t
|
||||||
|
-copy_file_range(int fd, loff_t *src, loff_t *dst, size_t len)
|
||||||
|
+copy_file_range_cmd(int fd, loff_t *src, loff_t *dst, size_t len)
|
||||||
|
{
|
||||||
|
loff_t ret;
|
||||||
|
|
||||||
|
do {
|
||||||
|
- ret = syscall(__NR_copy_file_range, fd, src, file->fd, dst, len, 0);
|
||||||
|
+ ret = syscall(__NR_copy_file_range, fd, src, file->fd, dst,
|
||||||
|
+ len, 0);
|
||||||
|
if (ret == -1) {
|
||||||
|
perror("copy_range");
|
||||||
|
return errno;
|
||||||
|
@@ -130,7 +135,7 @@ copy_range_f(int argc, char **argv)
|
||||||
|
copy_dst_truncate();
|
||||||
|
}
|
||||||
|
|
||||||
|
- ret = copy_file_range(fd, &src, &dst, len);
|
||||||
|
+ ret = copy_file_range_cmd(fd, &src, &dst, len);
|
||||||
|
close(fd);
|
||||||
|
return ret;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user