mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-04-24 10:49:54 +02:00
btrfs: define the AUTO_KFREE/AUTO_KVFREE helper macros
[ Upstream commitd00cbce0a7] These are two simple macros which ensure that a pointer is initialized to NULL and with the proper cleanup attribute for it. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> Stable-dep-of:52ee9965d0("btrfs: zoned: fixup last alloc pointer after extent removal for RAID0/10") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
531c755f25
commit
acefb51f40
@@ -10,6 +10,13 @@
|
||||
#include <linux/math64.h>
|
||||
#include <linux/rbtree.h>
|
||||
|
||||
/*
|
||||
* Convenience macros to define a pointer with the __free(kfree) and
|
||||
* __free(kvfree) cleanup attributes and initialized to NULL.
|
||||
*/
|
||||
#define AUTO_KFREE(name) *name __free(kfree) = NULL
|
||||
#define AUTO_KVFREE(name) *name __free(kvfree) = NULL
|
||||
|
||||
/*
|
||||
* Enumerate bits using enum autoincrement. Define the @name as the n-th bit.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user