blob: 7cab74d66f85476ff20c0445edc1164115091ca2 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Al Viro59eda0e2015-01-10 17:53:21 -05002#include <linux/wait.h>
Al Viroefb170c2014-08-07 08:39:04 -04003
4struct fs_pin {
Al Viro59eda0e2015-01-10 17:53:21 -05005 wait_queue_head_t wait;
6 int done;
Al Viro34cece22015-01-10 12:47:38 -05007 struct hlist_node s_list;
8 struct hlist_node m_list;
Al Viroefb170c2014-08-07 08:39:04 -04009 void (*kill)(struct fs_pin *);
10};
11
Al Viro59eda0e2015-01-10 17:53:21 -050012struct vfsmount;
13
14static inline void init_fs_pin(struct fs_pin *p, void (*kill)(struct fs_pin *))
15{
16 init_waitqueue_head(&p->wait);
Eric W. Biederman820f9f12015-04-02 16:35:48 -050017 INIT_HLIST_NODE(&p->s_list);
18 INIT_HLIST_NODE(&p->m_list);
Al Viro59eda0e2015-01-10 17:53:21 -050019 p->kill = kill;
20}
21
Al Viroefb170c2014-08-07 08:39:04 -040022void pin_remove(struct fs_pin *);
Al Virofdab6842015-01-11 10:57:27 -050023void pin_insert_group(struct fs_pin *, struct vfsmount *, struct hlist_head *);
Al Viroefb170c2014-08-07 08:39:04 -040024void pin_insert(struct fs_pin *, struct vfsmount *);
Al Viro59eda0e2015-01-10 17:53:21 -050025void pin_kill(struct fs_pin *);