From patchwork Thu Feb 16 14:22:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 728715 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vPJsS6TTdz9s8T for ; Fri, 17 Feb 2017 01:47:24 +1100 (AEDT) Received: from localhost ([::1]:47107 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ceNL7-0004AK-Re for incoming@patchwork.ozlabs.org; Thu, 16 Feb 2017 09:47:21 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ceMxe-000390-PT for qemu-devel@nongnu.org; Thu, 16 Feb 2017 09:23:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ceMxa-0002Tk-LR for qemu-devel@nongnu.org; Thu, 16 Feb 2017 09:23:06 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:60638) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ceMxa-0002TK-An for qemu-devel@nongnu.org; Thu, 16 Feb 2017 09:23:02 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.183]) with ESMTPSA (Nemesis) id 0MMF5h-1cja1726jl-007zKH; Thu, 16 Feb 2017 15:22:40 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Date: Thu, 16 Feb 2017 15:22:27 +0100 Message-Id: <20170216142227.27448-15-laurent@vivier.eu> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170216142227.27448-1-laurent@vivier.eu> References: <20170216142227.27448-1-laurent@vivier.eu> X-Provags-ID: V03:K0:0FUiXclIW5obkXOwDgT2VrnRoIY19zpve40YMQhA/G8TUrxgp5a G7qAqPICp23FP3NtRAYsLb4+aMB1tOOupF7FcTBbkNGk885+RT0Jd/W7IDHaC9J3io3BBCc B14i6OdVf5oIUKo1C6u3G9T/b2tnselIQ4+rcLLiEr5NLmNR4UnDHi/O7hNlL9vnOK11Ky1 5+9DJuNH1iTfzSr5mlAyA== X-UI-Out-Filterresults: notjunk:1; V01:K0:nRzi03Uwp8U=:NxeZutcZ7/Ma/c2fEuaLUk kjmLPU4mNYAVyyA6pOOieeZ2uKdf4OUsB+JHnLHTdVovGXe5lYOZPjoHq8JOC6rO4sMhxZluR GL56ojFQ/xzqKP2OBPsFPrrrZt/56oTbEYJBdbADQ/7vjIO+AaNFOvJT44SpcIgWuJiDnu65S R6BVYzP69lMDR+hY1FBU32bYrdtvYw1y94aDvKSrUH7IDQnXxjYRa2UjzsSyZesWxCgLLk+xO mLskLA3+Hk4Q9WuijJorI4WAwOCuilfhZ0kY+ACJs6k6pvl41YH0hGC1MO6jsbR06xsPaeslT zqSTVgCNZydM6y2Jw3tOz9dgLba/1G5NsvGPefHl0TM6NJfq/Iy8UNSSFi4Ou0Mx41TAKjpfa R2Kpk/sAinzrK8rrjIa+4lhgcgGlFLd0j9mP0QuA71+nZN0rA5X7djAmY5r/hbukjVwoHfRg+ UoRYCsv6M6bWwqbrM3YqbwVCkToLa3dKovsId0vWIsVmBvDscp4FUbzwnCzV8kZChFrbqi02y C6j3WwHapieQ9UNkYDllvs/9Yemactrkk+MtLYmnT6mlK/YH4JeUrish677prGyyroeoCztZ3 DUawEXKIA4ZqeKAknAe0R71/orGXtASA9K0FYrjr1HDVqDsp0JQotrVVUJhlNOOORJr2zpB/Y 04hJnZLfmE+7qY6a0aG1R/E5f9xarGefVBFK/d3BmSCRx64VAe673vitHIb+8LdwMHPk= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.10 Subject: [Qemu-devel] [PULL 14/14] linux-user: Add FICLONE and FICLONERANGE ioctls X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Helge Deller , Riku Voipio , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Helge Deller Add missing FICLONE and FICLONERANGE ioctls. Signed-off-by: Helge Deller Reviewed-by: Laurent Vivier Message-Id: <20170211222602.GA6399@ls3530.fritz.box> Signed-off-by: Laurent Vivier --- linux-user/ioctls.h | 5 +++++ linux-user/syscall_defs.h | 4 ++++ linux-user/syscall_types.h | 6 ++++++ 3 files changed, 15 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index 2f6e85b..e6997ff 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -112,6 +112,11 @@ #ifdef FIBMAP IOCTL(FIBMAP, IOC_W | IOC_R, MK_PTR(TYPE_LONG)) #endif +#ifdef FICLONE + IOCTL(FICLONE, IOC_W, TYPE_INT) + IOCTL(FICLONERANGE, IOC_W, MK_PTR(MK_STRUCT(STRUCT_file_clone_range))) +#endif + #ifdef FIGETBSZ IOCTL(FIGETBSZ, IOC_R, MK_PTR(TYPE_LONG)) #endif diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 4442c22..72ca5b1 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -1086,6 +1086,10 @@ struct target_pollfd { #define TARGET_FIBMAP TARGET_IO(0x00,1) /* bmap access */ #define TARGET_FIGETBSZ TARGET_IO(0x00,2) /* get the block size used for bmap */ + +#define TARGET_FICLONE TARGET_IOW(0x94, 9, int) +#define TARGET_FICLONERANGE TARGET_IOW(0x94, 13, struct file_clone_range) + /* Note that the ioctl numbers claim type "long" but the actual type * used by the kernel is "int". */ diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h index 2b8c0c6..24631b0 100644 --- a/linux-user/syscall_types.h +++ b/linux-user/syscall_types.h @@ -232,6 +232,12 @@ STRUCT(dm_target_versions, STRUCT(dm_target_msg, TYPE_ULONGLONG) /* sector */ +STRUCT(file_clone_range, + TYPE_LONGLONG, /* src_fd */ + TYPE_ULONGLONG, /* src_offset */ + TYPE_ULONGLONG, /* src_length */ + TYPE_ULONGLONG) /* dest_offset */ + STRUCT(fiemap_extent, TYPE_ULONGLONG, /* fe_logical */ TYPE_ULONGLONG, /* fe_physical */