diff options
-rw-r--r-- | fs/drop_caches.c | 1 | ||||
-rw-r--r-- | fs/internal.h | 2 | ||||
-rw-r--r-- | fs/quota/quota.c | 1 | ||||
-rw-r--r-- | fs/super.c | 30 | ||||
-rw-r--r-- | include/linux/fs.h | 3 |
5 files changed, 6 insertions, 31 deletions
diff --git a/fs/drop_caches.c b/fs/drop_caches.c index 42728a1f795f..52047cf4177f 100644 --- a/fs/drop_caches.c +++ b/fs/drop_caches.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/writeback.h> | 8 | #include <linux/writeback.h> |
9 | #include <linux/sysctl.h> | 9 | #include <linux/sysctl.h> |
10 | #include <linux/gfp.h> | 10 | #include <linux/gfp.h> |
11 | #include "internal.h" | ||
11 | 12 | ||
12 | /* A global variable is a bit ugly, but it keeps the code simple */ | 13 | /* A global variable is a bit ugly, but it keeps the code simple */ |
13 | int sysctl_drop_caches; | 14 | int sysctl_drop_caches; |
diff --git a/fs/internal.h b/fs/internal.h index 8a03a5447bdf..6b706bc60a66 100644 --- a/fs/internal.h +++ b/fs/internal.h | |||
@@ -87,6 +87,8 @@ extern struct file *get_empty_filp(void); | |||
87 | * super.c | 87 | * super.c |
88 | */ | 88 | */ |
89 | extern int do_remount_sb(struct super_block *, int, void *, int); | 89 | extern int do_remount_sb(struct super_block *, int, void *, int); |
90 | extern void __put_super(struct super_block *sb); | ||
91 | extern void put_super(struct super_block *sb); | ||
90 | 92 | ||
91 | /* | 93 | /* |
92 | * open.c | 94 | * open.c |
diff --git a/fs/quota/quota.c b/fs/quota/quota.c index 2196f8b07c1f..3ce1553ea7eb 100644 --- a/fs/quota/quota.c +++ b/fs/quota/quota.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/quotaops.h> | 18 | #include <linux/quotaops.h> |
19 | #include <linux/types.h> | 19 | #include <linux/types.h> |
20 | #include <linux/writeback.h> | 20 | #include <linux/writeback.h> |
21 | #include "../internal.h" | ||
21 | 22 | ||
22 | static int check_quotactl_permission(struct super_block *sb, int type, int cmd, | 23 | static int check_quotactl_permission(struct super_block *sb, int type, int cmd, |
23 | qid_t id) | 24 | qid_t id) |
diff --git a/fs/super.c b/fs/super.c index 1f72e0d42d8f..95adbb3d8e58 100644 --- a/fs/super.c +++ b/fs/super.c | |||
@@ -127,40 +127,14 @@ static inline void destroy_super(struct super_block *s) | |||
127 | /* Superblock refcounting */ | 127 | /* Superblock refcounting */ |
128 | 128 | ||
129 | /* | 129 | /* |
130 | * Drop a superblock's refcount. Returns non-zero if the superblock was | 130 | * Drop a superblock's refcount. The caller must hold sb_lock. |
131 | * destroyed. The caller must hold sb_lock. | ||
132 | */ | 131 | */ |
133 | int __put_super(struct super_block *sb) | 132 | void __put_super(struct super_block *sb) |
134 | { | 133 | { |
135 | int ret = 0; | ||
136 | |||
137 | if (!--sb->s_count) { | 134 | if (!--sb->s_count) { |
138 | list_del_init(&sb->s_list); | 135 | list_del_init(&sb->s_list); |
139 | destroy_super(sb); | 136 | destroy_super(sb); |
140 | ret = 1; | ||
141 | } | ||
142 | return ret; | ||
143 | } | ||
144 | |||
145 | /* | ||
146 | * Drop a superblock's refcount. | ||
147 | * Returns non-zero if the superblock is about to be destroyed and | ||
148 | * at least is already removed from super_blocks list, so if we are | ||
149 | * making a loop through super blocks then we need to restart. | ||
150 | * The caller must hold sb_lock. | ||
151 | */ | ||
152 | int __put_super_and_need_restart(struct super_block *sb) | ||
153 | { | ||
154 | /* check for race with generic_shutdown_super() */ | ||
155 | if (list_empty(&sb->s_instances)) { | ||
156 | /* super block is removed, need to restart... */ | ||
157 | __put_super(sb); | ||
158 | return 1; | ||
159 | } | 137 | } |
160 | /* can't be the last, since s_list is still in use */ | ||
161 | sb->s_count--; | ||
162 | BUG_ON(sb->s_count == 0); | ||
163 | return 0; | ||
164 | } | 138 | } |
165 | 139 | ||
166 | /** | 140 | /** |
diff --git a/include/linux/fs.h b/include/linux/fs.h index e1c7427802b8..523086714c74 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1778,9 +1778,6 @@ extern int get_sb_pseudo(struct file_system_type *, char *, | |||
1778 | const struct super_operations *ops, unsigned long, | 1778 | const struct super_operations *ops, unsigned long, |
1779 | struct vfsmount *mnt); | 1779 | struct vfsmount *mnt); |
1780 | extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); | 1780 | extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); |
1781 | int __put_super_and_need_restart(struct super_block *sb); | ||
1782 | int __put_super(struct super_block *sb); | ||
1783 | void put_super(struct super_block *sb); | ||
1784 | 1781 | ||
1785 | /* Alas, no aliases. Too much hassle with bringing module.h everywhere */ | 1782 | /* Alas, no aliases. Too much hassle with bringing module.h everywhere */ |
1786 | #define fops_get(fops) \ | 1783 | #define fops_get(fops) \ |