diff options
author | Jan Kara <jack@suse.cz> | 2014-09-25 10:52:38 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2014-11-10 04:06:10 -0500 |
commit | 4018cfbc8cc974d35c05d651456023426a12fbac (patch) | |
tree | 299bb768692b109a8309fdda5d8207ff16b892d8 | |
parent | 64241118b718f6f1e7bbbad8c4567f36b65ca31a (diff) |
ext3: Convert to private i_dquot field
CC: linux-ext4@vger.kernel.org
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r-- | fs/ext3/ext3.h | 4 | ||||
-rw-r--r-- | fs/ext3/super.c | 10 |
2 files changed, 14 insertions, 0 deletions
diff --git a/fs/ext3/ext3.h b/fs/ext3/ext3.h index fc3cdcf24aed..f483a80b3fe7 100644 --- a/fs/ext3/ext3.h +++ b/fs/ext3/ext3.h | |||
@@ -615,6 +615,10 @@ struct ext3_inode_info { | |||
615 | atomic_t i_sync_tid; | 615 | atomic_t i_sync_tid; |
616 | atomic_t i_datasync_tid; | 616 | atomic_t i_datasync_tid; |
617 | 617 | ||
618 | #ifdef CONFIG_QUOTA | ||
619 | struct dquot *i_dquot[MAXQUOTAS]; | ||
620 | #endif | ||
621 | |||
618 | struct inode vfs_inode; | 622 | struct inode vfs_inode; |
619 | }; | 623 | }; |
620 | 624 | ||
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index eb742d0e67ff..9b4e7d750d4f 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
@@ -485,6 +485,10 @@ static struct inode *ext3_alloc_inode(struct super_block *sb) | |||
485 | ei->vfs_inode.i_version = 1; | 485 | ei->vfs_inode.i_version = 1; |
486 | atomic_set(&ei->i_datasync_tid, 0); | 486 | atomic_set(&ei->i_datasync_tid, 0); |
487 | atomic_set(&ei->i_sync_tid, 0); | 487 | atomic_set(&ei->i_sync_tid, 0); |
488 | #ifdef CONFIG_QUOTA | ||
489 | memset(&ei->i_dquot, 0, sizeof(ei->i_dquot)); | ||
490 | #endif | ||
491 | |||
488 | return &ei->vfs_inode; | 492 | return &ei->vfs_inode; |
489 | } | 493 | } |
490 | 494 | ||
@@ -764,6 +768,10 @@ static ssize_t ext3_quota_read(struct super_block *sb, int type, char *data, | |||
764 | size_t len, loff_t off); | 768 | size_t len, loff_t off); |
765 | static ssize_t ext3_quota_write(struct super_block *sb, int type, | 769 | static ssize_t ext3_quota_write(struct super_block *sb, int type, |
766 | const char *data, size_t len, loff_t off); | 770 | const char *data, size_t len, loff_t off); |
771 | static struct dquot **ext3_get_dquots(struct inode *inode) | ||
772 | { | ||
773 | return EXT3_I(inode)->i_dquot; | ||
774 | } | ||
767 | 775 | ||
768 | static const struct dquot_operations ext3_quota_operations = { | 776 | static const struct dquot_operations ext3_quota_operations = { |
769 | .write_dquot = ext3_write_dquot, | 777 | .write_dquot = ext3_write_dquot, |
@@ -803,6 +811,7 @@ static const struct super_operations ext3_sops = { | |||
803 | #ifdef CONFIG_QUOTA | 811 | #ifdef CONFIG_QUOTA |
804 | .quota_read = ext3_quota_read, | 812 | .quota_read = ext3_quota_read, |
805 | .quota_write = ext3_quota_write, | 813 | .quota_write = ext3_quota_write, |
814 | .get_dquots = ext3_get_dquots, | ||
806 | #endif | 815 | #endif |
807 | .bdev_try_to_free_page = bdev_try_to_free_page, | 816 | .bdev_try_to_free_page = bdev_try_to_free_page, |
808 | }; | 817 | }; |
@@ -2001,6 +2010,7 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent) | |||
2001 | #ifdef CONFIG_QUOTA | 2010 | #ifdef CONFIG_QUOTA |
2002 | sb->s_qcop = &ext3_qctl_operations; | 2011 | sb->s_qcop = &ext3_qctl_operations; |
2003 | sb->dq_op = &ext3_quota_operations; | 2012 | sb->dq_op = &ext3_quota_operations; |
2013 | sb->s_quota_types = QTYPE_MASK_USR | QTYPE_MASK_GRP; | ||
2004 | #endif | 2014 | #endif |
2005 | memcpy(sb->s_uuid, es->s_uuid, sizeof(es->s_uuid)); | 2015 | memcpy(sb->s_uuid, es->s_uuid, sizeof(es->s_uuid)); |
2006 | INIT_LIST_HEAD(&sbi->s_orphan); /* unlinked but open files */ | 2016 | INIT_LIST_HEAD(&sbi->s_orphan); /* unlinked but open files */ |