From nobody Wed Oct 22 06:35:00 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1519902981443640.5536122948582; Thu, 1 Mar 2018 03:16:21 -0800 (PST) Received: from localhost ([::1]:55681 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erMC2-0008It-Iv for importer@patchew.org; Thu, 01 Mar 2018 06:16:10 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erMBH-0007tw-5m for qemu-devel@nongnu.org; Thu, 01 Mar 2018 06:15:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1erMBC-0003vY-4B for qemu-devel@nongnu.org; Thu, 01 Mar 2018 06:15:23 -0500 Received: from smtprelay0131.hostedemail.com ([216.40.44.131]:39987 helo=smtprelay.hostedemail.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1erMBB-0003tr-RT for qemu-devel@nongnu.org; Thu, 01 Mar 2018 06:15:18 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay08.hostedemail.com (Postfix) with ESMTP id 624DB182CF665; Thu, 1 Mar 2018 11:15:15 +0000 (UTC) Received: from localhost (c-71-235-10-46.hsd1.nh.comcast.net [71.235.10.46]) (Authenticated sender: shea@shealevy.com) by omf07.hostedemail.com (Postfix) with ESMTPA; Thu, 1 Mar 2018 11:15:12 +0000 (UTC) X-Session-Marker: 7368656140736865616C6576792E636F6D X-HE-Tag: low93_84d3bd7eb5728 X-Filterd-Recvd-Size: 4364 From: Shea Levy To: qemu-devel@nongnu.org Date: Thu, 1 Mar 2018 06:15:00 -0500 Message-Id: <20180301111500.15717-1-shea@shealevy.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <1c105562-7933-d6bf-1071-6836ad8b6e40@vivier.eu> References: <1c105562-7933-d6bf-1071-6836ad8b6e40@vivier.eu> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 216.40.44.131 Subject: [Qemu-devel] [PATCH v4] linux-user: Support f_flags in statfs when available. 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: Shea Levy , Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Shea Levy Reviewed-by: Laurent Vivier --- linux-user/syscall.c | 5 +++++ linux-user/syscall_defs.h | 41 +++++++++++++++++++---------------------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 82b35a6bdf..03dca7ea77 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -9534,6 +9534,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long= arg1, __put_user(stfs.f_fsid.__val[1], &target_stfs->f_fsid.val[1]); __put_user(stfs.f_namelen, &target_stfs->f_namelen); __put_user(stfs.f_frsize, &target_stfs->f_frsize); +#ifdef _STATFS_F_FLAGS + __put_user(stfs.f_flags, &target_stfs->f_flags); +#else + __put_user(0, &target_stfs->f_flags); +#endif memset(target_stfs->f_spare, 0, sizeof(target_stfs->f_spare)); unlock_user_struct(target_stfs, arg2, 1); } diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index a35c52a60a..ee340b8eac 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -352,19 +352,6 @@ typedef struct { int val[2]; } kernel_fsid_t; =20 -struct kernel_statfs { - int f_type; - int f_bsize; - int f_blocks; - int f_bfree; - int f_bavail; - int f_files; - int f_ffree; - kernel_fsid_t f_fsid; - int f_namelen; - int f_spare[6]; -}; - struct target_dirent { abi_long d_ino; abi_long d_off; @@ -2223,7 +2210,8 @@ struct target_statfs { /* Linux specials */ target_fsid_t f_fsid; int32_t f_namelen; - int32_t f_spare[6]; + int32_t f_flags; + int32_t f_spare[5]; }; #else struct target_statfs { @@ -2239,7 +2227,8 @@ struct target_statfs { /* Linux specials */ target_fsid_t f_fsid; abi_long f_namelen; - abi_long f_spare[6]; + abi_long f_flags; + abi_long f_spare[5]; }; #endif =20 @@ -2255,7 +2244,8 @@ struct target_statfs64 { uint64_t f_bavail; target_fsid_t f_fsid; uint32_t f_namelen; - uint32_t f_spare[6]; + uint32_t f_flags; + uint32_t f_spare[5]; }; #elif (defined(TARGET_PPC64) || defined(TARGET_X86_64) || \ defined(TARGET_SPARC64) || defined(TARGET_AARCH64)) && \ @@ -2271,7 +2261,8 @@ struct target_statfs { target_fsid_t f_fsid; abi_long f_namelen; abi_long f_frsize; - abi_long f_spare[5]; + abi_long f_flags; + abi_long f_spare[4]; }; =20 struct target_statfs64 { @@ -2285,7 +2276,8 @@ struct target_statfs64 { target_fsid_t f_fsid; abi_long f_namelen; abi_long f_frsize; - abi_long f_spare[5]; + abi_long f_flags; + abi_long f_spare[4]; }; #elif defined(TARGET_S390X) struct target_statfs { @@ -2299,7 +2291,9 @@ struct target_statfs { kernel_fsid_t f_fsid; int32_t f_namelen; int32_t f_frsize; - int32_t f_spare[5]; + int32_t f_flags; + int32_t f_spare[4]; + }; =20 struct target_statfs64 { @@ -2313,7 +2307,8 @@ struct target_statfs64 { kernel_fsid_t f_fsid; int32_t f_namelen; int32_t f_frsize; - int32_t f_spare[5]; + int32_t f_flags; + int32_t f_spare[4]; }; #else struct target_statfs { @@ -2327,7 +2322,8 @@ struct target_statfs { target_fsid_t f_fsid; uint32_t f_namelen; uint32_t f_frsize; - uint32_t f_spare[5]; + uint32_t f_flags; + uint32_t f_spare[4]; }; =20 struct target_statfs64 { @@ -2341,7 +2337,8 @@ struct target_statfs64 { target_fsid_t f_fsid; uint32_t f_namelen; uint32_t f_frsize; - uint32_t f_spare[5]; + uint32_t f_flags; + uint32_t f_spare[4]; }; #endif =20 --=20 2.16.1