1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-01 10:06:57 +03:00

Consolidate Linux sync_file_range implementations

This patch consolidates all the sync_file_range implementation for Linux
in only one (sysdeps/unix/sysv/linux/sync_file_range.c).  It also removes
the syscall from the auto-generation using assembly macros (except for
x86_64 due x32 [1]).

For current minimum supported kernel (2.6.32 for x86_64 and 3.2 for all
other architectures) either sync_file_range or sync_file_range2 is supported
and it is expected that any future Linux ABI will provide either of one
syscall.  So the code path that returns ENOSYS in the case of missing
syscall is removed.

Checked on x86_64, i386, powerpc64le, aarch64, and armhf.

	* sysdeps/unix/sysv/linux/Makefile (tests): Add tst-sync_file_range.
	* sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c: Remove file.
	* sysdeps/sysv/linux/powerpc/powerpc64/sync_file_range.c: Likewise.
	* sysdeps/unix/sysv/linux/sync_file_range.c: New file.
	* sysdeps/unix/sysv/linux/tst-sync_file_range.c (sync_file_range):
	Consolidate all Linux implementations.

[1] https://patchwork.ozlabs.org/patch/659794/
This commit is contained in:
Adhemerval Zanella
2016-10-04 11:57:38 -03:00
parent bf8c542403
commit 5da2c626a5
8 changed files with 150 additions and 94 deletions

View File

@ -1,33 +0,0 @@
/* Selective file content synch'ing.
Copyright (C) 2006-2016 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library. If not, see
<http://www.gnu.org/licenses/>. */
#include <errno.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sysdep-cancel.h>
#include <sys/syscall.h>
int
sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
{
return SYSCALL_CANCEL (sync_file_range, fd, 0,
__LONG_LONG_PAIR ((long) (from >> 32), (long) from),
__LONG_LONG_PAIR ((long) (to >> 32), (long) to),
flags);
}

View File

@ -3,7 +3,6 @@
mmap64 - mmap b:aniiii __mmap64 mmap64
readahead - readahead i:iii __readahead readahead
sync_file_range - sync_file_range Ci:iiii sync_file_range
prlimit64 EXTRA prlimit64 i:iipp prlimit64

View File

@ -2,8 +2,6 @@
mmap - mmap b:aniiii __mmap mmap __mmap64 mmap64
sync_file_range - sync_file_range Ci:iiii sync_file_range
prlimit EXTRA prlimit64 i:iipp prlimit prlimit64
fanotify_mark EXTRA fanotify_mark i:iiiis fanotify_mark