From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C31F734B404 for ; Mon, 16 Mar 2026 10:50:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773658224; cv=none; b=rJoPFQJQ13MiBkmlVbMJ7OJmN8ptQGFO3FNsciQDJ0IeAPgrBEhIwbvlVrLvJNlhORiRjWQcKqa3VOThlbnOfGx76kuD1S+BGiGZix8mGWK/Iw1OflthYdyms/jPriI52+cl8Ni0O4YUp2KTAbI+5VERPVieAkhNXOyicQ6nP+A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773658224; c=relaxed/simple; bh=/GSWFR/pM5/df7HwMsjGIPrNXwbMBghAM7Fw9l1aLJc=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=jHcQFZ+QNqisH98/juJsHglQhN+2/fVH4RTm0bMTf8W97plxhG+5tYx5gC0MJeaD5qkuAKbrI+Yk0PQttD+9qHDNbYjY7Kmg8aQcFicgvjo6xKTqW9rqJEzwL9xaom2gF1jOWoWYxUXfbOC2gVm0yP7tQsVGFi0ldyT6h5OWFQw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=HVzvsqQW; arc=none smtp.client-ip=209.85.128.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="HVzvsqQW" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-485375aa56eso32486915e9.1 for ; Mon, 16 Mar 2026 03:50:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1773658221; x=1774263021; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=CN70017b9XscXy7JbJrHaMQDBe/xTJqIeRZ6kPNoH6A=; b=HVzvsqQWoaa24CprDq11YBa0EJK/H9aExVa7hZIE4acQ+YtHqzOvwdVQRmU4D/F9tA 3xjsriRm/CFpES/RsDZgLyZ2GFnjxmrJ+iUI2LFTeCH90pXnTgE3JC469urplOZBwvgh FbjumMn6Bb5WYEALg5PdXKE8YrqMXtX4JfIqGwoDFJjvj6d7bqH/h4rA4S1UgdiHzldd O+hHI/paAaYQIxWxi3/2DROBl8beOBsuSP7RrfXdYuv+325hR1eC4BhxqfyljyqtH0fy OdQPq1EwEMAxvMRNI+JDPelj8gV5QZuHMztJY/D6AvOrqyppX5OkHqBQxy24BFmWT0iv 7mSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773658221; x=1774263021; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CN70017b9XscXy7JbJrHaMQDBe/xTJqIeRZ6kPNoH6A=; b=WntWgZHeu1EhN0321fjPw99GavqmWHG785QqMZPP+T5wxg46HVLIeRk5FrIW57lsK3 slwkcKPubSnhFaa+ipIWVbCMmcz6pWwCx9t0l8lGVOFcvPwiKQ2uJW5s0JdidzshXQzh IYVPblbd1K3aPoKqcAdnqIyveGDnpHCxxN59PpKKAWLcw1EqoIke9pNJ3eFHb++MNqSJ VJltgtkoQdS2vzopYzsNz/HSWBu6Ns61yM1L7e9uGZXScYU5mLG0wUxV8Nma6yzLZIKu X5mPjQBo0rh8eQHXeMEcx07py52BiUt4dD+UQHKeeMi7yE+ZuzhbPJBLp8p4FbZ0nUKc VqIQ== X-Forwarded-Encrypted: i=1; AJvYcCVBgHFFuCjtQF4xD+U4NVG/WVYrllxJrBYZQRzG5o15UnDECovAmmec9yhRh+N8NfqPRKaYM4RFvxr1QxY=@vger.kernel.org X-Gm-Message-State: AOJu0YxH7sF9XOOmHUkt9Lcsp9AyG8YE4quMGeWWK6aVIZJHL46ZtwdK JwIXQJP9jkae6rTOEaaitEDBq6z84wN84vfrK19GCCivwjQHAMLxnkwwF3wX5Nv6twJfaqc3O8Y b8jsO3cUAytxWVGqT7w== X-Received: from wmpo26.prod.google.com ([2002:a05:600c:339a:b0:480:6c91:3efb]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:4514:b0:485:2f6a:6ed with SMTP id 5b1f17b1804b1-4855670b701mr196241325e9.28.1773658221003; Mon, 16 Mar 2026 03:50:21 -0700 (PDT) Date: Mon, 16 Mar 2026 10:50:20 +0000 In-Reply-To: <20260216-rnull-v6-19-rc5-send-v1-19-de9a7af4b469@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260216-rnull-v6-19-rc5-send-v1-0-de9a7af4b469@kernel.org> <20260216-rnull-v6-19-rc5-send-v1-19-de9a7af4b469@kernel.org> Message-ID: Subject: Re: [PATCH 19/79] block: rust: mq: add max_hw_discard_sectors support to GenDiskBuilder From: Alice Ryhl To: Andreas Hindborg Cc: Boqun Feng , Jens Axboe , Miguel Ojeda , Gary Guo , "=?utf-8?B?QmrDtnJu?= Roy Baron" , Benno Lossin , Trevor Gross , Danilo Krummrich , FUJITA Tomonori , Frederic Weisbecker , Lyude Paul , Thomas Gleixner , Anna-Maria Behnsen , John Stultz , Stephen Boyd , Lorenzo Stoakes , "Liam R. Howlett" , linux-block@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="utf-8" On Mon, Feb 16, 2026 at 12:35:06AM +0100, Andreas Hindborg wrote: > Add support for configuring the maximum hardware discard sectors > through GenDiskBuilder. This allows block devices to specify their > discard/trim capabilities. > > Setting this value to 0 (the default) indicates that discard is not > supported by the device. Non-zero values specify the maximum number > of sectors that can be discarded in a single operation. > > Signed-off-by: Andreas Hindborg If 0 is a special value, then it could be slightly cleaner to use Option or even a custom enum enum MaxHwDiscardSectors { Unsupported, Supported { max: NonNullU32, } } But I'm also ok with current design, so: Reviewed-by: Alice Ryhl