Add sync_file_range(2) implementation to linux(4); it's a thin wrapper
over the usual fsync(2). This silences some warnings when running "apt-get upgrade". Reviewed by: brooks, emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22371
This commit is contained in:
parent
0cde2b3239
commit
cf69fe66d4
@ -99,7 +99,6 @@ DUMMY(migrate_pages);
|
|||||||
DUMMY(unshare);
|
DUMMY(unshare);
|
||||||
/* Linux 2.6.17: */
|
/* Linux 2.6.17: */
|
||||||
DUMMY(splice);
|
DUMMY(splice);
|
||||||
DUMMY(sync_file_range);
|
|
||||||
DUMMY(tee);
|
DUMMY(tee);
|
||||||
DUMMY(vmsplice);
|
DUMMY(vmsplice);
|
||||||
/* Linux 2.6.18: */
|
/* Linux 2.6.18: */
|
||||||
|
@ -105,7 +105,6 @@ DUMMY(migrate_pages);
|
|||||||
DUMMY(unshare);
|
DUMMY(unshare);
|
||||||
/* Linux 2.6.17: */
|
/* Linux 2.6.17: */
|
||||||
DUMMY(splice);
|
DUMMY(splice);
|
||||||
DUMMY(sync_file_range);
|
|
||||||
DUMMY(tee);
|
DUMMY(tee);
|
||||||
DUMMY(vmsplice);
|
DUMMY(vmsplice);
|
||||||
/* Linux 2.6.18: */
|
/* Linux 2.6.18: */
|
||||||
|
@ -101,7 +101,6 @@ DUMMY(migrate_pages);
|
|||||||
DUMMY(unshare);
|
DUMMY(unshare);
|
||||||
/* Linux 2.6.17: */
|
/* Linux 2.6.17: */
|
||||||
DUMMY(splice);
|
DUMMY(splice);
|
||||||
DUMMY(sync_file_range);
|
|
||||||
DUMMY(tee);
|
DUMMY(tee);
|
||||||
DUMMY(vmsplice);
|
DUMMY(vmsplice);
|
||||||
/* Linux 2.6.18: */
|
/* Linux 2.6.18: */
|
||||||
|
@ -907,6 +907,22 @@ linux_fdatasync(td, uap)
|
|||||||
return (kern_fsync(td, uap->fd, false));
|
return (kern_fsync(td, uap->fd, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
linux_sync_file_range(td, uap)
|
||||||
|
struct thread *td;
|
||||||
|
struct linux_sync_file_range_args *uap;
|
||||||
|
{
|
||||||
|
|
||||||
|
if (uap->offset < 0 || uap->nbytes < 0 ||
|
||||||
|
(uap->flags & ~(LINUX_SYNC_FILE_RANGE_WAIT_BEFORE |
|
||||||
|
LINUX_SYNC_FILE_RANGE_WRITE |
|
||||||
|
LINUX_SYNC_FILE_RANGE_WAIT_AFTER)) != 0) {
|
||||||
|
return (EINVAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (kern_fsync(td, uap->fd, false));
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
linux_pread(struct thread *td, struct linux_pread_args *uap)
|
linux_pread(struct thread *td, struct linux_pread_args *uap)
|
||||||
{
|
{
|
||||||
|
@ -134,4 +134,11 @@
|
|||||||
#define LINUX_RENAME_EXCHANGE 0x00000002
|
#define LINUX_RENAME_EXCHANGE 0x00000002
|
||||||
#define LINUX_RENAME_WHITEOUT 0x00000004
|
#define LINUX_RENAME_WHITEOUT 0x00000004
|
||||||
|
|
||||||
|
/*
|
||||||
|
* sync_file_range flags
|
||||||
|
*/
|
||||||
|
#define LINUX_SYNC_FILE_RANGE_WAIT_BEFORE 1
|
||||||
|
#define LINUX_SYNC_FILE_RANGE_WRITE 2
|
||||||
|
#define LINUX_SYNC_FILE_RANGE_WAIT_AFTER 4
|
||||||
|
|
||||||
#endif /* !_LINUX_FILE_H_ */
|
#endif /* !_LINUX_FILE_H_ */
|
||||||
|
@ -101,7 +101,6 @@ DUMMY(migrate_pages);
|
|||||||
DUMMY(unshare);
|
DUMMY(unshare);
|
||||||
/* Linux 2.6.17: */
|
/* Linux 2.6.17: */
|
||||||
DUMMY(splice);
|
DUMMY(splice);
|
||||||
DUMMY(sync_file_range);
|
|
||||||
DUMMY(tee);
|
DUMMY(tee);
|
||||||
DUMMY(vmsplice);
|
DUMMY(vmsplice);
|
||||||
/* Linux 2.6.18: */
|
/* Linux 2.6.18: */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user