]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - fs/quota/quota.c
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6
[mv-sheeva.git] / fs / quota / quota.c
index cfc78826da90902f770f06dbfd34a5beba431097..ce3dfd066f590a2b35a22fa14f01a60b2bc1d650 100644 (file)
@@ -45,36 +45,22 @@ static int check_quotactl_permission(struct super_block *sb, int type, int cmd,
        return security_quotactl(cmd, type, id, sb);
 }
 
+static void quota_sync_one(struct super_block *sb, void *arg)
+{
+       if (sb->s_qcop && sb->s_qcop->quota_sync)
+               sb->s_qcop->quota_sync(sb, *(int *)arg, 1);
+}
+
 static int quota_sync_all(int type)
 {
-       struct super_block *sb;
        int ret;
 
        if (type >= MAXQUOTAS)
                return -EINVAL;
        ret = security_quotactl(Q_SYNC, type, 0, NULL);
-       if (ret)
-               return ret;
-
-       spin_lock(&sb_lock);
-restart:
-       list_for_each_entry(sb, &super_blocks, s_list) {
-               if (!sb->s_qcop || !sb->s_qcop->quota_sync)
-                       continue;
-
-               sb->s_count++;
-               spin_unlock(&sb_lock);
-               down_read(&sb->s_umount);
-               if (sb->s_root)
-                       sb->s_qcop->quota_sync(sb, type, 1);
-               up_read(&sb->s_umount);
-               spin_lock(&sb_lock);
-               if (__put_super_and_need_restart(sb))
-                       goto restart;
-       }
-       spin_unlock(&sb_lock);
-
-       return 0;
+       if (!ret)
+               iterate_supers(quota_sync_one, &type);
+       return ret;
 }
 
 static int quota_quotaon(struct super_block *sb, int type, int cmd, qid_t id,