Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Mar 2017 14:40:01 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r315551 - in stable/11/sys: compat/freebsd32 kern
Message-ID:  <201703191440.v2JEe15w069837@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Sun Mar 19 14:40:01 2017
New Revision: 315551
URL: https://svnweb.freebsd.org/changeset/base/315551

Log:
  MFC r313016:
  
  Replace calls to sys_truncate() with kern_truncate().
  
  Sponsored by:	DARPA, AFRL

Modified:
  stable/11/sys/compat/freebsd32/freebsd32_misc.c
  stable/11/sys/kern/vfs_syscalls.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- stable/11/sys/compat/freebsd32/freebsd32_misc.c	Sun Mar 19 14:36:19 2017	(r315550)
+++ stable/11/sys/compat/freebsd32/freebsd32_misc.c	Sun Mar 19 14:40:01 2017	(r315551)
@@ -1490,11 +1490,9 @@ freebsd32_lseek(struct thread *td, struc
 int
 freebsd32_truncate(struct thread *td, struct freebsd32_truncate_args *uap)
 {
-	struct truncate_args ap;
 
-	ap.path = uap->path;
-	ap.length = PAIR32TO64(off_t,uap->length);
-	return (sys_truncate(td, &ap));
+	return (kern_truncate(td, uap->path, UIO_USERSPACE,
+	    PAIR32TO64(off_t, uap->length)));
 }
 
 int
@@ -1590,11 +1588,9 @@ freebsd6_freebsd32_lseek(struct thread *
 int
 freebsd6_freebsd32_truncate(struct thread *td, struct freebsd6_freebsd32_truncate_args *uap)
 {
-	struct truncate_args ap;
 
-	ap.path = uap->path;
-	ap.length = PAIR32TO64(off_t,uap->length);
-	return (sys_truncate(td, &ap));
+	return (kern_truncate(td, uap->path, UIO_USERSPACE,
+	    PAIR32TO64(off_t, uap->length)));
 }
 
 int

Modified: stable/11/sys/kern/vfs_syscalls.c
==============================================================================
--- stable/11/sys/kern/vfs_syscalls.c	Sun Mar 19 14:36:19 2017	(r315550)
+++ stable/11/sys/kern/vfs_syscalls.c	Sun Mar 19 14:40:01 2017	(r315551)
@@ -3308,22 +3308,10 @@ struct otruncate_args {
 };
 #endif
 int
-otruncate(td, uap)
-	struct thread *td;
-	register struct otruncate_args /* {
-		char *path;
-		long length;
-	} */ *uap;
+otruncate(struct thread *td, struct otruncate_args *uap)
 {
-	struct truncate_args /* {
-		char *path;
-		int pad;
-		off_t length;
-	} */ nuap;
-
-	nuap.path = uap->path;
-	nuap.length = uap->length;
-	return (sys_truncate(td, &nuap));
+
+	return (kern_truncate(td, uap->path, UIO_USERSPACE, uap->length));
 }
 #endif /* COMPAT_43 */
 
@@ -3332,11 +3320,8 @@ otruncate(td, uap)
 int
 freebsd6_truncate(struct thread *td, struct freebsd6_truncate_args *uap)
 {
-	struct truncate_args ouap;
 
-	ouap.path = uap->path;
-	ouap.length = uap->length;
-	return (sys_truncate(td, &ouap));
+	return (kern_truncate(td, uap->path, UIO_USERSPACE, uap->length));
 }
 
 int



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