mirror of
				https://github.com/torvalds/linux.git
				synced 2025-10-31 16:48:26 +02:00 
			
		
		
		
	 f73ca66f0d
			
		
	
	
		f73ca66f0d
		
	
	
	
	
		
			
			Reintroduce dynamically-allocated LockClassKeys such that they are automatically (de)registered. Require that all usages of LockClassKeys ensure that they are Pin'd. Currently, only `'static` LockClassKeys are supported, so Pin is redundant. However, it is intended that dynamically-allocated LockClassKeys will eventually be supported, so using Pin from the outset will make that change simpler. Closes: https://github.com/Rust-for-Linux/linux/issues/1102 Suggested-by: Benno Lossin <benno.lossin@proton.me> Suggested-by: Boqun Feng <boqun.feng@gmail.com> Signed-off-by: Mitchell Levy <levymitchell0@gmail.com> Signed-off-by: Boqun Feng <boqun.feng@gmail.com> Signed-off-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Benno Lossin <benno.lossin@proton.me> Link: https://lore.kernel.org/r/20250307232717.1759087-12-boqun.feng@gmail.com
		
			
				
	
	
		
			13 lines
		
	
	
	
		
			258 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
	
		
			258 B
		
	
	
	
		
			C
		
	
	
	
	
	
| // SPDX-License-Identifier: GPL-2.0
 | |
| 
 | |
| #include <linux/lockdep.h>
 | |
| 
 | |
| void rust_helper_lockdep_register_key(struct lock_class_key *k)
 | |
| {
 | |
| 	lockdep_register_key(k);
 | |
| }
 | |
| 
 | |
| void rust_helper_lockdep_unregister_key(struct lock_class_key *k)
 | |
| {
 | |
| 	lockdep_unregister_key(k);
 | |
| }
 |