fs_pin.h 619 Bytes
Newer Older
1
/* SPDX-License-Identifier: GPL-2.0 */
Al Viro's avatar
Al Viro committed
2
#include <linux/wait.h>
Al Viro's avatar
Al Viro committed
3 4

struct fs_pin {
Al Viro's avatar
Al Viro committed
5 6
	wait_queue_head_t	wait;
	int			done;
7 8
	struct hlist_node	s_list;
	struct hlist_node	m_list;
Al Viro's avatar
Al Viro committed
9 10 11
	void (*kill)(struct fs_pin *);
};

Al Viro's avatar
Al Viro committed
12 13 14 15 16
struct vfsmount;

static inline void init_fs_pin(struct fs_pin *p, void (*kill)(struct fs_pin *))
{
	init_waitqueue_head(&p->wait);
17 18
	INIT_HLIST_NODE(&p->s_list);
	INIT_HLIST_NODE(&p->m_list);
Al Viro's avatar
Al Viro committed
19 20 21
	p->kill = kill;
}

Al Viro's avatar
Al Viro committed
22
void pin_remove(struct fs_pin *);
23
void pin_insert_group(struct fs_pin *, struct vfsmount *, struct hlist_head *);
Al Viro's avatar
Al Viro committed
24
void pin_insert(struct fs_pin *, struct vfsmount *);
Al Viro's avatar
Al Viro committed
25
void pin_kill(struct fs_pin *);