Skip to content

Commit 01b2196

Browse files
Danilo Krummrichojeda
authored andcommitted
rust: alloc: add __GFP_NOWARN to Flags
Some test cases in subsequent patches provoke allocation failures. Add `__GFP_NOWARN` to enable test cases to silence unpleasant warnings. Reviewed-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Benno Lossin <benno.lossin@proton.me> Reviewed-by: Gary Guo <gary@garyguo.net> Signed-off-by: Danilo Krummrich <dakr@kernel.org> Link: https://lore.kernel.org/r/20241004154149.93856-11-dakr@kernel.org Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent 8362c26 commit 01b2196

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

rust/bindings/bindings_helper.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ const gfp_t RUST_CONST_HELPER_GFP_KERNEL_ACCOUNT = GFP_KERNEL_ACCOUNT;
3131
const gfp_t RUST_CONST_HELPER_GFP_NOWAIT = GFP_NOWAIT;
3232
const gfp_t RUST_CONST_HELPER___GFP_ZERO = __GFP_ZERO;
3333
const gfp_t RUST_CONST_HELPER___GFP_HIGHMEM = ___GFP_HIGHMEM;
34+
const gfp_t RUST_CONST_HELPER___GFP_NOWARN = ___GFP_NOWARN;
3435
const blk_features_t RUST_CONST_HELPER_BLK_FEAT_ROTATIONAL = BLK_FEAT_ROTATIONAL;

rust/kernel/alloc.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ pub mod flags {
9191
/// use any filesystem callback. It is very likely to fail to allocate memory, even for very
9292
/// small allocations.
9393
pub const GFP_NOWAIT: Flags = Flags(bindings::GFP_NOWAIT);
94+
95+
/// Suppresses allocation failure reports.
96+
///
97+
/// This is normally or'd with other flags.
98+
pub const __GFP_NOWARN: Flags = Flags(bindings::__GFP_NOWARN);
9499
}
95100

96101
/// The kernel's [`Allocator`] trait.

0 commit comments

Comments
 (0)