Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0f0dd62f authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jan Kara
Browse files

quota: kill the vfs_dq_off and vfs_dq_quota_on_remount wrappers



Instead of having wrappers in the VFS namespace export the dquot_suspend
and dquot_resume helpers directly.  Also rename vfs_quota_disable to
dquot_disable while we're at it.

[Jan Kara: Moved dquot_suspend to quotaops.h and made it inline]

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent c79d967d
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -1250,9 +1250,8 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data)
		es->s_mtime = cpu_to_le32(get_seconds());
		spin_unlock(&sbi->s_lock);

		err = vfs_dq_off(sb, 1);
		if (err < 0 && err != -ENOSYS) {
			err = -EBUSY;
		err = dquot_suspend(sb, -1);
		if (err < 0) {
			spin_lock(&sbi->s_lock);
			goto restore_opts;
		}
@@ -1281,7 +1280,7 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data)

		ext2_write_super(sb);

		vfs_dq_quota_on_remount(sb);
		dquot_resume(sb, -1);
	}

	return 0;
+3 −5
Original line number Diff line number Diff line
@@ -2598,11 +2598,9 @@ static int ext3_remount (struct super_block * sb, int * flags, char * data)
		}

		if (*flags & MS_RDONLY) {
			err = vfs_dq_off(sb, 1);
			if (err < 0 && err != -ENOSYS) {
				err = -EBUSY;
			err = dquot_suspend(sb, -1);
			if (err < 0)
				goto restore_opts;
			}

			/*
			 * First of all, the unconditional stuff we have to do
@@ -2672,7 +2670,7 @@ static int ext3_remount (struct super_block * sb, int * flags, char * data)
	unlock_kernel();

	if (enable_quota)
		vfs_dq_quota_on_remount(sb);
		dquot_resume(sb, -1);
	return 0;
restore_opts:
	sb->s_flags = old_sb_flags;
+3 −5
Original line number Diff line number Diff line
@@ -3631,11 +3631,9 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
		}

		if (*flags & MS_RDONLY) {
			err = vfs_dq_off(sb, 1);
			if (err < 0 && err != -ENOSYS) {
				err = -EBUSY;
			err = dquot_suspend(sb, -1);
			if (err < 0)
				goto restore_opts;
			}

			/*
			 * First of all, the unconditional stuff we have to do
@@ -3722,7 +3720,7 @@ static int ext4_remount(struct super_block *sb, int *flags, char *data)
	unlock_super(sb);
	unlock_kernel();
	if (enable_quota)
		vfs_dq_quota_on_remount(sb);
		dquot_resume(sb, -1);
	return 0;

restore_opts:
+4 −4
Original line number Diff line number Diff line
@@ -401,14 +401,14 @@ static int jfs_remount(struct super_block *sb, int *flags, char *data)
		sb->s_flags &= ~MS_RDONLY;

		unlock_kernel();
		vfs_dq_quota_on_remount(sb);
		dquot_resume(sb, -1);
		return ret;
	}
	if ((!(sb->s_flags & MS_RDONLY)) && (*flags & MS_RDONLY)) {
		rc = vfs_dq_off(sb, 1);
		if (rc < 0 && rc != -ENOSYS) {
		rc = dquot_suspend(sb, -1);
		if (rc < 0) {
			unlock_kernel();
			return -EBUSY;
			return rc;
		}
		rc = jfs_umount_rw(sb);
		JFS_SBI(sb)->flag = flag;
+5 −9
Original line number Diff line number Diff line
@@ -879,18 +879,14 @@ static int ocfs2_susp_quotas(struct ocfs2_super *osb, int unsuspend)
		if (!OCFS2_HAS_RO_COMPAT_FEATURE(sb, feature[type]))
			continue;
		if (unsuspend)
			status = vfs_quota_enable(
					sb_dqopt(sb)->files[type],
					type, QFMT_OCFS2,
					DQUOT_SUSPENDED);
			status = dquot_resume(sb, type);
		else {
			struct ocfs2_mem_dqinfo *oinfo;

			/* Cancel periodic syncing before suspending */
			oinfo = sb_dqinfo(sb, type)->dqi_priv;
			cancel_delayed_work_sync(&oinfo->dqi_sync_work);
			status = vfs_quota_disable(sb, type,
						   DQUOT_SUSPENDED);
			status = dquot_suspend(sb, type);
		}
		if (status < 0)
			break;
@@ -958,7 +954,7 @@ static void ocfs2_disable_quotas(struct ocfs2_super *osb)
		/* Turn off quotas. This will remove all dquot structures from
		 * memory and so they will be automatically synced to global
		 * quota files */
		vfs_quota_disable(sb, type, DQUOT_USAGE_ENABLED |
		dquot_disable(sb, type, DQUOT_USAGE_ENABLED |
					DQUOT_LIMITS_ENABLED);
		if (!inode)
			continue;
@@ -989,7 +985,7 @@ static int ocfs2_quota_off(struct super_block *sb, int type, int remount)
	if (remount)
		return 0;	/* Ignore now and handle later in
				 * ocfs2_remount() */
	return vfs_quota_disable(sb, type, DQUOT_LIMITS_ENABLED);
	return dquot_disable(sb, type, DQUOT_LIMITS_ENABLED);
}

static const struct quotactl_ops ocfs2_quotactl_ops = {
Loading