diff options
-rw-r--r-- | fs/quota/quota.c | 25 | ||||
-rw-r--r-- | fs/sync.c | 2 | ||||
-rw-r--r-- | include/linux/quotaops.h | 11 |
3 files changed, 18 insertions, 20 deletions
diff --git a/fs/quota/quota.c b/fs/quota/quota.c index b7f5a468f076..95c5b42384b2 100644 --- a/fs/quota/quota.c +++ b/fs/quota/quota.c | |||
@@ -159,10 +159,14 @@ static int check_quotactl_valid(struct super_block *sb, int type, int cmd, | |||
159 | return error; | 159 | return error; |
160 | } | 160 | } |
161 | 161 | ||
162 | static void quota_sync_sb(struct super_block *sb, int type) | 162 | #ifdef CONFIG_QUOTA |
163 | void sync_quota_sb(struct super_block *sb, int type) | ||
163 | { | 164 | { |
164 | int cnt; | 165 | int cnt; |
165 | 166 | ||
167 | if (!sb->s_qcop->quota_sync) | ||
168 | return; | ||
169 | |||
166 | sb->s_qcop->quota_sync(sb, type); | 170 | sb->s_qcop->quota_sync(sb, type); |
167 | 171 | ||
168 | if (sb_dqopt(sb)->flags & DQUOT_QUOTA_SYS_FILE) | 172 | if (sb_dqopt(sb)->flags & DQUOT_QUOTA_SYS_FILE) |
@@ -191,17 +195,13 @@ static void quota_sync_sb(struct super_block *sb, int type) | |||
191 | } | 195 | } |
192 | mutex_unlock(&sb_dqopt(sb)->dqonoff_mutex); | 196 | mutex_unlock(&sb_dqopt(sb)->dqonoff_mutex); |
193 | } | 197 | } |
198 | #endif | ||
194 | 199 | ||
195 | void sync_dquots(struct super_block *sb, int type) | 200 | static void sync_dquots(int type) |
196 | { | 201 | { |
202 | struct super_block *sb; | ||
197 | int cnt; | 203 | int cnt; |
198 | 204 | ||
199 | if (sb) { | ||
200 | if (sb->s_qcop->quota_sync) | ||
201 | quota_sync_sb(sb, type); | ||
202 | return; | ||
203 | } | ||
204 | |||
205 | spin_lock(&sb_lock); | 205 | spin_lock(&sb_lock); |
206 | restart: | 206 | restart: |
207 | list_for_each_entry(sb, &super_blocks, s_list) { | 207 | list_for_each_entry(sb, &super_blocks, s_list) { |
@@ -222,8 +222,8 @@ restart: | |||
222 | sb->s_count++; | 222 | sb->s_count++; |
223 | spin_unlock(&sb_lock); | 223 | spin_unlock(&sb_lock); |
224 | down_read(&sb->s_umount); | 224 | down_read(&sb->s_umount); |
225 | if (sb->s_root && sb->s_qcop->quota_sync) | 225 | if (sb->s_root) |
226 | quota_sync_sb(sb, type); | 226 | sync_quota_sb(sb, type); |
227 | up_read(&sb->s_umount); | 227 | up_read(&sb->s_umount); |
228 | spin_lock(&sb_lock); | 228 | spin_lock(&sb_lock); |
229 | if (__put_super_and_need_restart(sb)) | 229 | if (__put_super_and_need_restart(sb)) |
@@ -301,7 +301,10 @@ static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id, | |||
301 | return sb->s_qcop->set_dqblk(sb, type, id, &idq); | 301 | return sb->s_qcop->set_dqblk(sb, type, id, &idq); |
302 | } | 302 | } |
303 | case Q_SYNC: | 303 | case Q_SYNC: |
304 | sync_dquots(sb, type); | 304 | if (sb) |
305 | sync_quota_sb(sb, type); | ||
306 | else | ||
307 | sync_dquots(type); | ||
305 | return 0; | 308 | return 0; |
306 | 309 | ||
307 | case Q_XQUOTAON: | 310 | case Q_XQUOTAON: |
@@ -27,7 +27,7 @@ | |||
27 | */ | 27 | */ |
28 | static int __sync_filesystem(struct super_block *sb, int wait) | 28 | static int __sync_filesystem(struct super_block *sb, int wait) |
29 | { | 29 | { |
30 | vfs_dq_sync(sb); | 30 | sync_quota_sb(sb, -1); |
31 | sync_inodes_sb(sb, wait); | 31 | sync_inodes_sb(sb, wait); |
32 | lock_super(sb); | 32 | lock_super(sb); |
33 | if (sb->s_dirt && sb->s_op->write_super) | 33 | if (sb->s_dirt && sb->s_op->write_super) |
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index 36353d95c8db..047310fa22fb 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h | |||
@@ -20,7 +20,7 @@ static inline struct quota_info *sb_dqopt(struct super_block *sb) | |||
20 | /* | 20 | /* |
21 | * declaration of quota_function calls in kernel. | 21 | * declaration of quota_function calls in kernel. |
22 | */ | 22 | */ |
23 | void sync_dquots(struct super_block *sb, int type); | 23 | void sync_quota_sb(struct super_block *sb, int type); |
24 | 24 | ||
25 | int dquot_initialize(struct inode *inode, int type); | 25 | int dquot_initialize(struct inode *inode, int type); |
26 | int dquot_drop(struct inode *inode); | 26 | int dquot_drop(struct inode *inode); |
@@ -253,12 +253,7 @@ static inline void vfs_dq_free_inode(struct inode *inode) | |||
253 | inode->i_sb->dq_op->free_inode(inode, 1); | 253 | inode->i_sb->dq_op->free_inode(inode, 1); |
254 | } | 254 | } |
255 | 255 | ||
256 | /* The following two functions cannot be called inside a transaction */ | 256 | /* Cannot be called inside a transaction */ |
257 | static inline void vfs_dq_sync(struct super_block *sb) | ||
258 | { | ||
259 | sync_dquots(sb, -1); | ||
260 | } | ||
261 | |||
262 | static inline int vfs_dq_off(struct super_block *sb, int remount) | 257 | static inline int vfs_dq_off(struct super_block *sb, int remount) |
263 | { | 258 | { |
264 | int ret = -ENOSYS; | 259 | int ret = -ENOSYS; |
@@ -334,7 +329,7 @@ static inline void vfs_dq_free_inode(struct inode *inode) | |||
334 | { | 329 | { |
335 | } | 330 | } |
336 | 331 | ||
337 | static inline void vfs_dq_sync(struct super_block *sb) | 332 | static inline void sync_quota_sb(struct super_block *sb, int type) |
338 | { | 333 | { |
339 | } | 334 | } |
340 | 335 | ||