summaryrefslogtreecommitdiff
path: root/samples/rust/rust_print.rs
diff options
context:
space:
mode:
authorWedson Almeida Filho <walmeida@microsoft.com>2024-03-27 22:36:01 -0300
committerMiguel Ojeda <ojeda@kernel.org>2024-04-16 22:50:04 +0200
commitcc41670e06383c08f3afdd7a19b782d03ae4d63a (patch)
tree9cb8cd5d7995d2a374981ad5d74ecfffe17b6b2e /samples/rust/rust_print.rs
parent5ab560ce12ed0df3450968cfe4211e398ff2a8d7 (diff)
downloadlwn-cc41670e06383c08f3afdd7a19b782d03ae4d63a.tar.gz
lwn-cc41670e06383c08f3afdd7a19b782d03ae4d63a.zip
rust: sync: update `Arc` and `UniqueArc` to take allocation flags
We also remove the `try_` prefix to align with how `Box` and `Vec` are providing methods now. `init` is temporarily updated with uses of GFP_KERNEL. These will be updated in a subsequent patch to take flags as well. Reviewed-by: Benno Lossin <benno.lossin@proton.me> Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com> Link: https://lore.kernel.org/r/20240328013603.206764-9-wedsonaf@gmail.com Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'samples/rust/rust_print.rs')
-rw-r--r--samples/rust/rust_print.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/samples/rust/rust_print.rs b/samples/rust/rust_print.rs
index 67ed8ebf8e8e..6eabb0d79ea3 100644
--- a/samples/rust/rust_print.rs
+++ b/samples/rust/rust_print.rs
@@ -18,8 +18,8 @@ struct RustPrint;
fn arc_print() -> Result {
use kernel::sync::*;
- let a = Arc::try_new(1)?;
- let b = UniqueArc::try_new("hello, world")?;
+ let a = Arc::new(1, GFP_KERNEL)?;
+ let b = UniqueArc::new("hello, world", GFP_KERNEL)?;
// Prints the value of data in `a`.
pr_info!("{}", a);