From patchwork Wed Apr 24 22:51:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 791536 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1091788wrq; Wed, 24 Apr 2024 15:52:40 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVv43jwtZ4Em5LFabnCBmp928gK6IwBXnZw8gw++TSiJ1BPPOtm98Ew2zExwnptkhy7BqC2HUuCIVbPWeaBqN1R X-Google-Smtp-Source: AGHT+IFUnrzzgQzU4m5umHQPsB3G2OKqt2Xtdk/OqO5Nz0CPG+3eDha2WR6IVIeQ0+eEVCnwm3PZ X-Received: by 2002:a05:622a:4b10:b0:437:b830:e498 with SMTP id et16-20020a05622a4b1000b00437b830e498mr4798798qtb.25.1713999160740; Wed, 24 Apr 2024 15:52:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1713999160; cv=none; d=google.com; s=arc-20160816; b=tExUOyh4wG5MTxDRKLZRzRnMfKtuO3nj+O+pvdMHLd4jP84xMdeyKB6k6J3X7wbPD2 oeUIBXAQsYQLIf7TFh+sH7b63fTQOKdBCx6mV7bUm8xiufzvO6saqYlUiYG59KdqGpNf 38giFZZ8c6z6xovs+RV5ev+nBw6zEi9dihxO5J9CFKbvu1jgAWZmpKICNPb4ZbVaqWVM rvdKfAwDnygh66apjomSOB6LtdX/gWuIZKgkLmwqw2rpGDzgM7oZDwseGAb2tXRqrYW6 +E/JKToJG5SC3aBy+ooc/ZaBEYHm6LrKajMA94F0dCcU0NmWHo4Rnt5iKhve1KyiQUgS rVUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UDr6R2ma44jwvkJI3Qs5id/WJ2z4/lQ44GztsnjZcyw=; fh=u9DhXX/1+w9V/lPughVlk13Er6RrFul+1XrnqwizVQE=; b=H/BzJIM2DNBM18g6iotWVSdSRtM5+c6KS+EaLsBPWf2E6tySGCNF1ONGvxzRM8kJwQ /xtBD2iBYL/wC19cDwnrkqY1M3AHLDMqC7JOi2PPfQX9MlmBkSoh02fS3/hmpVJAD6rb FiAMQTjDQHhiWA8Q+RihpioWm5Zo4Lr6F/QT7lk6zNFhnbVkSARjnaH7aoBssv9/V08l SLyVSlHsW4rmwFsLb1Ege5afBzgqf2dm/zo5eBumNrq2nrf9UCPSSEcNfZvTPJ4KRT+H AMS4dTi9p9/NQHuLaB12AeyeT/objdgU3GOwHdQrFZo2ngn/qvEyOOGvmMeGwp6qnV7d RT6Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M+6bxgx2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g2-20020ac85802000000b0043a18d47571si2836381qtg.15.2024.04.24.15.52.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Apr 2024 15:52:40 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M+6bxgx2; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rzlSh-0006y8-FL; Wed, 24 Apr 2024 18:51:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rzlSg-0006xk-IO for qemu-devel@nongnu.org; Wed, 24 Apr 2024 18:51:34 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzlSe-0006gJ-MJ for qemu-devel@nongnu.org; Wed, 24 Apr 2024 18:51:34 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-6ecf05fd12fso408927b3a.2 for ; Wed, 24 Apr 2024 15:51:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713999091; x=1714603891; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UDr6R2ma44jwvkJI3Qs5id/WJ2z4/lQ44GztsnjZcyw=; b=M+6bxgx24/yGZb2/YF5Kgwo/p7qWkjo599pFHECqFoFZ06u/7GIeXkySB5tJnnycNx xaLDHGGo15F502rCTDUJcIKRlmnawWIaYRSTSY7z4UDLsrtRbNwHXF/ftM9FautDS8Xp t1MhxOqf8trJbHI/+JTBdsNnH5BycRM4JIjBqmecjKyExL6oQYoK6dQYBm3qVyg1dd44 4+yjQWcbp52DsEI3RlP9LfZce2bM2tQIdGuVCbPUFWw3/7X0lcSA4sxF0gPcgSm3FR2Z oYMpKOjkXj7PYQw2QJOSsHowumXf5WKOhKrLcUAhBsNK4G0aU5wBo3Rkj/RNnKsDtQun aFMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713999091; x=1714603891; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UDr6R2ma44jwvkJI3Qs5id/WJ2z4/lQ44GztsnjZcyw=; b=FUdujB6c/lA7rUH04LGxmzBocyi5nFcZ/+W5p5grNEvwgxkIizVagspJnpxCu7IAlb gbX/6p0C0JCs8Dbe9MG/1QRX503NUth/SjZ2eO4mkiYAhPjjlwj2eBr6mNTAd1fC7Y1n Ec8BfpCDGO+a1m1Mc4cAVA+hXvlSSzxjM9IgxObVv7Pywo/9uUd/EIXbhptX/6USTgtd nTQpwN/EUtXlw3Nn/SVd1JsbDPcYSwPUD3VaetyjNoekRllWaAbJIgAzqTQMAvIxZJ9U fpr75YndaqWtiCUwhReXBVQfBnXz7esojcQ3+ogzTk1RvH4Obddwzyy/rDgoq8q0PUef W83g== X-Gm-Message-State: AOJu0YwxWcXuq4D02omQycbAIWsmlI3YG3fqiPLkbdrN+XVTSql8vHaU fv6W4o9AVaY31DK9e6OfZhAS1eQnURA5DRFuSxsKHenpI+KJyhBsFt2hhtjJSuXB+AKRPUu08Sv E X-Received: by 2002:a05:6a20:daaa:b0:1aa:5e75:d31f with SMTP id iy42-20020a056a20daaa00b001aa5e75d31fmr4467488pzb.16.1713999091197; Wed, 24 Apr 2024 15:51:31 -0700 (PDT) Received: from stoup.. ([156.19.246.23]) by smtp.gmail.com with ESMTPSA id it12-20020a056a00458c00b006ead792b6f2sm11960864pfb.1.2024.04.24.15.51.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 15:51:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Michael Vogt Subject: [PULL 6/9] linux-user: Add FITRIM ioctl Date: Wed, 24 Apr 2024 15:51:20 -0700 Message-Id: <20240424225123.929152-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240424225123.929152-1-richard.henderson@linaro.org> References: <20240424225123.929152-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Michael Vogt Tiny patch to add the missing FITRIM ioctl. Signed-off-by: Michael Vogt Message-Id: <20240403092048.16023-2-michael.vogt@gmail.com> Signed-off-by: Richard Henderson --- linux-user/ioctls.h | 3 +++ linux-user/syscall_defs.h | 1 + linux-user/syscall_types.h | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index 1aec9d5836..d508d0c04a 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -140,6 +140,9 @@ #ifdef FITHAW IOCTL(FITHAW, IOC_W | IOC_R, TYPE_INT) #endif +#ifdef FITRIM + IOCTL(FITRIM, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_fstrim_range))) +#endif IOCTL(FIGETBSZ, IOC_R, MK_PTR(TYPE_LONG)) #ifdef CONFIG_FIEMAP diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index 3995487630..a00b617cae 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -945,6 +945,7 @@ struct target_rtc_pll_info { #define TARGET_FIFREEZE TARGET_IOWR('X', 119, abi_int) #define TARGET_FITHAW TARGET_IOWR('X', 120, abi_int) +#define TARGET_FITRIM TARGET_IOWR('X', 121, struct fstrim_range) /* * Note that the ioctl numbers for FS_IOC_ diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h index c3b43f8022..6dd7a80ce5 100644 --- a/linux-user/syscall_types.h +++ b/linux-user/syscall_types.h @@ -341,6 +341,11 @@ STRUCT(file_clone_range, TYPE_ULONGLONG, /* src_length */ TYPE_ULONGLONG) /* dest_offset */ +STRUCT(fstrim_range, + TYPE_ULONGLONG, /* start */ + TYPE_ULONGLONG, /* len */ + TYPE_ULONGLONG) /* minlen */ + STRUCT(fiemap_extent, TYPE_ULONGLONG, /* fe_logical */ TYPE_ULONGLONG, /* fe_physical */