Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Jan 2017 11:50:54 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r312986 - in head/sys: amd64/linux32 compat/freebsd32 compat/linux i386/linux kern
Message-ID:  <201701301150.v0UBoswd037616@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Mon Jan 30 11:50:54 2017
New Revision: 312986
URL: https://svnweb.freebsd.org/changeset/base/312986

Log:
  Replace sys_ftruncate() with kern_ftruncate() in various compats.
  
  Reviewed by:	kib@
  MFC after:	2 weeks
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D9368

Modified:
  head/sys/amd64/linux32/linux32_machdep.c
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/compat/linux/linux_file.c
  head/sys/i386/linux/linux_machdep.c
  head/sys/kern/vfs_syscalls.c

Modified: head/sys/amd64/linux32/linux32_machdep.c
==============================================================================
--- head/sys/amd64/linux32/linux32_machdep.c	Mon Jan 30 11:46:06 2017	(r312985)
+++ head/sys/amd64/linux32/linux32_machdep.c	Mon Jan 30 11:50:54 2017	(r312986)
@@ -645,7 +645,6 @@ linux_sigaltstack(struct thread *td, str
 int
 linux_ftruncate64(struct thread *td, struct linux_ftruncate64_args *args)
 {
-	struct ftruncate_args sa;
 
 #ifdef DEBUG
 	if (ldebug(ftruncate64))
@@ -653,9 +652,7 @@ linux_ftruncate64(struct thread *td, str
 		    (intmax_t)args->length);
 #endif
 
-	sa.fd = args->fd;
-	sa.length = args->length;
-	return sys_ftruncate(td, &sa);
+	return (kern_ftruncate(td, args->fd, args->length));
 }
 
 int

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_misc.c	Mon Jan 30 11:46:06 2017	(r312985)
+++ head/sys/compat/freebsd32/freebsd32_misc.c	Mon Jan 30 11:50:54 2017	(r312986)
@@ -1517,11 +1517,8 @@ freebsd32_truncate(struct thread *td, st
 int
 freebsd32_ftruncate(struct thread *td, struct freebsd32_ftruncate_args *uap)
 {
-	struct ftruncate_args ap;
 
-	ap.fd = uap->fd;
-	ap.length = PAIR32TO64(off_t,uap->length);
-	return (sys_ftruncate(td, &ap));
+	return (kern_ftruncate(td, uap->fd, PAIR32TO64(off_t, uap->length)));
 }
 
 #ifdef COMPAT_43
@@ -1623,11 +1620,8 @@ freebsd6_freebsd32_truncate(struct threa
 int
 freebsd6_freebsd32_ftruncate(struct thread *td, struct freebsd6_freebsd32_ftruncate_args *uap)
 {
-	struct ftruncate_args ap;
 
-	ap.fd = uap->fd;
-	ap.length = PAIR32TO64(off_t,uap->length);
-	return (sys_ftruncate(td, &ap));
+	return (kern_ftruncate(td, uap->fd, PAIR32TO64(off_t, uap->length)));
 }
 #endif /* COMPAT_FREEBSD6 */
 

Modified: head/sys/compat/linux/linux_file.c
==============================================================================
--- head/sys/compat/linux/linux_file.c	Mon Jan 30 11:46:06 2017	(r312985)
+++ head/sys/compat/linux/linux_file.c	Mon Jan 30 11:50:54 2017	(r312986)
@@ -939,15 +939,8 @@ linux_truncate64(struct thread *td, stru
 int
 linux_ftruncate(struct thread *td, struct linux_ftruncate_args *args)
 {
-	struct ftruncate_args /* {
-		int fd;
-		int pad;
-		off_t length;
-		} */ nuap;
-
-	nuap.fd = args->fd;
-	nuap.length = args->length;
-	return (sys_ftruncate(td, &nuap));
+
+	return (kern_ftruncate(td, args->fd, args->length));
 }
 
 int

Modified: head/sys/i386/linux/linux_machdep.c
==============================================================================
--- head/sys/i386/linux/linux_machdep.c	Mon Jan 30 11:46:06 2017	(r312985)
+++ head/sys/i386/linux/linux_machdep.c	Mon Jan 30 11:50:54 2017	(r312986)
@@ -611,7 +611,6 @@ linux_sigaltstack(struct thread *td, str
 int
 linux_ftruncate64(struct thread *td, struct linux_ftruncate64_args *args)
 {
-	struct ftruncate_args sa;
 
 #ifdef DEBUG
 	if (ldebug(ftruncate64))
@@ -619,9 +618,7 @@ linux_ftruncate64(struct thread *td, str
 		    (intmax_t)args->length);
 #endif
 
-	sa.fd = args->fd;
-	sa.length = args->length;
-	return sys_ftruncate(td, &sa);
+	return (kern_ftruncate(td, args->fd, args->length));
 }
 
 int

Modified: head/sys/kern/vfs_syscalls.c
==============================================================================
--- head/sys/kern/vfs_syscalls.c	Mon Jan 30 11:46:06 2017	(r312985)
+++ head/sys/kern/vfs_syscalls.c	Mon Jan 30 11:50:54 2017	(r312986)
@@ -3365,11 +3365,8 @@ freebsd6_truncate(struct thread *td, str
 int
 freebsd6_ftruncate(struct thread *td, struct freebsd6_ftruncate_args *uap)
 {
-	struct ftruncate_args ouap;
 
-	ouap.fd = uap->fd;
-	ouap.length = uap->length;
-	return (sys_ftruncate(td, &ouap));
+	return (kern_ftruncate(td, uap->fd, uap->length));
 }
 #endif
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701301150.v0UBoswd037616>