2 #include <linux/slab.h>
3 #include <linux/fs_pin.h>
7 static DEFINE_SPINLOCK(pin_lock);
9 void pin_remove(struct fs_pin *pin)
12 hlist_del(&pin->m_list);
13 hlist_del(&pin->s_list);
14 spin_unlock(&pin_lock);
17 void pin_insert_group(struct fs_pin *pin, struct vfsmount *m, struct hlist_head *p)
21 hlist_add_head(&pin->s_list, p);
22 hlist_add_head(&pin->m_list, &real_mount(m)->mnt_pins);
23 spin_unlock(&pin_lock);
26 void pin_insert(struct fs_pin *pin, struct vfsmount *m)
28 pin_insert_group(pin, m, &m->mnt_sb->s_pins);
31 void mnt_pin_kill(struct mount *m)
37 p = ACCESS_ONCE(m->mnt_pins.first);
42 pin = hlist_entry(p, struct fs_pin, m_list);
47 void group_pin_kill(struct hlist_head *p)
53 q = ACCESS_ONCE(p->first);
58 pin = hlist_entry(q, struct fs_pin, s_list);