diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-01-11 16:57:27 +0100 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-01-26 05:17:28 +0100 |
commit | fdab684d7202774bfd8762d4a656a553b787c8ec (patch) | |
tree | 8ddb298648037f9abd37bc3b263e53695ceb9ce2 /fs/fs_pin.c | |
parent | get rid of the second argument of acct_kill() (diff) | |
download | linux-fdab684d7202774bfd8762d4a656a553b787c8ec.tar.xz linux-fdab684d7202774bfd8762d4a656a553b787c8ec.zip |
allow attaching fs_pin to a group not associated with some superblock
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/fs_pin.c')
-rw-r--r-- | fs/fs_pin.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/fs/fs_pin.c b/fs/fs_pin.c index 5eb39a93a560..50ef7d2ef03c 100644 --- a/fs/fs_pin.c +++ b/fs/fs_pin.c @@ -14,14 +14,20 @@ void pin_remove(struct fs_pin *pin) spin_unlock(&pin_lock); } -void pin_insert(struct fs_pin *pin, struct vfsmount *m) +void pin_insert_group(struct fs_pin *pin, struct vfsmount *m, struct hlist_head *p) { spin_lock(&pin_lock); - hlist_add_head(&pin->s_list, &m->mnt_sb->s_pins); + if (p) + hlist_add_head(&pin->s_list, p); hlist_add_head(&pin->m_list, &real_mount(m)->mnt_pins); spin_unlock(&pin_lock); } +void pin_insert(struct fs_pin *pin, struct vfsmount *m) +{ + pin_insert_group(pin, m, &m->mnt_sb->s_pins); +} + void mnt_pin_kill(struct mount *m) { while (1) { @@ -38,18 +44,18 @@ void mnt_pin_kill(struct mount *m) } } -void sb_pin_kill(struct super_block *sb) +void group_pin_kill(struct hlist_head *p) { while (1) { - struct hlist_node *p; + struct hlist_node *q; struct fs_pin *pin; rcu_read_lock(); - p = ACCESS_ONCE(sb->s_pins.first); - if (!p) { + q = ACCESS_ONCE(p->first); + if (!q) { rcu_read_unlock(); break; } - pin = hlist_entry(p, struct fs_pin, s_list); + pin = hlist_entry(q, struct fs_pin, s_list); pin->kill(pin); } } |