From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (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 78D4D3446D4 for ; Sun, 11 Jan 2026 12:03:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768133022; cv=none; b=ugAiXJy2jhIkYxXxK+04rI+MjHWXbPDuA2Dw6wK5Tk4y9IOvXhGyfpOZpTmjV0a/MGkzAYMJFJUBHTn+M1X4MJenm9zrfq0UuonmY3A+CTnaaTBN8uUiMeKyy/TNMSE5RGJTpI0BUOZ2/+3Loh/XiHtQOl6d4iSscUxSbrNQXac= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768133022; c=relaxed/simple; bh=wmQbghGS/ENtwsmj2tcArCfF+HWZ44E6zD9TBiIxGX0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FfDx6bf8CytUC1Pli75xQ9gJgo0VOs4oncWg+kKPFs8a0IS9rJPUtVOmg4wCpgjQJ+3K0dPUGBrh1nXx44vGOzV82AUrBfpGLUn4A3cvfQHVbvaMFr1jELrd1tPnSk7DABJPifMn057BM+d55B578s1imoGMNegkeH2ED/W2Vhc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=D2uOTxvu; arc=none smtp.client-ip=209.85.160.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="D2uOTxvu" Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-4ffc0ddefc4so54748081cf.3 for ; Sun, 11 Jan 2026 04:03:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768133019; x=1768737819; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:from:to:cc:subject :date:message-id:reply-to; bh=pduO6FG4MLH1rBcbjZ74RW9AzaVYC1Rsb80ZgdcKz0M=; b=D2uOTxvuwh7UK6fywjpZe5Mn9ga/wWP2F7XZ3r1aSMsrstw3uL3TN3HJEZoV9MfTa0 fRska0LRr6TWyJqCweS/AUv6BmQHxYMrtMRmOmn4HUqPWLvEbFLQwK4lL8/IbTi0N5/L eiPIhquWoObtJBDv1PEHgXxcTmpAYwfZSny9SFpzJI4rEq5XoGZMVRWvoydSYkOdbDe6 QPh7f0dHDzhWE+zj7k9XxbjWIMz/dHHfHY7ySRUJHRWOB1WPiNxShPeDqZlUpUrFvbCu 1ogxCpsuUFR7464dM64edv3N9SG+Fmq4i7YAClSsqp2A00eZF1YTEGFz4bUcoTAf6eyJ THWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768133019; x=1768737819; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:feedback-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pduO6FG4MLH1rBcbjZ74RW9AzaVYC1Rsb80ZgdcKz0M=; b=jugMqQXvaQUSr60Mzj1ooyzEuww7UPxKLdBQW2QxrNoII4/gxa3nWYHnzoabih8FBb W9AYN+E7SUsaDFvM9eVeNoL0l2+9jWy+7zT3e1HrSxkGTM0vYDwhk2+RqqHSck/BAXP5 ekeanX0YK84qwSH8mAVmkIn8sSh7HMzMwOBsGxx896VFk3rb7JYfhOR9mAzKj+VoNvaX ZdS7OhUgb8xRUXl9bDjqHqVVfIe5y3GbOFtPy2500NdsduQlAjlNJEpG/AdrY8x42Yc4 Vhwv7grcRDeEL7dPU0qeoOVqHhfxIlX95oE+YvHNWIhKAK5/KpCaLabG16w3vQsIldlK Iclw== X-Forwarded-Encrypted: i=1; AJvYcCUyF2xuTX2PFq/U3JP5vCd4jjy9hJfUYGydE7To05cDgbGMxW8ic8PInykIm/kTbDWwezZ6YRc+GYnelHw=@vger.kernel.org X-Gm-Message-State: AOJu0YwJNvY7q9dgX8Z3rxSvfNDTwKzhjuhT1xNuap8oP+QQZai7OFFZ BKcZ4FvDejhvGWjb0jHxmGWO7Hnie6xZ3h32MJZfjR8IP6PBlqdTvQxo X-Gm-Gg: AY/fxX7jzxZt9RgI4v90RU3Zkzx8KwC7zNxttzTooBqUU4+XrIdnk+a6sm0dyfCRLEC r9Yq+9jIs7TT63Q7KYGmIZX48q6kTkwrGWSr0MGI1skxOCHCtaARVCa7GJTekK9t5Utdo+rE4nJ uI3HjtDzYZsodTuSS3VhFzuXyKTRrE4p9L2mI2FV4ef+2Lj27dFCxgG4iSXhkuOeVeZbU7YK0o4 VBiOL8Kd2bC++TbbYtEM9+jQg+IdrxdU0dnhyRtw3co1Sio7eRzRs7LYH4atyKBZZxExXydAr2k v9poqx4cih4sTpzbnF9nlzJIFDFosrfrmXevRoPRi4CF8P/WOf2ZyJnN5EVa6sr9M1pIQrVCz/x TQyOPy1DFWs+40lc789igzE+PyKzViIId0tUt2Ged1K7xH3rvbnb6nWopzeBtJvMBFrSSi5Ddt8 5hABffivbdA2MUjYsOlKsgz6ve+uk1SKk1AwDYduWbm0OH8xCXLBr770INgyV269jhIWmuCNGCr TeQ4ZteWyD7bh8= X-Google-Smtp-Source: AGHT+IFgFaPW+ThyyKM9urCLnVzjbgNQSfg7J8AbBvFsVrxsUF7E9QnazP/A07ZRU5n4ev1jm8U/Lw== X-Received: by 2002:a05:622a:351:b0:4f1:def3:cc00 with SMTP id d75a77b69052e-4ffb4a2b7c0mr199143061cf.82.1768133018375; Sun, 11 Jan 2026 04:03:38 -0800 (PST) Received: from fauth-a2-smtp.messagingengine.com (fauth-a2-smtp.messagingengine.com. [103.168.172.201]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4ffc17c288csm68975021cf.29.2026.01.11.04.03.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Jan 2026 04:03:37 -0800 (PST) Received: from phl-compute-11.internal (phl-compute-11.internal [10.202.2.51]) by mailfauth.phl.internal (Postfix) with ESMTP id 5D98AF40068; Sun, 11 Jan 2026 07:03:37 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-11.internal (MEProxy); Sun, 11 Jan 2026 07:03:37 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdduudeghedvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepuehoqhhunhcu hfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrghtth gvrhhnpedvveekvddtffelffelfedvudefffeuheejgeeivedufffgledvgeduveffueeh leenucffohhmrghinhepmhhsghhiugdrlhhinhhknecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhhphgv rhhsohhnrghlihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunhdrfh gvnhhgpeepghhmrghilhdrtghomhesfhhigihmvgdrnhgrmhgvpdhnsggprhgtphhtthho pedugedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepphgvthgvrhiisehinhhfrh gruggvrggurdhorhhgpdhrtghpthhtohepmhhinhhgoheskhgvrhhnvghlrdhorhhgpdhr tghpthhtoheprhhushhtqdhfohhrqdhlihhnuhigsehvghgvrhdrkhgvrhhnvghlrdhorh hgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdho rhhgpdhrtghpthhtohepfihilhhlsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehmrg hrkhdrrhhuthhlrghnugesrghrmhdrtghomhdprhgtphhtthhopehtghhlgieslhhinhhu thhrohhnihigrdguvgdprhgtphhtthhopehojhgvuggrsehkvghrnhgvlhdrohhrghdprh gtphhtthhopehgrghrhiesghgrrhihghhuohdrnhgvth X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 11 Jan 2026 07:03:36 -0500 (EST) From: Boqun Feng To: "Peter Zijlstra" , "Ingo Molnar" Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, "Will Deacon" , "Mark Rutland" , "Thomas Gleixner" , "Miguel Ojeda" , "Gary Guo" , "Alice Ryhl" , "Andreas Hindborg" , "Benno Lossin" , "Danilo Krummrich" , Boqun Feng Subject: [PATCH 32/36] rust: task: Add __rust_helper to helpers Date: Sun, 11 Jan 2026 20:02:05 +0800 Message-ID: <20260111120209.6133-30-boqun.feng@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260111120209.6133-1-boqun.feng@gmail.com> References: <20260111115808.5702-1-boqun.feng@gmail.com> <20260111120209.6133-1-boqun.feng@gmail.com> 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: Alice Ryhl This is needed to inline these helpers into Rust code. Reviewed-by: Boqun Feng Reviewed-by: Gary Guo Signed-off-by: Alice Ryhl Signed-off-by: Boqun Feng Link: https://patch.msgid.link/20260105-define-rust-helper-v2-21-51da5f454a67@google.com --- rust/helpers/signal.c | 2 +- rust/helpers/task.c | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/rust/helpers/signal.c b/rust/helpers/signal.c index 1a6bbe9438e2..85111186cf3d 100644 --- a/rust/helpers/signal.c +++ b/rust/helpers/signal.c @@ -2,7 +2,7 @@ #include -int rust_helper_signal_pending(struct task_struct *t) +__rust_helper int rust_helper_signal_pending(struct task_struct *t) { return signal_pending(t); } diff --git a/rust/helpers/task.c b/rust/helpers/task.c index 2c85bbc2727e..c0e1a06ede78 100644 --- a/rust/helpers/task.c +++ b/rust/helpers/task.c @@ -3,60 +3,60 @@ #include #include -void rust_helper_might_resched(void) +__rust_helper void rust_helper_might_resched(void) { might_resched(); } -struct task_struct *rust_helper_get_current(void) +__rust_helper struct task_struct *rust_helper_get_current(void) { return current; } -void rust_helper_get_task_struct(struct task_struct *t) +__rust_helper void rust_helper_get_task_struct(struct task_struct *t) { get_task_struct(t); } -void rust_helper_put_task_struct(struct task_struct *t) +__rust_helper void rust_helper_put_task_struct(struct task_struct *t) { put_task_struct(t); } -kuid_t rust_helper_task_uid(struct task_struct *task) +__rust_helper kuid_t rust_helper_task_uid(struct task_struct *task) { return task_uid(task); } -kuid_t rust_helper_task_euid(struct task_struct *task) +__rust_helper kuid_t rust_helper_task_euid(struct task_struct *task) { return task_euid(task); } #ifndef CONFIG_USER_NS -uid_t rust_helper_from_kuid(struct user_namespace *to, kuid_t uid) +__rust_helper uid_t rust_helper_from_kuid(struct user_namespace *to, kuid_t uid) { return from_kuid(to, uid); } #endif /* CONFIG_USER_NS */ -bool rust_helper_uid_eq(kuid_t left, kuid_t right) +__rust_helper bool rust_helper_uid_eq(kuid_t left, kuid_t right) { return uid_eq(left, right); } -kuid_t rust_helper_current_euid(void) +__rust_helper kuid_t rust_helper_current_euid(void) { return current_euid(); } -struct user_namespace *rust_helper_current_user_ns(void) +__rust_helper struct user_namespace *rust_helper_current_user_ns(void) { return current_user_ns(); } -pid_t rust_helper_task_tgid_nr_ns(struct task_struct *tsk, - struct pid_namespace *ns) +__rust_helper pid_t rust_helper_task_tgid_nr_ns(struct task_struct *tsk, + struct pid_namespace *ns) { return task_tgid_nr_ns(tsk, ns); } -- 2.51.0