Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 May 2015 17:33:22 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r283465 - in head/sys: amd64/linux amd64/linux32 compat/linux i386/linux
Message-ID:  <201505241733.t4OHXMsW024357@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Sun May 24 17:33:21 2015
New Revision: 283465
URL: https://svnweb.freebsd.org/changeset/base/283465

Log:
  Add preliminary fallocate system call implementation
  to emulate posix_fallocate() function.
  
  Differential Revision:	https://reviews.freebsd.org/D1523
  Reviewed by:	emaste

Modified:
  head/sys/amd64/linux/linux_dummy.c
  head/sys/amd64/linux/syscalls.master
  head/sys/amd64/linux32/linux32_dummy.c
  head/sys/amd64/linux32/syscalls.master
  head/sys/compat/linux/linux_file.c
  head/sys/i386/linux/linux_dummy.c
  head/sys/i386/linux/syscalls.master

Modified: head/sys/amd64/linux/linux_dummy.c
==============================================================================
--- head/sys/amd64/linux/linux_dummy.c	Sun May 24 17:30:31 2015	(r283464)
+++ head/sys/amd64/linux/linux_dummy.c	Sun May 24 17:33:21 2015	(r283465)
@@ -102,7 +102,6 @@ DUMMY(utimensat);
 DUMMY(epoll_pwait);
 DUMMY(signalfd);
 DUMMY(timerfd);
-DUMMY(fallocate);
 DUMMY(timerfd_settime);
 DUMMY(timerfd_gettime);
 DUMMY(signalfd4);

Modified: head/sys/amd64/linux/syscalls.master
==============================================================================
--- head/sys/amd64/linux/syscalls.master	Sun May 24 17:30:31 2015	(r283464)
+++ head/sys/amd64/linux/syscalls.master	Sun May 24 17:33:21 2015	(r283465)
@@ -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: head/sys/amd64/linux32/linux32_dummy.c
==============================================================================
--- head/sys/amd64/linux32/linux32_dummy.c	Sun May 24 17:30:31 2015	(r283464)
+++ head/sys/amd64/linux32/linux32_dummy.c	Sun May 24 17:33:21 2015	(r283465)
@@ -107,8 +107,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: head/sys/amd64/linux32/syscalls.master
==============================================================================
--- head/sys/amd64/linux32/syscalls.master	Sun May 24 17:30:31 2015	(r283464)
+++ head/sys/amd64/linux32/syscalls.master	Sun May 24 17:33:21 2015	(r283465)
@@ -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: head/sys/compat/linux/linux_file.c
==============================================================================
--- head/sys/compat/linux/linux_file.c	Sun May 24 17:30:31 2015	(r283464)
+++ head/sys/compat/linux/linux_file.c	Sun May 24 17:33:21 2015	(r283465)
@@ -1636,3 +1636,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: head/sys/i386/linux/linux_dummy.c
==============================================================================
--- head/sys/i386/linux/linux_dummy.c	Sun May 24 17:30:31 2015	(r283464)
+++ head/sys/i386/linux/linux_dummy.c	Sun May 24 17:33:21 2015	(r283465)
@@ -103,8 +103,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: head/sys/i386/linux/syscalls.master
==============================================================================
--- head/sys/i386/linux/syscalls.master	Sun May 24 17:30:31 2015	(r283464)
+++ head/sys/i386/linux/syscalls.master	Sun May 24 17:33:21 2015	(r283465)
@@ -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); }



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