From owner-svn-src-stable@freebsd.org Sun Mar 19 14:40:03 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2204AD13E88; Sun, 19 Mar 2017 14:40:03 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB2C3B20; Sun, 19 Mar 2017 14:40:02 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2JEe1ib069839; Sun, 19 Mar 2017 14:40:01 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2JEe15w069837; Sun, 19 Mar 2017 14:40:01 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201703191440.v2JEe15w069837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 19 Mar 2017 14:40:01 +0000 (UTC) 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 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Mar 2017 14:40:03 -0000 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