Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp89292lqj; Sat, 1 Jun 2024 09:07:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVeNrshjCuLKjuaMdv8nSETUKu9JeBClYqp/JSY6D8XlGlw9bz5kIPnx+xGK+BkSQc6rWAHQ0AccVctu/mRu+yX1XtVKsBHl/BcxUJcxQ== X-Google-Smtp-Source: AGHT+IHaw8yjLz6+rWxuNZSIH10VNfeqcwYUwUjui5cLoMiZG83v7km0mIDgesiMUQ+h4AUWIM45 X-Received: by 2002:ae9:f70f:0:b0:794:a719:6413 with SMTP id af79cd13be357-794f5ebe484mr541061385a.57.1717258073332; Sat, 01 Jun 2024 09:07:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717258073; cv=pass; d=google.com; s=arc-20160816; b=qecSSeaCoQUq9X1NFTfWs51zkjs6o8bTBRy7/XDcPsXzHtcHGfUznhXY+Vq7xR9Yc6 a2T4IbaNKis+XTd3o/jmFOXSy49mPAvLiT1nRDz20wGmqysruHfH0S0n/FywXYtTSPZG I64vKaUP/f+E+ScbgphDmhZiD9PPtHcXlpPLbL51YEK3GCqPSL3G9PNgMjcm996PYYYR 9H3782o/djs3+/B2VUnogvCJztOYfotN+/mRxO/UpfuwU+5tY+MbUDFCe7fr5s1koIW1 PE7B9lL6t9l3oiZ3T6dMVfTQrCpNTS0qRzO+VDSPj1ECTmzKFLV4CH1n3RULK81iMHAh 9z8g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=KyzuF3brQQkovopkloODG73sB5o5CxxgafSs5PeVkB4=; fh=IRCp5yadw+LYx68SqWo7H3DTtJyek81N9euNizb7/6k=; b=eYau7XPWHaVwECv2DPrv0yCVitGHN2BF5iOTYz8vIHgz+X3BdTBWrqnJgrd8xLFR8G 23Bye3HiJ7hdgAwDgpsppbIK0GZsN9knPrxNPZPthXr8j6E7I0bSzdHaF7qbYaTVe8zk vth09DwXSTT60TpCO/cGrIwImZ3uoKaYIT2iFGaW3sJfXNwzUfcl2J9Cbkg5pd+FsrsG i6BxKe7wNi//wNrs3xSDNZxbzEP5f5uxzd9zA2CSiVLO2bGypSO32HVDPpTH5G2C4B9l ye+yb4n3VCWDKqYsi9UfSg5BuZa37PCI3faTXRYERHkC6avHDofsNun8CrOdTvtw0N8u jr2Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@metaspace-dk.20230601.gappssmtp.com header.s=20230601 header.b=1tz+sqM+; arc=pass (i=1 dkim=pass dkdomain=metaspace-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-197877-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197877-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-794f2f05c2asi447711985a.65.2024.06.01.09.07.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Jun 2024 09:07:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197877-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@metaspace-dk.20230601.gappssmtp.com header.s=20230601 header.b=1tz+sqM+; arc=pass (i=1 dkim=pass dkdomain=metaspace-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-197877-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197877-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D5EC51C219F1 for ; Sat, 1 Jun 2024 13:41:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 458CD1527A3; Sat, 1 Jun 2024 13:40:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=metaspace-dk.20230601.gappssmtp.com header.i=@metaspace-dk.20230601.gappssmtp.com header.b="1tz+sqM+" Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (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 806A41514FB for ; Sat, 1 Jun 2024 13:40:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717249238; cv=none; b=VUmKg3rGuGaKAzO6fTYfOHMGPTSpHNlB0VAMF4o8eO+NmVmnY9fF+hYnVeyPgzUBKZhvMNTLQFCtA1jphQbFhjx+nM6v/etm2lGsDvpL6Yf+HJc+5a9j7ChOPR2Ojfn5tmoGtU2WDaJv4T58wSRhYtVqjS0KLBwhoSP5H7MRAk0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717249238; c=relaxed/simple; bh=aQ38ZhHYsrlwdR3vgqyHxmlopGuks4yflq18E5jTA4E=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=MWI5xFJY0/he8+8qwPWoBMKgCHXSungizvZMWrShBo5fK6MupOWKmZNurhl3UcjCf+0aOOYWQBf+Z8ByoA53xlq9h4W17GMFzPNNNuSa/a3ASML0SOrglC9e0Qp5Bf6YiSy+873RC3PCsQQi2XQTkz+3jgQAhUx5QZCIQ6gy3rI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=metaspace.dk; spf=none smtp.mailfrom=metaspace.dk; dkim=pass (2048-bit key) header.d=metaspace-dk.20230601.gappssmtp.com header.i=@metaspace-dk.20230601.gappssmtp.com header.b=1tz+sqM+; arc=none smtp.client-ip=209.85.208.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=metaspace.dk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=metaspace.dk Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-5785199f7d1so1561693a12.2 for ; Sat, 01 Jun 2024 06:40:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=metaspace-dk.20230601.gappssmtp.com; s=20230601; t=1717249234; x=1717854034; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=KyzuF3brQQkovopkloODG73sB5o5CxxgafSs5PeVkB4=; b=1tz+sqM+WGfQjUidz0FZkYuN7/Su8sMNGeEaEay9fkm5i7bVXjMyCBREh3x6sDAXZU HBjycbEPF45v8fcCgdRDwDY3/Sh+6tyiLuTqXwyDt7W1ZeaW7yd1Sam6c5KL8+nD0keR 2+irnhxXySMeRmEyFx28cYRxKuNZ+IF/kUlfqCsCos34fIQwE32jQ+Ui2RYaiuFd9esW pcybF17AJ+qXlaGvTa1eNU8jl1tuRTDY+UdWDrFMIRmwIKTxZh2FhTtOOiW0X1yQUONk v5PvsBeMjxcGr08EFcUX93XyrKAgYy3ZR/RmRD+JBxV5AUFAoGq7r5sHPFtI/ChmhVzL Qmww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717249234; x=1717854034; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KyzuF3brQQkovopkloODG73sB5o5CxxgafSs5PeVkB4=; b=C5mcXMPRXuMSnzF88ykt13gjmIwEmbeK0pslg4EmwfJbpnvg8/PRUKTlDKIzcZVIZG KLVbyrR5SXloAZe5L87aK5X+TkW47/YksJQNG4nI7nDzXx0OkaAu2zFGMWs5xyR8BbUe AICvTyzhB1jUNMTgrTpgmZIY3kI8fSsvzhtQOtCzequ/OofY2YEudsrQxZOlEQZOJsbn n4HswPNsP7hQi5vwrcOqrE2qD/NIGE3Y94qb8Ax97LNCQg30p1ve87B6urVeP6oPfMVP IYbhd+Y1Z5IB9EVq64Jqm1roIHT7K6PN8frgy7NKL+LsLo2hul4C9Xl5kJP0VODjNbZn lX7A== X-Forwarded-Encrypted: i=1; AJvYcCVwkEcww3MNh5HJV0QjDywRFV6VUzwLGSDhPwphLaUpi3/8J7H+M2ATzN5ORxT7GdKZFTwGTmoNSRHZloOsmgPgWcakIo8pIjuzQDhs X-Gm-Message-State: AOJu0YwdUjCpJJLG6i0UxFR55TaBPoTMFr5tooYYSpPSJ3l0FFvMIth1 GKv1Y0Y1QxX6DNoz2gamwzohq7tWe4jnGlMI1pTdjtWh13S+DmW4KzBOv4Ba3EU= X-Received: by 2002:a50:d7da:0:b0:57a:22b1:b02c with SMTP id 4fb4d7f45d1cf-57a363ffeffmr3839471a12.27.1717249233833; Sat, 01 Jun 2024 06:40:33 -0700 (PDT) Received: from localhost ([79.142.230.34]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57a31c9d5d5sm2234736a12.95.2024.06.01.06.40.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Jun 2024 06:40:33 -0700 (PDT) From: Andreas Hindborg To: Jens Axboe , Christoph Hellwig , Keith Busch , Damien Le Moal , Bart Van Assche , Hannes Reinecke , Ming Lei , "linux-block@vger.kernel.org" Cc: Andreas Hindborg , Greg KH , Matthew Wilcox , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Alice Ryhl , Chaitanya Kulkarni , Luis Chamberlain , Yexuan Yang <1182282462@bupt.edu.cn>, =?UTF-8?q?Sergio=20Gonz=C3=A1lez=20Collado?= , Joel Granados , "Pankaj Raghav (Samsung)" , Daniel Gomez , Niklas Cassel , Philipp Stanner , Conor Dooley , Johannes Thumshirn , =?UTF-8?q?Matias=20Bj=C3=B8rling?= , open list , "rust-for-linux@vger.kernel.org" , "lsf-pc@lists.linux-foundation.org" , "gost.dev@samsung.com" Subject: [PATCH v4 0/3] Rust block device driver API and null block driver Date: Sat, 1 Jun 2024 15:40:02 +0200 Message-ID: <20240601134005.621714-1-nmi@metaspace.dk> X-Mailer: git-send-email 2.45.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Andreas Hindborg Hi! A few more fixes based on input from Benno. Earlier version here [1]. Changes from v3: - mq: rewrite `atomic_relaxed_op_unless` in terms of `atomicu64::fetch_update` - mq: fix docs for `atomic_relaxed_op_unless` - mq: rewrite initialization of `TagSet` to be more idiomatic - rnull: add a comment for error path - rnull: move a ? operator Best regards, Andreas Hindborg Link: https://lore.kernel.org/all/20240601081806.531954-1-nmi@metaspace.dk/ Andreas Hindborg (3): rust: block: introduce `kernel::block::mq` module rust: block: add rnull, Rust null_blk implementation MAINTAINERS: add entry for Rust block device driver API MAINTAINERS | 14 ++ drivers/block/Kconfig | 9 ++ drivers/block/Makefile | 3 + drivers/block/rnull.rs | 81 ++++++++++ rust/bindings/bindings_helper.h | 2 + rust/helpers.c | 16 ++ rust/kernel/block.rs | 5 + rust/kernel/block/mq.rs | 97 ++++++++++++ rust/kernel/block/mq/gen_disk.rs | 222 ++++++++++++++++++++++++++ rust/kernel/block/mq/operations.rs | 233 ++++++++++++++++++++++++++++ rust/kernel/block/mq/raw_writer.rs | 55 +++++++ rust/kernel/block/mq/request.rs | 241 +++++++++++++++++++++++++++++ rust/kernel/block/mq/tag_set.rs | 85 ++++++++++ rust/kernel/error.rs | 6 + rust/kernel/lib.rs | 2 + 15 files changed, 1071 insertions(+) create mode 100644 drivers/block/rnull.rs create mode 100644 rust/kernel/block.rs create mode 100644 rust/kernel/block/mq.rs create mode 100644 rust/kernel/block/mq/gen_disk.rs create mode 100644 rust/kernel/block/mq/operations.rs create mode 100644 rust/kernel/block/mq/raw_writer.rs create mode 100644 rust/kernel/block/mq/request.rs create mode 100644 rust/kernel/block/mq/tag_set.rs base-commit: 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0 -- 2.45.1