Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Al Viro | 59eda0e | 2015-01-10 17:53:21 -0500 | [diff] [blame] | 2 | #include <linux/wait.h> |
Al Viro | efb170c | 2014-08-07 08:39:04 -0400 | [diff] [blame] | 3 | |
| 4 | struct fs_pin { |
Al Viro | 59eda0e | 2015-01-10 17:53:21 -0500 | [diff] [blame] | 5 | wait_queue_head_t wait; |
| 6 | int done; |
Al Viro | 34cece2 | 2015-01-10 12:47:38 -0500 | [diff] [blame] | 7 | struct hlist_node s_list; |
| 8 | struct hlist_node m_list; |
Al Viro | efb170c | 2014-08-07 08:39:04 -0400 | [diff] [blame] | 9 | void (*kill)(struct fs_pin *); |
| 10 | }; |
| 11 | |
Al Viro | 59eda0e | 2015-01-10 17:53:21 -0500 | [diff] [blame] | 12 | struct vfsmount; |
| 13 | |
| 14 | static inline void init_fs_pin(struct fs_pin *p, void (*kill)(struct fs_pin *)) |
| 15 | { |
| 16 | init_waitqueue_head(&p->wait); |
Eric W. Biederman | 820f9f1 | 2015-04-02 16:35:48 -0500 | [diff] [blame] | 17 | INIT_HLIST_NODE(&p->s_list); |
| 18 | INIT_HLIST_NODE(&p->m_list); |
Al Viro | 59eda0e | 2015-01-10 17:53:21 -0500 | [diff] [blame] | 19 | p->kill = kill; |
| 20 | } |
| 21 | |
Al Viro | efb170c | 2014-08-07 08:39:04 -0400 | [diff] [blame] | 22 | void pin_remove(struct fs_pin *); |
Al Viro | fdab684 | 2015-01-11 10:57:27 -0500 | [diff] [blame] | 23 | void pin_insert_group(struct fs_pin *, struct vfsmount *, struct hlist_head *); |
Al Viro | efb170c | 2014-08-07 08:39:04 -0400 | [diff] [blame] | 24 | void pin_insert(struct fs_pin *, struct vfsmount *); |
Al Viro | 59eda0e | 2015-01-10 17:53:21 -0500 | [diff] [blame] | 25 | void pin_kill(struct fs_pin *); |