From owner-svn-src-stable-10@freebsd.org Sat Jan 9 17:13:44 2016 Return-Path: Delivered-To: svn-src-stable-10@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 F285AA68D0F; Sat, 9 Jan 2016 17:13:44 +0000 (UTC) (envelope-from dchagin@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 B4CFE110D; Sat, 9 Jan 2016 17:13:44 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u09HDhTQ054566; Sat, 9 Jan 2016 17:13:43 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u09HDhZK054558; Sat, 9 Jan 2016 17:13:43 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201601091713.u09HDhZK054558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 9 Jan 2016 17:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r293567 - in stable/10/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jan 2016 17:13:45 -0000 Author: dchagin Date: Sat Jan 9 17:13:43 2016 New Revision: 293567 URL: https://svnweb.freebsd.org/changeset/base/293567 Log: MFC r283465: Add preliminary fallocate system call implementation to emulate posix_fallocate() function. Modified: stable/10/sys/amd64/linux/linux_dummy.c stable/10/sys/amd64/linux/syscalls.master stable/10/sys/amd64/linux32/linux32_dummy.c stable/10/sys/amd64/linux32/syscalls.master stable/10/sys/compat/linux/linux_file.c stable/10/sys/i386/linux/linux_dummy.c stable/10/sys/i386/linux/syscalls.master Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/linux/linux_dummy.c ============================================================================== --- stable/10/sys/amd64/linux/linux_dummy.c Sat Jan 9 17:12:45 2016 (r293566) +++ stable/10/sys/amd64/linux/linux_dummy.c Sat Jan 9 17:13:43 2016 (r293567) @@ -102,7 +102,6 @@ DUMMY(utimensat); DUMMY(epoll_pwait); DUMMY(signalfd); DUMMY(timerfd); -DUMMY(fallocate); DUMMY(timerfd_settime); DUMMY(timerfd_gettime); DUMMY(signalfd4); Modified: stable/10/sys/amd64/linux/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux/syscalls.master Sat Jan 9 17:12:45 2016 (r293566) +++ stable/10/sys/amd64/linux/syscalls.master Sat Jan 9 17:13:43 2016 (r293567) @@ -474,7 +474,8 @@ 282 AUE_NULL STD { int linux_signalfd(void); } 283 AUE_NULL STD { int linux_timerfd(void); } 284 AUE_NULL STD { int linux_eventfd(l_uint initval); } -285 AUE_NULL STD { int linux_fallocate(void); } +285 AUE_NULL STD { int linux_fallocate(l_int fd, l_int mode, \ + l_loff_t offset, l_loff_t len); } 286 AUE_NULL STD { int linux_timerfd_settime(void); } 287 AUE_NULL STD { int linux_timerfd_gettime(void); } 288 AUE_ACCEPT STD { int linux_accept4(l_int s, l_uintptr_t addr, \ Modified: stable/10/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 17:12:45 2016 (r293566) +++ stable/10/sys/amd64/linux32/linux32_dummy.c Sat Jan 9 17:13:43 2016 (r293567) @@ -108,8 +108,6 @@ DUMMY(epoll_pwait); DUMMY(utimensat); DUMMY(signalfd); DUMMY(timerfd_create); -/* linux 2.6.23: */ -DUMMY(fallocate); /* linux 2.6.25: */ DUMMY(timerfd_settime); DUMMY(timerfd_gettime); Modified: stable/10/sys/amd64/linux32/syscalls.master ============================================================================== --- stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 17:12:45 2016 (r293566) +++ stable/10/sys/amd64/linux32/syscalls.master Sat Jan 9 17:13:43 2016 (r293567) @@ -538,7 +538,8 @@ 322 AUE_NULL STD { int linux_timerfd_create(void); } 323 AUE_NULL STD { int linux_eventfd(l_uint initval); } ; linux 2.6.23: -324 AUE_NULL STD { int linux_fallocate(void); } +324 AUE_NULL STD { int linux_fallocate(l_int fd, l_int mode, \ + l_loff_t offset, l_loff_t len); } ; linux 2.6.25: 325 AUE_NULL STD { int linux_timerfd_settime(void); } 326 AUE_NULL STD { int linux_timerfd_gettime(void); } Modified: stable/10/sys/compat/linux/linux_file.c ============================================================================== --- stable/10/sys/compat/linux/linux_file.c Sat Jan 9 17:12:45 2016 (r293566) +++ stable/10/sys/compat/linux/linux_file.c Sat Jan 9 17:13:43 2016 (r293567) @@ -1628,3 +1628,18 @@ linux_dup3(struct thread *td, struct lin newfd = args->newfd; return (kern_fcntl(td, args->oldfd, cmd, newfd)); } + +int +linux_fallocate(struct thread *td, struct linux_fallocate_args *args) +{ + + /* + * We emulate only posix_fallocate system call for which + * mode should be 0. + */ + if (args->mode != 0) + return (ENOSYS); + + return (kern_posix_fallocate(td, args->fd, args->offset, + args->len)); +} Modified: stable/10/sys/i386/linux/linux_dummy.c ============================================================================== --- stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 17:12:45 2016 (r293566) +++ stable/10/sys/i386/linux/linux_dummy.c Sat Jan 9 17:13:43 2016 (r293567) @@ -104,8 +104,6 @@ DUMMY(epoll_pwait); DUMMY(utimensat); DUMMY(signalfd); DUMMY(timerfd_create); -/* linux 2.6.23: */ -DUMMY(fallocate); /* linux 2.6.25: */ DUMMY(timerfd_settime); DUMMY(timerfd_gettime); Modified: stable/10/sys/i386/linux/syscalls.master ============================================================================== --- stable/10/sys/i386/linux/syscalls.master Sat Jan 9 17:12:45 2016 (r293566) +++ stable/10/sys/i386/linux/syscalls.master Sat Jan 9 17:13:43 2016 (r293567) @@ -546,7 +546,8 @@ 322 AUE_NULL STD { int linux_timerfd_create(void); } 323 AUE_NULL STD { int linux_eventfd(l_uint initval); } ; linux 2.6.23: -324 AUE_NULL STD { int linux_fallocate(void); } +324 AUE_NULL STD { int linux_fallocate(l_int fd, l_int mode, \ + l_loff_t offset, l_loff_t len); } ; linux 2.6.25: 325 AUE_NULL STD { int linux_timerfd_settime(void); } 326 AUE_NULL STD { int linux_timerfd_gettime(void); }