blob: 3886b3bffd7f75305fc60db553916729cf677a1e [file] [log] [blame]
Al Viro59eda0e2015-01-10 17:53:21 -05001#include <linux/wait.h>
Al Viroefb170c2014-08-07 08:39:04 -04002
3struct fs_pin {
Al Viro59eda0e2015-01-10 17:53:21 -05004 wait_queue_head_t wait;
5 int done;
Al Viro34cece22015-01-10 12:47:38 -05006 struct hlist_node s_list;
7 struct hlist_node m_list;
Al Viroefb170c2014-08-07 08:39:04 -04008 void (*kill)(struct fs_pin *);
9};
10
Al Viro59eda0e2015-01-10 17:53:21 -050011struct vfsmount;
12
13static inline void init_fs_pin(struct fs_pin *p, void (*kill)(struct fs_pin *))
14{
15 init_waitqueue_head(&p->wait);
Eric W. Biederman820f9f12015-04-02 16:35:48 -050016 INIT_HLIST_NODE(&p->s_list);
17 INIT_HLIST_NODE(&p->m_list);
Al Viro59eda0e2015-01-10 17:53:21 -050018 p->kill = kill;
19}
20
Al Viroefb170c2014-08-07 08:39:04 -040021void pin_remove(struct fs_pin *);
Al Virofdab6842015-01-11 10:57:27 -050022void pin_insert_group(struct fs_pin *, struct vfsmount *, struct hlist_head *);
Al Viroefb170c2014-08-07 08:39:04 -040023void pin_insert(struct fs_pin *, struct vfsmount *);
Al Viro59eda0e2015-01-10 17:53:21 -050024void pin_kill(struct fs_pin *);