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

Commit 123e9caf authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jan Kara
Browse files

quota: explicitly set ->dq_op and ->s_qcop



Only set the quota operation vectors if the filesystem actually supports
quota instead of doing it for all filesystems in alloc_super().

[Jan Kara: Export dquot_operations and vfs_quotactl_ops]

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 307ae18a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1065,6 +1065,12 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
	sb->s_op = &ext2_sops;
	sb->s_export_op = &ext2_export_ops;
	sb->s_xattr = ext2_xattr_handlers;

#ifdef CONFIG_QUOTA
	sb->dq_op = &dquot_operations;
	sb->s_qcop = &vfs_quotactl_ops;
#endif

	root = ext2_iget(sb, EXT2_ROOT_INO);
	if (IS_ERR(root)) {
		ret = PTR_ERR(root);
+4 −0
Original line number Diff line number Diff line
@@ -481,6 +481,10 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
	 */
	sb->s_op = &jfs_super_operations;
	sb->s_export_op = &jfs_export_operations;
#ifdef CONFIG_QUOTA
	sb->dq_op = &dquot_operations;
	sb->s_qcop = &vfs_quotactl_ops;
#endif

	/*
	 * Initialize direct-mapping inode/address-space
+2 −1
Original line number Diff line number Diff line
@@ -1847,6 +1847,7 @@ const struct dquot_operations dquot_operations = {
	.alloc_dquot	= dquot_alloc,
	.destroy_dquot	= dquot_destroy,
};
EXPORT_SYMBOL(dquot_operations);

/*
 * Generic helper for ->open on filesystems supporting disk quotas.
@@ -2491,7 +2492,7 @@ const struct quotactl_ops vfs_quotactl_ops = {
	.get_dqblk	= vfs_get_dqblk,
	.set_dqblk	= vfs_set_dqblk
};

EXPORT_SYMBOL(vfs_quotactl_ops);

static int do_proc_dqstats(struct ctl_table *table, int write,
		     void __user *buffer, size_t *lenp, loff_t *ppos)
+0 −3
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@
#include <linux/slab.h>
#include <linux/acct.h>
#include <linux/blkdev.h>
#include <linux/quotaops.h>
#include <linux/mount.h>
#include <linux/security.h>
#include <linux/writeback.h>		/* for the emergency remount stuff */
@@ -94,8 +93,6 @@ static struct super_block *alloc_super(struct file_system_type *type)
		init_rwsem(&s->s_dquot.dqptr_sem);
		init_waitqueue_head(&s->s_wait_unfrozen);
		s->s_maxbytes = MAX_NON_LFS;
		s->dq_op = sb_dquot_ops;
		s->s_qcop = sb_quotactl_ops;
		s->s_op = &default_op;
		s->s_time_gran = 1000000000;
	}
+5 −1
Original line number Diff line number Diff line
@@ -1948,7 +1948,11 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent)
	/* Fill in the rest of the superblock */
	sb->s_op = &udf_sb_ops;
	sb->s_export_op = &udf_export_ops;
	sb->dq_op = NULL;
#ifdef CONFIG_QUOTA
	sb->s_qcop = &vfs_quotactl_ops;
	sb->dq_op = NULL; /* &dquot_operations */
#endif

	sb->s_dirt = 0;
	sb->s_magic = UDF_SUPER_MAGIC;
	sb->s_time_gran = 1000;
Loading