From owner-svn-src-head@freebsd.org Tue Jan 31 15:19:46 2017 Return-Path: Delivered-To: svn-src-head@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 653A4CCA8A1; Tue, 31 Jan 2017 15:19:46 +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 1998BA08; Tue, 31 Jan 2017 15:19:46 +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 v0VFJjke013034; Tue, 31 Jan 2017 15:19:45 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0VFJjTI013032; Tue, 31 Jan 2017 15:19:45 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201701311519.v0VFJjTI013032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 31 Jan 2017 15:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r313016 - in head/sys: compat/freebsd32 kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 15:19:46 -0000 Author: trasz Date: Tue Jan 31 15:19:44 2017 New Revision: 313016 URL: https://svnweb.freebsd.org/changeset/base/313016 Log: Replace calls to sys_truncate() with kern_truncate(). Reviewed by: kib@ MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9371 Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/kern/vfs_syscalls.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Tue Jan 31 15:11:23 2017 (r313015) +++ head/sys/compat/freebsd32/freebsd32_misc.c Tue Jan 31 15:19:44 2017 (r313016) @@ -1500,11 +1500,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 @@ -1600,11 +1598,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: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Tue Jan 31 15:11:23 2017 (r313015) +++ head/sys/kern/vfs_syscalls.c Tue Jan 31 15:19:44 2017 (r313016) @@ -3310,22 +3310,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 */ @@ -3334,11 +3322,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