From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: [PATCH 07/12] ext3: Convert to private i_dquot field Date: Fri, 10 Oct 2014 16:55:05 +0200 Message-ID: <1412952910-7142-8-git-send-email-jack@suse.cz> References: <1412952910-7142-1-git-send-email-jack@suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Dave Kleikamp , jfs-discussion@lists.sourceforge.net, tytso@mit.edu, Jeff Mahoney , Mark Fasheh , reiserfs-devel@vger.kernel.org, xfs@oss.sgi.com, cluster-devel@redhat.com, Joel Becker , Jan Kara , linux-ext4@vger.kernel.org, Steven Whitehouse , ocfs2-devel@oss.oracle.com, viro@zeniv.linux.org.uk To: linux-fsdevel@vger.kernel.org Return-path: In-Reply-To: <1412952910-7142-1-git-send-email-jack@suse.cz> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com List-Id: linux-fsdevel.vger.kernel.org CC: linux-ext4@vger.kernel.org Signed-off-by: Jan Kara --- fs/ext3/ext3.h | 4 ++++ fs/ext3/super.c | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/fs/ext3/ext3.h b/fs/ext3/ext3.h index e85ff15a060e..04f30a1f96cb 100644 --- a/fs/ext3/ext3.h +++ b/fs/ext3/ext3.h @@ -613,6 +613,10 @@ struct ext3_inode_info { atomic_t i_sync_tid; atomic_t i_datasync_tid; +#ifdef CONFIG_QUOTA + struct dquot *i_dquot[MAXQUOTAS]; +#endif + struct inode vfs_inode; }; diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 622e88249024..9e152626ab47 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) ei->vfs_inode.i_version = 1; atomic_set(&ei->i_datasync_tid, 0); atomic_set(&ei->i_sync_tid, 0); +#ifdef CONFIG_QUOTA + memset(&ei->i_dquot, 0, sizeof(ei->i_dquot)); +#endif + return &ei->vfs_inode; } @@ -807,6 +811,13 @@ static const struct super_operations ext3_sops = { .bdev_try_to_free_page = bdev_try_to_free_page, }; +static const int ext3_inode_fields[IF_FIELD_NR] = { +#ifdef CONFIG_QUOTA + [IF_DQUOTS] = (int)offsetof(struct ext3_inode_info, i_dquot) - + (int)offsetof(struct ext3_inode_info, vfs_inode), +#endif +}; + static const struct export_operations ext3_export_ops = { .fh_to_dentry = ext3_fh_to_dentry, .fh_to_parent = ext3_fh_to_parent, @@ -2008,7 +2019,9 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent) #ifdef CONFIG_QUOTA sb->s_qcop = &ext3_qctl_operations; sb->dq_op = &ext3_quota_operations; + sb_dqopt(sb)->allowed_types = QTYPE_MASK_USR | QTYPE_MASK_GRP; #endif + sb_init_inode_fields(sb, ext3_inode_fields); memcpy(sb->s_uuid, es->s_uuid, sizeof(es->s_uuid)); INIT_LIST_HEAD(&sbi->s_orphan); /* unlinked but open files */ mutex_init(&sbi->s_orphan_lock); -- 1.8.1.4 _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Date: Fri, 10 Oct 2014 16:55:05 +0200 Subject: [Ocfs2-devel] [PATCH 07/12] ext3: Convert to private i_dquot field In-Reply-To: <1412952910-7142-1-git-send-email-jack@suse.cz> References: <1412952910-7142-1-git-send-email-jack@suse.cz> Message-ID: <1412952910-7142-8-git-send-email-jack@suse.cz> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-fsdevel@vger.kernel.org Cc: Dave Kleikamp , jfs-discussion@lists.sourceforge.net, tytso@mit.edu, Jeff Mahoney , Mark Fasheh , reiserfs-devel@vger.kernel.org, xfs@oss.sgi.com, cluster-devel@redhat.com, Joel Becker , Jan Kara , linux-ext4@vger.kernel.org, Steven Whitehouse , ocfs2-devel@oss.oracle.com, viro@zeniv.linux.org.uk CC: linux-ext4 at vger.kernel.org Signed-off-by: Jan Kara --- fs/ext3/ext3.h | 4 ++++ fs/ext3/super.c | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/fs/ext3/ext3.h b/fs/ext3/ext3.h index e85ff15a060e..04f30a1f96cb 100644 --- a/fs/ext3/ext3.h +++ b/fs/ext3/ext3.h @@ -613,6 +613,10 @@ struct ext3_inode_info { atomic_t i_sync_tid; atomic_t i_datasync_tid; +#ifdef CONFIG_QUOTA + struct dquot *i_dquot[MAXQUOTAS]; +#endif + struct inode vfs_inode; }; diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 622e88249024..9e152626ab47 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) ei->vfs_inode.i_version = 1; atomic_set(&ei->i_datasync_tid, 0); atomic_set(&ei->i_sync_tid, 0); +#ifdef CONFIG_QUOTA + memset(&ei->i_dquot, 0, sizeof(ei->i_dquot)); +#endif + return &ei->vfs_inode; } @@ -807,6 +811,13 @@ static const struct super_operations ext3_sops = { .bdev_try_to_free_page = bdev_try_to_free_page, }; +static const int ext3_inode_fields[IF_FIELD_NR] = { +#ifdef CONFIG_QUOTA + [IF_DQUOTS] = (int)offsetof(struct ext3_inode_info, i_dquot) - + (int)offsetof(struct ext3_inode_info, vfs_inode), +#endif +}; + static const struct export_operations ext3_export_ops = { .fh_to_dentry = ext3_fh_to_dentry, .fh_to_parent = ext3_fh_to_parent, @@ -2008,7 +2019,9 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent) #ifdef CONFIG_QUOTA sb->s_qcop = &ext3_qctl_operations; sb->dq_op = &ext3_quota_operations; + sb_dqopt(sb)->allowed_types = QTYPE_MASK_USR | QTYPE_MASK_GRP; #endif + sb_init_inode_fields(sb, ext3_inode_fields); memcpy(sb->s_uuid, es->s_uuid, sizeof(es->s_uuid)); INIT_LIST_HEAD(&sbi->s_orphan); /* unlinked but open files */ mutex_init(&sbi->s_orphan_lock); -- 1.8.1.4 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Date: Fri, 10 Oct 2014 16:55:05 +0200 Subject: [Cluster-devel] [PATCH 07/12] ext3: Convert to private i_dquot field In-Reply-To: <1412952910-7142-1-git-send-email-jack@suse.cz> References: <1412952910-7142-1-git-send-email-jack@suse.cz> Message-ID: <1412952910-7142-8-git-send-email-jack@suse.cz> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CC: linux-ext4 at vger.kernel.org Signed-off-by: Jan Kara --- fs/ext3/ext3.h | 4 ++++ fs/ext3/super.c | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/fs/ext3/ext3.h b/fs/ext3/ext3.h index e85ff15a060e..04f30a1f96cb 100644 --- a/fs/ext3/ext3.h +++ b/fs/ext3/ext3.h @@ -613,6 +613,10 @@ struct ext3_inode_info { atomic_t i_sync_tid; atomic_t i_datasync_tid; +#ifdef CONFIG_QUOTA + struct dquot *i_dquot[MAXQUOTAS]; +#endif + struct inode vfs_inode; }; diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 622e88249024..9e152626ab47 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) ei->vfs_inode.i_version = 1; atomic_set(&ei->i_datasync_tid, 0); atomic_set(&ei->i_sync_tid, 0); +#ifdef CONFIG_QUOTA + memset(&ei->i_dquot, 0, sizeof(ei->i_dquot)); +#endif + return &ei->vfs_inode; } @@ -807,6 +811,13 @@ static const struct super_operations ext3_sops = { .bdev_try_to_free_page = bdev_try_to_free_page, }; +static const int ext3_inode_fields[IF_FIELD_NR] = { +#ifdef CONFIG_QUOTA + [IF_DQUOTS] = (int)offsetof(struct ext3_inode_info, i_dquot) - + (int)offsetof(struct ext3_inode_info, vfs_inode), +#endif +}; + static const struct export_operations ext3_export_ops = { .fh_to_dentry = ext3_fh_to_dentry, .fh_to_parent = ext3_fh_to_parent, @@ -2008,7 +2019,9 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent) #ifdef CONFIG_QUOTA sb->s_qcop = &ext3_qctl_operations; sb->dq_op = &ext3_quota_operations; + sb_dqopt(sb)->allowed_types = QTYPE_MASK_USR | QTYPE_MASK_GRP; #endif + sb_init_inode_fields(sb, ext3_inode_fields); memcpy(sb->s_uuid, es->s_uuid, sizeof(es->s_uuid)); INIT_LIST_HEAD(&sbi->s_orphan); /* unlinked but open files */ mutex_init(&sbi->s_orphan_lock); -- 1.8.1.4