aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-05-21 18:22:52 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-08-07 14:40:09 -0400
commit8fa1f1c2bd86007beb4a4845e6087ac4a704dc80 (patch)
tree9bfd55957c49422697debb7651b669891cb1b5f2
parentefb170c22867cdc6f770de441bdefecec6712199 (diff)
make fs/{namespace,super}.c forget about acct.h
These externs belong in fs/internal.h. Rename (they are not acct-specific anymore) and move them over there. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/fs_pin.c9
-rw-r--r--fs/internal.h6
-rw-r--r--fs/namespace.c3
-rw-r--r--fs/super.c3
-rw-r--r--include/linux/acct.h2
5 files changed, 13 insertions, 10 deletions
diff --git a/fs/fs_pin.c b/fs/fs_pin.c
index f3ce0b874a44..9368236ca100 100644
--- a/fs/fs_pin.c
+++ b/fs/fs_pin.c
@@ -1,6 +1,7 @@
1#include <linux/fs.h> 1#include <linux/fs.h>
2#include <linux/slab.h> 2#include <linux/slab.h>
3#include <linux/fs_pin.h> 3#include <linux/fs_pin.h>
4#include "internal.h"
4#include "mount.h" 5#include "mount.h"
5 6
6static void pin_free_rcu(struct rcu_head *head) 7static void pin_free_rcu(struct rcu_head *head)
@@ -32,13 +33,13 @@ void pin_insert(struct fs_pin *pin, struct vfsmount *m)
32 spin_unlock(&pin_lock); 33 spin_unlock(&pin_lock);
33} 34}
34 35
35void acct_auto_close_mnt(struct hlist_head *list) 36void mnt_pin_kill(struct mount *m)
36{ 37{
37 while (1) { 38 while (1) {
38 struct hlist_node *p; 39 struct hlist_node *p;
39 struct fs_pin *pin; 40 struct fs_pin *pin;
40 rcu_read_lock(); 41 rcu_read_lock();
41 p = ACCESS_ONCE(list->first); 42 p = ACCESS_ONCE(m->mnt_pins.first);
42 if (!p) { 43 if (!p) {
43 rcu_read_unlock(); 44 rcu_read_unlock();
44 break; 45 break;
@@ -54,13 +55,13 @@ void acct_auto_close_mnt(struct hlist_head *list)
54 } 55 }
55} 56}
56 57
57void acct_auto_close(struct hlist_head *list) 58void sb_pin_kill(struct super_block *sb)
58{ 59{
59 while (1) { 60 while (1) {
60 struct hlist_node *p; 61 struct hlist_node *p;
61 struct fs_pin *pin; 62 struct fs_pin *pin;
62 rcu_read_lock(); 63 rcu_read_lock();
63 p = ACCESS_ONCE(list->first); 64 p = ACCESS_ONCE(sb->s_pins.first);
64 if (!p) { 65 if (!p) {
65 rcu_read_unlock(); 66 rcu_read_unlock();
66 break; 67 break;
diff --git a/fs/internal.h b/fs/internal.h
index 9a2edba87c2b..e325b4f9c799 100644
--- a/fs/internal.h
+++ b/fs/internal.h
@@ -143,3 +143,9 @@ extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
143 * pipe.c 143 * pipe.c
144 */ 144 */
145extern const struct file_operations pipefifo_fops; 145extern const struct file_operations pipefifo_fops;
146
147/*
148 * fs_pin.c
149 */
150extern void sb_pin_kill(struct super_block *sb);
151extern void mnt_pin_kill(struct mount *m);
diff --git a/fs/namespace.c b/fs/namespace.c
index 22e530addfaf..0e4ce51c5277 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -16,7 +16,6 @@
16#include <linux/namei.h> 16#include <linux/namei.h>
17#include <linux/security.h> 17#include <linux/security.h>
18#include <linux/idr.h> 18#include <linux/idr.h>
19#include <linux/acct.h> /* acct_auto_close_mnt */
20#include <linux/init.h> /* init_rootfs */ 19#include <linux/init.h> /* init_rootfs */
21#include <linux/fs_struct.h> /* get_fs_root et.al. */ 20#include <linux/fs_struct.h> /* get_fs_root et.al. */
22#include <linux/fsnotify.h> /* fsnotify_vfsmount_delete */ 21#include <linux/fsnotify.h> /* fsnotify_vfsmount_delete */
@@ -956,7 +955,7 @@ put_again:
956 mnt->mnt_pinned = 0; 955 mnt->mnt_pinned = 0;
957 rcu_read_unlock(); 956 rcu_read_unlock();
958 unlock_mount_hash(); 957 unlock_mount_hash();
959 acct_auto_close_mnt(&mnt->mnt_pins); 958 mnt_pin_kill(mnt);
960 goto put_again; 959 goto put_again;
961 } 960 }
962 if (unlikely(mnt->mnt.mnt_flags & MNT_DOOMED)) { 961 if (unlikely(mnt->mnt.mnt_flags & MNT_DOOMED)) {
diff --git a/fs/super.c b/fs/super.c
index a369f8964dc1..a371ce6aa919 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -22,7 +22,6 @@
22 22
23#include <linux/export.h> 23#include <linux/export.h>
24#include <linux/slab.h> 24#include <linux/slab.h>
25#include <linux/acct.h>
26#include <linux/blkdev.h> 25#include <linux/blkdev.h>
27#include <linux/mount.h> 26#include <linux/mount.h>
28#include <linux/security.h> 27#include <linux/security.h>
@@ -707,7 +706,7 @@ int do_remount_sb(struct super_block *sb, int flags, void *data, int force)
707 if (remount_ro) { 706 if (remount_ro) {
708 if (sb->s_pins.first) { 707 if (sb->s_pins.first) {
709 up_write(&sb->s_umount); 708 up_write(&sb->s_umount);
710 acct_auto_close(&sb->s_pins); 709 sb_pin_kill(sb);
711 down_write(&sb->s_umount); 710 down_write(&sb->s_umount);
712 if (!sb->s_root) 711 if (!sb->s_root)
713 return 0; 712 return 0;
diff --git a/include/linux/acct.h b/include/linux/acct.h
index 137837929dbe..dccc2d4fe7de 100644
--- a/include/linux/acct.h
+++ b/include/linux/acct.h
@@ -32,8 +32,6 @@ extern void acct_exit_ns(struct pid_namespace *);
32#define acct_process() do { } while (0) 32#define acct_process() do { } while (0)
33#define acct_exit_ns(ns) do { } while (0) 33#define acct_exit_ns(ns) do { } while (0)
34#endif 34#endif
35extern void acct_auto_close(struct hlist_head *);
36extern void acct_auto_close_mnt(struct hlist_head *);
37 35
38/* 36/*
39 * ACCT_VERSION numbers as yet defined: 37 * ACCT_VERSION numbers as yet defined: