summaryrefslogtreecommitdiff
path: root/fs/bcachefs/enumerated_ref_types.h
blob: 0e6076f466d3d844de3228c314f846451c19cb59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _BCACHEFS_ENUMERATED_REF_TYPES_H
#define _BCACHEFS_ENUMERATED_REF_TYPES_H

#include <linux/percpu-refcount.h>

struct enumerated_ref {
#ifdef ENUMERATED_REF_DEBUG
	unsigned		nr;
	bool			dying;
	atomic_long_t		*refs;
#else
	struct percpu_ref	ref;
#endif
	void			(*stop_fn)(struct enumerated_ref *);
	struct completion	stop_complete;
};

#endif /* _BCACHEFS_ENUMERATED_REF_TYPES_H */