All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3 v2] Q_GETNEXTQUOTA support
@ 2016-02-04 14:28 ` Jan Kara
  0 siblings, 0 replies; 36+ messages in thread
From: Jan Kara @ 2016-02-04 14:28 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: ocfs2-devel, Mark Fasheh, Joel Becker, xfs, Jan Kara

Hello,

the patch set below adds support for VFS quotas for Q_GETNEXTQUOTA quotactl
and thus repquota(8) doesn't have to iterate over /etc/passwd or LDAP database
to report all quota limits. ext2, ext4, reiserfs, jfs, and ocfs2 support this
quotactl (and Q_XGETNEXTQUOTA as well) after applying this patch set. XFS
bits will likely get merged independently through XFS tree. If nobody objects,
I'll push these patches to my tree in a few days.

Changes since v2:
* Added get_next_id() operation to dquot_operations to allow for cleaner
  support in OCFS2
* Added OCFS2 support

								Honza

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH 0/3 v2] Q_GETNEXTQUOTA support
@ 2016-02-04 14:28 ` Jan Kara
  0 siblings, 0 replies; 36+ messages in thread
From: Jan Kara @ 2016-02-04 14:28 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: Mark Fasheh, Jan Kara, Joel Becker, ocfs2-devel, xfs

Hello,

the patch set below adds support for VFS quotas for Q_GETNEXTQUOTA quotactl
and thus repquota(8) doesn't have to iterate over /etc/passwd or LDAP database
to report all quota limits. ext2, ext4, reiserfs, jfs, and ocfs2 support this
quotactl (and Q_XGETNEXTQUOTA as well) after applying this patch set. XFS
bits will likely get merged independently through XFS tree. If nobody objects,
I'll push these patches to my tree in a few days.

Changes since v2:
* Added get_next_id() operation to dquot_operations to allow for cleaner
  support in OCFS2
* Added OCFS2 support

								Honza

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Ocfs2-devel] [PATCH 0/3 v2] Q_GETNEXTQUOTA support
@ 2016-02-04 14:28 ` Jan Kara
  0 siblings, 0 replies; 36+ messages in thread
From: Jan Kara @ 2016-02-04 14:28 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: ocfs2-devel, Mark Fasheh, Joel Becker, xfs, Jan Kara

Hello,

the patch set below adds support for VFS quotas for Q_GETNEXTQUOTA quotactl
and thus repquota(8) doesn't have to iterate over /etc/passwd or LDAP database
to report all quota limits. ext2, ext4, reiserfs, jfs, and ocfs2 support this
quotactl (and Q_XGETNEXTQUOTA as well) after applying this patch set. XFS
bits will likely get merged independently through XFS tree. If nobody objects,
I'll push these patches to my tree in a few days.

Changes since v2:
* Added get_next_id() operation to dquot_operations to allow for cleaner
  support in OCFS2
* Added OCFS2 support

								Honza

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota
  2016-02-04 14:28 ` Jan Kara
  (?)
@ 2016-02-04 14:28   ` Jan Kara
  -1 siblings, 0 replies; 36+ messages in thread
From: Jan Kara @ 2016-02-04 14:28 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: ocfs2-devel, Mark Fasheh, Joel Becker, xfs, Jan Kara

Add infrastructure for supporting get_nextdqblk() callback for VFS
quotas. Translate the operation into a callback to appropriate
filesystem and consequently to quota format callback.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/ext4/super.c          |  1 +
 fs/quota/dquot.c         | 39 +++++++++++++++++++++++++++++++++++++++
 fs/reiserfs/super.c      |  1 +
 include/linux/quota.h    |  3 +++
 include/linux/quotaops.h |  3 +++
 5 files changed, 47 insertions(+)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index f1b56ff01208..51649f442bf6 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1100,6 +1100,7 @@ static const struct dquot_operations ext4_quota_operations = {
 	.write_info	= ext4_write_info,
 	.alloc_dquot	= dquot_alloc,
 	.destroy_dquot	= dquot_destroy,
+	.get_next_id	= dquot_get_next_id,
 };
 
 static const struct quotactl_ops ext4_qctl_operations = {
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index fbd70af98820..f5c4967b62f1 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -2031,6 +2031,21 @@ int dquot_commit_info(struct super_block *sb, int type)
 }
 EXPORT_SYMBOL(dquot_commit_info);
 
+int dquot_get_next_id(struct super_block *sb, struct kqid *qid)
+{
+	struct quota_info *dqopt = sb_dqopt(sb);
+	int err;
+
+	if (!dqopt->ops[qid->type]->get_next_id)
+		return -ENOSYS;
+	mutex_lock(&dqopt->dqio_mutex);
+	err = dqopt->ops[qid->type]->get_next_id(sb, qid);
+	mutex_unlock(&dqopt->dqio_mutex);
+
+	return err;
+}
+EXPORT_SYMBOL(dquot_get_next_id);
+
 /*
  * Definitions of diskquota operations.
  */
@@ -2042,6 +2057,7 @@ const struct dquot_operations dquot_operations = {
 	.write_info	= dquot_commit_info,
 	.alloc_dquot	= dquot_alloc,
 	.destroy_dquot	= dquot_destroy,
+	.get_next_id	= dquot_get_next_id,
 };
 EXPORT_SYMBOL(dquot_operations);
 
@@ -2565,6 +2581,27 @@ int dquot_get_dqblk(struct super_block *sb, struct kqid qid,
 }
 EXPORT_SYMBOL(dquot_get_dqblk);
 
+int dquot_get_next_dqblk(struct super_block *sb, struct kqid *qid,
+			 struct qc_dqblk *di)
+{
+	struct dquot *dquot;
+	int err;
+
+	if (!sb->dq_op->get_next_id)
+		return -ENOSYS;
+	err = sb->dq_op->get_next_id(sb, qid);
+	if (err < 0)
+		return err;
+	dquot = dqget(sb, *qid);
+	if (IS_ERR(dquot))
+		return PTR_ERR(dquot);
+	do_get_dqblk(dquot, di);
+	dqput(dquot);
+
+	return 0;
+}
+EXPORT_SYMBOL(dquot_get_next_dqblk);
+
 #define VFS_QC_MASK \
 	(QC_SPACE | QC_SPC_SOFT | QC_SPC_HARD | \
 	 QC_INO_COUNT | QC_INO_SOFT | QC_INO_HARD | \
@@ -2765,6 +2802,7 @@ const struct quotactl_ops dquot_quotactl_ops = {
 	.get_state	= dquot_get_state,
 	.set_info	= dquot_set_dqinfo,
 	.get_dqblk	= dquot_get_dqblk,
+	.get_nextdqblk	= dquot_get_next_dqblk,
 	.set_dqblk	= dquot_set_dqblk
 };
 EXPORT_SYMBOL(dquot_quotactl_ops);
@@ -2776,6 +2814,7 @@ const struct quotactl_ops dquot_quotactl_sysfile_ops = {
 	.get_state	= dquot_get_state,
 	.set_info	= dquot_set_dqinfo,
 	.get_dqblk	= dquot_get_dqblk,
+	.get_nextdqblk	= dquot_get_next_dqblk,
 	.set_dqblk	= dquot_set_dqblk
 };
 EXPORT_SYMBOL(dquot_quotactl_sysfile_ops);
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 05db7473bcb5..b62f495add62 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -802,6 +802,7 @@ static const struct dquot_operations reiserfs_quota_operations = {
 	.write_info = reiserfs_write_info,
 	.alloc_dquot	= dquot_alloc,
 	.destroy_dquot	= dquot_destroy,
+	.get_next_id	= dquot_get_next_id,
 };
 
 static const struct quotactl_ops reiserfs_qctl_operations = {
diff --git a/include/linux/quota.h b/include/linux/quota.h
index fba92f5c1a63..9dfb6bce8c9e 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -306,6 +306,7 @@ struct quota_format_ops {
 	int (*read_dqblk)(struct dquot *dquot);		/* Read structure for one user */
 	int (*commit_dqblk)(struct dquot *dquot);	/* Write structure for one user */
 	int (*release_dqblk)(struct dquot *dquot);	/* Called when last reference to dquot is being dropped */
+	int (*get_next_id)(struct super_block *sb, struct kqid *qid);	/* Get next ID with existing structure in the quota file */
 };
 
 /* Operations working with dquots */
@@ -321,6 +322,8 @@ struct dquot_operations {
 	 * quota code only */
 	qsize_t *(*get_reserved_space) (struct inode *);
 	int (*get_projid) (struct inode *, kprojid_t *);/* Get project ID */
+	/* Get next ID with active quota structure */
+	int (*get_next_id) (struct super_block *sb, struct kqid *qid);
 };
 
 struct path;
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 7a57c28eb5e7..f00fa86ac966 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -82,6 +82,7 @@ int dquot_commit(struct dquot *dquot);
 int dquot_acquire(struct dquot *dquot);
 int dquot_release(struct dquot *dquot);
 int dquot_commit_info(struct super_block *sb, int type);
+int dquot_get_next_id(struct super_block *sb, struct kqid *qid);
 int dquot_mark_dquot_dirty(struct dquot *dquot);
 
 int dquot_file_open(struct inode *inode, struct file *file);
@@ -99,6 +100,8 @@ int dquot_get_state(struct super_block *sb, struct qc_state *state);
 int dquot_set_dqinfo(struct super_block *sb, int type, struct qc_info *ii);
 int dquot_get_dqblk(struct super_block *sb, struct kqid id,
 		struct qc_dqblk *di);
+int dquot_get_next_dqblk(struct super_block *sb, struct kqid *id,
+		struct qc_dqblk *di);
 int dquot_set_dqblk(struct super_block *sb, struct kqid id,
 		struct qc_dqblk *di);
 
-- 
2.6.2


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota
@ 2016-02-04 14:28   ` Jan Kara
  0 siblings, 0 replies; 36+ messages in thread
From: Jan Kara @ 2016-02-04 14:28 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: Mark Fasheh, Jan Kara, Joel Becker, ocfs2-devel, xfs

Add infrastructure for supporting get_nextdqblk() callback for VFS
quotas. Translate the operation into a callback to appropriate
filesystem and consequently to quota format callback.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/ext4/super.c          |  1 +
 fs/quota/dquot.c         | 39 +++++++++++++++++++++++++++++++++++++++
 fs/reiserfs/super.c      |  1 +
 include/linux/quota.h    |  3 +++
 include/linux/quotaops.h |  3 +++
 5 files changed, 47 insertions(+)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index f1b56ff01208..51649f442bf6 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1100,6 +1100,7 @@ static const struct dquot_operations ext4_quota_operations = {
 	.write_info	= ext4_write_info,
 	.alloc_dquot	= dquot_alloc,
 	.destroy_dquot	= dquot_destroy,
+	.get_next_id	= dquot_get_next_id,
 };
 
 static const struct quotactl_ops ext4_qctl_operations = {
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index fbd70af98820..f5c4967b62f1 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -2031,6 +2031,21 @@ int dquot_commit_info(struct super_block *sb, int type)
 }
 EXPORT_SYMBOL(dquot_commit_info);
 
+int dquot_get_next_id(struct super_block *sb, struct kqid *qid)
+{
+	struct quota_info *dqopt = sb_dqopt(sb);
+	int err;
+
+	if (!dqopt->ops[qid->type]->get_next_id)
+		return -ENOSYS;
+	mutex_lock(&dqopt->dqio_mutex);
+	err = dqopt->ops[qid->type]->get_next_id(sb, qid);
+	mutex_unlock(&dqopt->dqio_mutex);
+
+	return err;
+}
+EXPORT_SYMBOL(dquot_get_next_id);
+
 /*
  * Definitions of diskquota operations.
  */
@@ -2042,6 +2057,7 @@ const struct dquot_operations dquot_operations = {
 	.write_info	= dquot_commit_info,
 	.alloc_dquot	= dquot_alloc,
 	.destroy_dquot	= dquot_destroy,
+	.get_next_id	= dquot_get_next_id,
 };
 EXPORT_SYMBOL(dquot_operations);
 
@@ -2565,6 +2581,27 @@ int dquot_get_dqblk(struct super_block *sb, struct kqid qid,
 }
 EXPORT_SYMBOL(dquot_get_dqblk);
 
+int dquot_get_next_dqblk(struct super_block *sb, struct kqid *qid,
+			 struct qc_dqblk *di)
+{
+	struct dquot *dquot;
+	int err;
+
+	if (!sb->dq_op->get_next_id)
+		return -ENOSYS;
+	err = sb->dq_op->get_next_id(sb, qid);
+	if (err < 0)
+		return err;
+	dquot = dqget(sb, *qid);
+	if (IS_ERR(dquot))
+		return PTR_ERR(dquot);
+	do_get_dqblk(dquot, di);
+	dqput(dquot);
+
+	return 0;
+}
+EXPORT_SYMBOL(dquot_get_next_dqblk);
+
 #define VFS_QC_MASK \
 	(QC_SPACE | QC_SPC_SOFT | QC_SPC_HARD | \
 	 QC_INO_COUNT | QC_INO_SOFT | QC_INO_HARD | \
@@ -2765,6 +2802,7 @@ const struct quotactl_ops dquot_quotactl_ops = {
 	.get_state	= dquot_get_state,
 	.set_info	= dquot_set_dqinfo,
 	.get_dqblk	= dquot_get_dqblk,
+	.get_nextdqblk	= dquot_get_next_dqblk,
 	.set_dqblk	= dquot_set_dqblk
 };
 EXPORT_SYMBOL(dquot_quotactl_ops);
@@ -2776,6 +2814,7 @@ const struct quotactl_ops dquot_quotactl_sysfile_ops = {
 	.get_state	= dquot_get_state,
 	.set_info	= dquot_set_dqinfo,
 	.get_dqblk	= dquot_get_dqblk,
+	.get_nextdqblk	= dquot_get_next_dqblk,
 	.set_dqblk	= dquot_set_dqblk
 };
 EXPORT_SYMBOL(dquot_quotactl_sysfile_ops);
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 05db7473bcb5..b62f495add62 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -802,6 +802,7 @@ static const struct dquot_operations reiserfs_quota_operations = {
 	.write_info = reiserfs_write_info,
 	.alloc_dquot	= dquot_alloc,
 	.destroy_dquot	= dquot_destroy,
+	.get_next_id	= dquot_get_next_id,
 };
 
 static const struct quotactl_ops reiserfs_qctl_operations = {
diff --git a/include/linux/quota.h b/include/linux/quota.h
index fba92f5c1a63..9dfb6bce8c9e 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -306,6 +306,7 @@ struct quota_format_ops {
 	int (*read_dqblk)(struct dquot *dquot);		/* Read structure for one user */
 	int (*commit_dqblk)(struct dquot *dquot);	/* Write structure for one user */
 	int (*release_dqblk)(struct dquot *dquot);	/* Called when last reference to dquot is being dropped */
+	int (*get_next_id)(struct super_block *sb, struct kqid *qid);	/* Get next ID with existing structure in the quota file */
 };
 
 /* Operations working with dquots */
@@ -321,6 +322,8 @@ struct dquot_operations {
 	 * quota code only */
 	qsize_t *(*get_reserved_space) (struct inode *);
 	int (*get_projid) (struct inode *, kprojid_t *);/* Get project ID */
+	/* Get next ID with active quota structure */
+	int (*get_next_id) (struct super_block *sb, struct kqid *qid);
 };
 
 struct path;
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 7a57c28eb5e7..f00fa86ac966 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -82,6 +82,7 @@ int dquot_commit(struct dquot *dquot);
 int dquot_acquire(struct dquot *dquot);
 int dquot_release(struct dquot *dquot);
 int dquot_commit_info(struct super_block *sb, int type);
+int dquot_get_next_id(struct super_block *sb, struct kqid *qid);
 int dquot_mark_dquot_dirty(struct dquot *dquot);
 
 int dquot_file_open(struct inode *inode, struct file *file);
@@ -99,6 +100,8 @@ int dquot_get_state(struct super_block *sb, struct qc_state *state);
 int dquot_set_dqinfo(struct super_block *sb, int type, struct qc_info *ii);
 int dquot_get_dqblk(struct super_block *sb, struct kqid id,
 		struct qc_dqblk *di);
+int dquot_get_next_dqblk(struct super_block *sb, struct kqid *id,
+		struct qc_dqblk *di);
 int dquot_set_dqblk(struct super_block *sb, struct kqid id,
 		struct qc_dqblk *di);
 
-- 
2.6.2

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [Ocfs2-devel] [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota
@ 2016-02-04 14:28   ` Jan Kara
  0 siblings, 0 replies; 36+ messages in thread
From: Jan Kara @ 2016-02-04 14:28 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: ocfs2-devel, Mark Fasheh, Joel Becker, xfs, Jan Kara

Add infrastructure for supporting get_nextdqblk() callback for VFS
quotas. Translate the operation into a callback to appropriate
filesystem and consequently to quota format callback.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/ext4/super.c          |  1 +
 fs/quota/dquot.c         | 39 +++++++++++++++++++++++++++++++++++++++
 fs/reiserfs/super.c      |  1 +
 include/linux/quota.h    |  3 +++
 include/linux/quotaops.h |  3 +++
 5 files changed, 47 insertions(+)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index f1b56ff01208..51649f442bf6 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1100,6 +1100,7 @@ static const struct dquot_operations ext4_quota_operations = {
 	.write_info	= ext4_write_info,
 	.alloc_dquot	= dquot_alloc,
 	.destroy_dquot	= dquot_destroy,
+	.get_next_id	= dquot_get_next_id,
 };
 
 static const struct quotactl_ops ext4_qctl_operations = {
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index fbd70af98820..f5c4967b62f1 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -2031,6 +2031,21 @@ int dquot_commit_info(struct super_block *sb, int type)
 }
 EXPORT_SYMBOL(dquot_commit_info);
 
+int dquot_get_next_id(struct super_block *sb, struct kqid *qid)
+{
+	struct quota_info *dqopt = sb_dqopt(sb);
+	int err;
+
+	if (!dqopt->ops[qid->type]->get_next_id)
+		return -ENOSYS;
+	mutex_lock(&dqopt->dqio_mutex);
+	err = dqopt->ops[qid->type]->get_next_id(sb, qid);
+	mutex_unlock(&dqopt->dqio_mutex);
+
+	return err;
+}
+EXPORT_SYMBOL(dquot_get_next_id);
+
 /*
  * Definitions of diskquota operations.
  */
@@ -2042,6 +2057,7 @@ const struct dquot_operations dquot_operations = {
 	.write_info	= dquot_commit_info,
 	.alloc_dquot	= dquot_alloc,
 	.destroy_dquot	= dquot_destroy,
+	.get_next_id	= dquot_get_next_id,
 };
 EXPORT_SYMBOL(dquot_operations);
 
@@ -2565,6 +2581,27 @@ int dquot_get_dqblk(struct super_block *sb, struct kqid qid,
 }
 EXPORT_SYMBOL(dquot_get_dqblk);
 
+int dquot_get_next_dqblk(struct super_block *sb, struct kqid *qid,
+			 struct qc_dqblk *di)
+{
+	struct dquot *dquot;
+	int err;
+
+	if (!sb->dq_op->get_next_id)
+		return -ENOSYS;
+	err = sb->dq_op->get_next_id(sb, qid);
+	if (err < 0)
+		return err;
+	dquot = dqget(sb, *qid);
+	if (IS_ERR(dquot))
+		return PTR_ERR(dquot);
+	do_get_dqblk(dquot, di);
+	dqput(dquot);
+
+	return 0;
+}
+EXPORT_SYMBOL(dquot_get_next_dqblk);
+
 #define VFS_QC_MASK \
 	(QC_SPACE | QC_SPC_SOFT | QC_SPC_HARD | \
 	 QC_INO_COUNT | QC_INO_SOFT | QC_INO_HARD | \
@@ -2765,6 +2802,7 @@ const struct quotactl_ops dquot_quotactl_ops = {
 	.get_state	= dquot_get_state,
 	.set_info	= dquot_set_dqinfo,
 	.get_dqblk	= dquot_get_dqblk,
+	.get_nextdqblk	= dquot_get_next_dqblk,
 	.set_dqblk	= dquot_set_dqblk
 };
 EXPORT_SYMBOL(dquot_quotactl_ops);
@@ -2776,6 +2814,7 @@ const struct quotactl_ops dquot_quotactl_sysfile_ops = {
 	.get_state	= dquot_get_state,
 	.set_info	= dquot_set_dqinfo,
 	.get_dqblk	= dquot_get_dqblk,
+	.get_nextdqblk	= dquot_get_next_dqblk,
 	.set_dqblk	= dquot_set_dqblk
 };
 EXPORT_SYMBOL(dquot_quotactl_sysfile_ops);
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 05db7473bcb5..b62f495add62 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -802,6 +802,7 @@ static const struct dquot_operations reiserfs_quota_operations = {
 	.write_info = reiserfs_write_info,
 	.alloc_dquot	= dquot_alloc,
 	.destroy_dquot	= dquot_destroy,
+	.get_next_id	= dquot_get_next_id,
 };
 
 static const struct quotactl_ops reiserfs_qctl_operations = {
diff --git a/include/linux/quota.h b/include/linux/quota.h
index fba92f5c1a63..9dfb6bce8c9e 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -306,6 +306,7 @@ struct quota_format_ops {
 	int (*read_dqblk)(struct dquot *dquot);		/* Read structure for one user */
 	int (*commit_dqblk)(struct dquot *dquot);	/* Write structure for one user */
 	int (*release_dqblk)(struct dquot *dquot);	/* Called when last reference to dquot is being dropped */
+	int (*get_next_id)(struct super_block *sb, struct kqid *qid);	/* Get next ID with existing structure in the quota file */
 };
 
 /* Operations working with dquots */
@@ -321,6 +322,8 @@ struct dquot_operations {
 	 * quota code only */
 	qsize_t *(*get_reserved_space) (struct inode *);
 	int (*get_projid) (struct inode *, kprojid_t *);/* Get project ID */
+	/* Get next ID with active quota structure */
+	int (*get_next_id) (struct super_block *sb, struct kqid *qid);
 };
 
 struct path;
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 7a57c28eb5e7..f00fa86ac966 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -82,6 +82,7 @@ int dquot_commit(struct dquot *dquot);
 int dquot_acquire(struct dquot *dquot);
 int dquot_release(struct dquot *dquot);
 int dquot_commit_info(struct super_block *sb, int type);
+int dquot_get_next_id(struct super_block *sb, struct kqid *qid);
 int dquot_mark_dquot_dirty(struct dquot *dquot);
 
 int dquot_file_open(struct inode *inode, struct file *file);
@@ -99,6 +100,8 @@ int dquot_get_state(struct super_block *sb, struct qc_state *state);
 int dquot_set_dqinfo(struct super_block *sb, int type, struct qc_info *ii);
 int dquot_get_dqblk(struct super_block *sb, struct kqid id,
 		struct qc_dqblk *di);
+int dquot_get_next_dqblk(struct super_block *sb, struct kqid *id,
+		struct qc_dqblk *di);
 int dquot_set_dqblk(struct super_block *sb, struct kqid id,
 		struct qc_dqblk *di);
 
-- 
2.6.2

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 2/3] quota_v2: Implement get_next_id() for V2 quota format
  2016-02-04 14:28 ` Jan Kara
  (?)
@ 2016-02-04 14:28   ` Jan Kara
  -1 siblings, 0 replies; 36+ messages in thread
From: Jan Kara @ 2016-02-04 14:28 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: ocfs2-devel, Mark Fasheh, Joel Becker, xfs, Jan Kara

Implement functions to get id of next existing quota structure in quota
file for quota tree based formats and thus for V2 quota format.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/quota/quota_tree.c       | 67 +++++++++++++++++++++++++++++++++++++++++++--
 fs/quota/quota_v2.c         |  6 ++++
 include/linux/dqblk_qtree.h |  2 ++
 3 files changed, 73 insertions(+), 2 deletions(-)

diff --git a/fs/quota/quota_tree.c b/fs/quota/quota_tree.c
index 58efb83dec1c..0738972e8d3f 100644
--- a/fs/quota/quota_tree.c
+++ b/fs/quota/quota_tree.c
@@ -22,10 +22,9 @@ MODULE_LICENSE("GPL");
 
 #define __QUOTA_QT_PARANOIA
 
-static int get_index(struct qtree_mem_dqinfo *info, struct kqid qid, int depth)
+static int __get_index(struct qtree_mem_dqinfo *info, qid_t id, int depth)
 {
 	unsigned int epb = info->dqi_usable_bs >> 2;
-	qid_t id = from_kqid(&init_user_ns, qid);
 
 	depth = info->dqi_qtree_depth - depth - 1;
 	while (depth--)
@@ -33,6 +32,13 @@ static int get_index(struct qtree_mem_dqinfo *info, struct kqid qid, int depth)
 	return id % epb;
 }
 
+static int get_index(struct qtree_mem_dqinfo *info, struct kqid qid, int depth)
+{
+	qid_t id = from_kqid(&init_user_ns, qid);
+
+	return __get_index(info, id, depth);
+}
+
 /* Number of entries in one blocks */
 static int qtree_dqstr_in_blk(struct qtree_mem_dqinfo *info)
 {
@@ -668,3 +674,60 @@ int qtree_release_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot)
 	return 0;
 }
 EXPORT_SYMBOL(qtree_release_dquot);
+
+static int find_next_id(struct qtree_mem_dqinfo *info, qid_t *id,
+			unsigned int blk, int depth)
+{
+	char *buf = getdqbuf(info->dqi_usable_bs);
+	__le32 *ref = (__le32 *)buf;
+	ssize_t ret;
+	unsigned int epb = info->dqi_usable_bs >> 2;
+	unsigned int level_inc = 1;
+	int i;
+
+	if (!buf)
+		return -ENOMEM;
+
+	for (i = depth; i < info->dqi_qtree_depth - 1; i++)
+		level_inc *= epb;
+
+	ret = read_blk(info, blk, buf);
+	if (ret < 0) {
+		quota_error(info->dqi_sb,
+			    "Can't read quota tree block %u", blk);
+		goto out_buf;
+	}
+	for (i = __get_index(info, *id, depth); i < epb; i++) {
+		if (ref[i] == cpu_to_le32(0)) {
+			*id += level_inc;
+			continue;
+		}
+		if (depth == info->dqi_qtree_depth - 1) {
+			ret = 0;
+			goto out_buf;
+		}
+		ret = find_next_id(info, id, le32_to_cpu(ref[i]), depth + 1);
+		if (ret != -ENOENT)
+			break;
+	}
+	if (i == epb) {
+		ret = -ENOENT;
+		goto out_buf;
+	}
+out_buf:
+	kfree(buf);
+	return ret;
+}
+
+int qtree_get_next_id(struct qtree_mem_dqinfo *info, struct kqid *qid)
+{
+	qid_t id = from_kqid(&init_user_ns, *qid);
+	int ret;
+
+	ret = find_next_id(info, &id, QT_TREEOFF, 0);
+	if (ret < 0)
+		return ret;
+	*qid = make_kqid(&init_user_ns, qid->type, id);
+	return 0;
+}
+EXPORT_SYMBOL(qtree_get_next_id);
diff --git a/fs/quota/quota_v2.c b/fs/quota/quota_v2.c
index ed85d4f35c04..ca71bf881ad1 100644
--- a/fs/quota/quota_v2.c
+++ b/fs/quota/quota_v2.c
@@ -304,6 +304,11 @@ static int v2_free_file_info(struct super_block *sb, int type)
 	return 0;
 }
 
+static int v2_get_next_id(struct super_block *sb, struct kqid *qid)
+{
+	return qtree_get_next_id(sb_dqinfo(sb, qid->type)->dqi_priv, qid);
+}
+
 static const struct quota_format_ops v2_format_ops = {
 	.check_quota_file	= v2_check_quota_file,
 	.read_file_info		= v2_read_file_info,
@@ -312,6 +317,7 @@ static const struct quota_format_ops v2_format_ops = {
 	.read_dqblk		= v2_read_dquot,
 	.commit_dqblk		= v2_write_dquot,
 	.release_dqblk		= v2_release_dquot,
+	.get_next_id		= v2_get_next_id,
 };
 
 static struct quota_format_type v2r0_quota_format = {
diff --git a/include/linux/dqblk_qtree.h b/include/linux/dqblk_qtree.h
index ff8b55359648..0de21e935976 100644
--- a/include/linux/dqblk_qtree.h
+++ b/include/linux/dqblk_qtree.h
@@ -15,6 +15,7 @@
 #define QTREE_DEL_REWRITE 6
 
 struct dquot;
+struct kqid;
 
 /* Operations */
 struct qtree_fmt_operations {
@@ -52,5 +53,6 @@ static inline int qtree_depth(struct qtree_mem_dqinfo *info)
 		entries *= epb;
 	return i;
 }
+int qtree_get_next_id(struct qtree_mem_dqinfo *info, struct kqid *qid);
 
 #endif /* _LINUX_DQBLK_QTREE_H */
-- 
2.6.2


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 2/3] quota_v2: Implement get_next_id() for V2 quota format
@ 2016-02-04 14:28   ` Jan Kara
  0 siblings, 0 replies; 36+ messages in thread
From: Jan Kara @ 2016-02-04 14:28 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: Mark Fasheh, Jan Kara, Joel Becker, ocfs2-devel, xfs

Implement functions to get id of next existing quota structure in quota
file for quota tree based formats and thus for V2 quota format.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/quota/quota_tree.c       | 67 +++++++++++++++++++++++++++++++++++++++++++--
 fs/quota/quota_v2.c         |  6 ++++
 include/linux/dqblk_qtree.h |  2 ++
 3 files changed, 73 insertions(+), 2 deletions(-)

diff --git a/fs/quota/quota_tree.c b/fs/quota/quota_tree.c
index 58efb83dec1c..0738972e8d3f 100644
--- a/fs/quota/quota_tree.c
+++ b/fs/quota/quota_tree.c
@@ -22,10 +22,9 @@ MODULE_LICENSE("GPL");
 
 #define __QUOTA_QT_PARANOIA
 
-static int get_index(struct qtree_mem_dqinfo *info, struct kqid qid, int depth)
+static int __get_index(struct qtree_mem_dqinfo *info, qid_t id, int depth)
 {
 	unsigned int epb = info->dqi_usable_bs >> 2;
-	qid_t id = from_kqid(&init_user_ns, qid);
 
 	depth = info->dqi_qtree_depth - depth - 1;
 	while (depth--)
@@ -33,6 +32,13 @@ static int get_index(struct qtree_mem_dqinfo *info, struct kqid qid, int depth)
 	return id % epb;
 }
 
+static int get_index(struct qtree_mem_dqinfo *info, struct kqid qid, int depth)
+{
+	qid_t id = from_kqid(&init_user_ns, qid);
+
+	return __get_index(info, id, depth);
+}
+
 /* Number of entries in one blocks */
 static int qtree_dqstr_in_blk(struct qtree_mem_dqinfo *info)
 {
@@ -668,3 +674,60 @@ int qtree_release_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot)
 	return 0;
 }
 EXPORT_SYMBOL(qtree_release_dquot);
+
+static int find_next_id(struct qtree_mem_dqinfo *info, qid_t *id,
+			unsigned int blk, int depth)
+{
+	char *buf = getdqbuf(info->dqi_usable_bs);
+	__le32 *ref = (__le32 *)buf;
+	ssize_t ret;
+	unsigned int epb = info->dqi_usable_bs >> 2;
+	unsigned int level_inc = 1;
+	int i;
+
+	if (!buf)
+		return -ENOMEM;
+
+	for (i = depth; i < info->dqi_qtree_depth - 1; i++)
+		level_inc *= epb;
+
+	ret = read_blk(info, blk, buf);
+	if (ret < 0) {
+		quota_error(info->dqi_sb,
+			    "Can't read quota tree block %u", blk);
+		goto out_buf;
+	}
+	for (i = __get_index(info, *id, depth); i < epb; i++) {
+		if (ref[i] == cpu_to_le32(0)) {
+			*id += level_inc;
+			continue;
+		}
+		if (depth == info->dqi_qtree_depth - 1) {
+			ret = 0;
+			goto out_buf;
+		}
+		ret = find_next_id(info, id, le32_to_cpu(ref[i]), depth + 1);
+		if (ret != -ENOENT)
+			break;
+	}
+	if (i == epb) {
+		ret = -ENOENT;
+		goto out_buf;
+	}
+out_buf:
+	kfree(buf);
+	return ret;
+}
+
+int qtree_get_next_id(struct qtree_mem_dqinfo *info, struct kqid *qid)
+{
+	qid_t id = from_kqid(&init_user_ns, *qid);
+	int ret;
+
+	ret = find_next_id(info, &id, QT_TREEOFF, 0);
+	if (ret < 0)
+		return ret;
+	*qid = make_kqid(&init_user_ns, qid->type, id);
+	return 0;
+}
+EXPORT_SYMBOL(qtree_get_next_id);
diff --git a/fs/quota/quota_v2.c b/fs/quota/quota_v2.c
index ed85d4f35c04..ca71bf881ad1 100644
--- a/fs/quota/quota_v2.c
+++ b/fs/quota/quota_v2.c
@@ -304,6 +304,11 @@ static int v2_free_file_info(struct super_block *sb, int type)
 	return 0;
 }
 
+static int v2_get_next_id(struct super_block *sb, struct kqid *qid)
+{
+	return qtree_get_next_id(sb_dqinfo(sb, qid->type)->dqi_priv, qid);
+}
+
 static const struct quota_format_ops v2_format_ops = {
 	.check_quota_file	= v2_check_quota_file,
 	.read_file_info		= v2_read_file_info,
@@ -312,6 +317,7 @@ static const struct quota_format_ops v2_format_ops = {
 	.read_dqblk		= v2_read_dquot,
 	.commit_dqblk		= v2_write_dquot,
 	.release_dqblk		= v2_release_dquot,
+	.get_next_id		= v2_get_next_id,
 };
 
 static struct quota_format_type v2r0_quota_format = {
diff --git a/include/linux/dqblk_qtree.h b/include/linux/dqblk_qtree.h
index ff8b55359648..0de21e935976 100644
--- a/include/linux/dqblk_qtree.h
+++ b/include/linux/dqblk_qtree.h
@@ -15,6 +15,7 @@
 #define QTREE_DEL_REWRITE 6
 
 struct dquot;
+struct kqid;
 
 /* Operations */
 struct qtree_fmt_operations {
@@ -52,5 +53,6 @@ static inline int qtree_depth(struct qtree_mem_dqinfo *info)
 		entries *= epb;
 	return i;
 }
+int qtree_get_next_id(struct qtree_mem_dqinfo *info, struct kqid *qid);
 
 #endif /* _LINUX_DQBLK_QTREE_H */
-- 
2.6.2

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [Ocfs2-devel] [PATCH 2/3] quota_v2: Implement get_next_id() for V2 quota format
@ 2016-02-04 14:28   ` Jan Kara
  0 siblings, 0 replies; 36+ messages in thread
From: Jan Kara @ 2016-02-04 14:28 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: ocfs2-devel, Mark Fasheh, Joel Becker, xfs, Jan Kara

Implement functions to get id of next existing quota structure in quota
file for quota tree based formats and thus for V2 quota format.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/quota/quota_tree.c       | 67 +++++++++++++++++++++++++++++++++++++++++++--
 fs/quota/quota_v2.c         |  6 ++++
 include/linux/dqblk_qtree.h |  2 ++
 3 files changed, 73 insertions(+), 2 deletions(-)

diff --git a/fs/quota/quota_tree.c b/fs/quota/quota_tree.c
index 58efb83dec1c..0738972e8d3f 100644
--- a/fs/quota/quota_tree.c
+++ b/fs/quota/quota_tree.c
@@ -22,10 +22,9 @@ MODULE_LICENSE("GPL");
 
 #define __QUOTA_QT_PARANOIA
 
-static int get_index(struct qtree_mem_dqinfo *info, struct kqid qid, int depth)
+static int __get_index(struct qtree_mem_dqinfo *info, qid_t id, int depth)
 {
 	unsigned int epb = info->dqi_usable_bs >> 2;
-	qid_t id = from_kqid(&init_user_ns, qid);
 
 	depth = info->dqi_qtree_depth - depth - 1;
 	while (depth--)
@@ -33,6 +32,13 @@ static int get_index(struct qtree_mem_dqinfo *info, struct kqid qid, int depth)
 	return id % epb;
 }
 
+static int get_index(struct qtree_mem_dqinfo *info, struct kqid qid, int depth)
+{
+	qid_t id = from_kqid(&init_user_ns, qid);
+
+	return __get_index(info, id, depth);
+}
+
 /* Number of entries in one blocks */
 static int qtree_dqstr_in_blk(struct qtree_mem_dqinfo *info)
 {
@@ -668,3 +674,60 @@ int qtree_release_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot)
 	return 0;
 }
 EXPORT_SYMBOL(qtree_release_dquot);
+
+static int find_next_id(struct qtree_mem_dqinfo *info, qid_t *id,
+			unsigned int blk, int depth)
+{
+	char *buf = getdqbuf(info->dqi_usable_bs);
+	__le32 *ref = (__le32 *)buf;
+	ssize_t ret;
+	unsigned int epb = info->dqi_usable_bs >> 2;
+	unsigned int level_inc = 1;
+	int i;
+
+	if (!buf)
+		return -ENOMEM;
+
+	for (i = depth; i < info->dqi_qtree_depth - 1; i++)
+		level_inc *= epb;
+
+	ret = read_blk(info, blk, buf);
+	if (ret < 0) {
+		quota_error(info->dqi_sb,
+			    "Can't read quota tree block %u", blk);
+		goto out_buf;
+	}
+	for (i = __get_index(info, *id, depth); i < epb; i++) {
+		if (ref[i] == cpu_to_le32(0)) {
+			*id += level_inc;
+			continue;
+		}
+		if (depth == info->dqi_qtree_depth - 1) {
+			ret = 0;
+			goto out_buf;
+		}
+		ret = find_next_id(info, id, le32_to_cpu(ref[i]), depth + 1);
+		if (ret != -ENOENT)
+			break;
+	}
+	if (i == epb) {
+		ret = -ENOENT;
+		goto out_buf;
+	}
+out_buf:
+	kfree(buf);
+	return ret;
+}
+
+int qtree_get_next_id(struct qtree_mem_dqinfo *info, struct kqid *qid)
+{
+	qid_t id = from_kqid(&init_user_ns, *qid);
+	int ret;
+
+	ret = find_next_id(info, &id, QT_TREEOFF, 0);
+	if (ret < 0)
+		return ret;
+	*qid = make_kqid(&init_user_ns, qid->type, id);
+	return 0;
+}
+EXPORT_SYMBOL(qtree_get_next_id);
diff --git a/fs/quota/quota_v2.c b/fs/quota/quota_v2.c
index ed85d4f35c04..ca71bf881ad1 100644
--- a/fs/quota/quota_v2.c
+++ b/fs/quota/quota_v2.c
@@ -304,6 +304,11 @@ static int v2_free_file_info(struct super_block *sb, int type)
 	return 0;
 }
 
+static int v2_get_next_id(struct super_block *sb, struct kqid *qid)
+{
+	return qtree_get_next_id(sb_dqinfo(sb, qid->type)->dqi_priv, qid);
+}
+
 static const struct quota_format_ops v2_format_ops = {
 	.check_quota_file	= v2_check_quota_file,
 	.read_file_info		= v2_read_file_info,
@@ -312,6 +317,7 @@ static const struct quota_format_ops v2_format_ops = {
 	.read_dqblk		= v2_read_dquot,
 	.commit_dqblk		= v2_write_dquot,
 	.release_dqblk		= v2_release_dquot,
+	.get_next_id		= v2_get_next_id,
 };
 
 static struct quota_format_type v2r0_quota_format = {
diff --git a/include/linux/dqblk_qtree.h b/include/linux/dqblk_qtree.h
index ff8b55359648..0de21e935976 100644
--- a/include/linux/dqblk_qtree.h
+++ b/include/linux/dqblk_qtree.h
@@ -15,6 +15,7 @@
 #define QTREE_DEL_REWRITE 6
 
 struct dquot;
+struct kqid;
 
 /* Operations */
 struct qtree_fmt_operations {
@@ -52,5 +53,6 @@ static inline int qtree_depth(struct qtree_mem_dqinfo *info)
 		entries *= epb;
 	return i;
 }
+int qtree_get_next_id(struct qtree_mem_dqinfo *info, struct kqid *qid);
 
 #endif /* _LINUX_DQBLK_QTREE_H */
-- 
2.6.2

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 3/3] ocfs2: Implement get_next_id()
  2016-02-04 14:28 ` Jan Kara
  (?)
@ 2016-02-04 14:28   ` Jan Kara
  -1 siblings, 0 replies; 36+ messages in thread
From: Jan Kara @ 2016-02-04 14:28 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: ocfs2-devel, Mark Fasheh, Joel Becker, xfs, Jan Kara

Implement get_next_id() callback to enable use of Q_GETNEXTQUOTA
quotactl for OCFS2.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/ocfs2/ocfs2_trace.h  |  2 ++
 fs/ocfs2/quota_global.c | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/fs/ocfs2/ocfs2_trace.h b/fs/ocfs2/ocfs2_trace.h
index 6cb019b7c6a8..a52a2dbc064e 100644
--- a/fs/ocfs2/ocfs2_trace.h
+++ b/fs/ocfs2/ocfs2_trace.h
@@ -2035,6 +2035,8 @@ DEFINE_OCFS2_UINT_INT_EVENT(ocfs2_release_dquot);
 
 DEFINE_OCFS2_UINT_INT_EVENT(ocfs2_acquire_dquot);
 
+DEFINE_OCFS2_UINT_INT_EVENT(ocfs2_get_next_id);
+
 DEFINE_OCFS2_UINT_INT_EVENT(ocfs2_mark_dquot_dirty);
 
 /* End of trace events for fs/ocfs2/quota_global.c. */
diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c
index fde9ef18cff3..8c903ce08e95 100644
--- a/fs/ocfs2/quota_global.c
+++ b/fs/ocfs2/quota_global.c
@@ -860,6 +860,30 @@ out:
 	return status;
 }
 
+static int ocfs2_get_next_id(struct super_block *sb, struct kqid *qid)
+{
+	int type = qid->type;
+	struct ocfs2_mem_dqinfo *info = sb_dqinfo(sb, type)->dqi_priv;
+	int status = 0;
+
+	trace_ocfs2_get_next_id(from_kqid(&init_user_ns, *qid), type);
+	status = ocfs2_lock_global_qf(info, 0);
+	if (status < 0)
+		goto out;
+	status = ocfs2_qinfo_lock(info, 0);
+	if (status < 0)
+		goto out_global;
+	status = qtree_get_next_id(&info->dqi_gi, qid);
+	ocfs2_qinfo_unlock(info, 0);
+out_global:
+	ocfs2_unlock_global_qf(info, 0);
+out:
+	/* Avoid logging ENOENT since it just means there isn't next ID */
+	if (status && status != -ENOENT)
+		mlog_errno(status);
+	return status;
+}
+
 static int ocfs2_mark_dquot_dirty(struct dquot *dquot)
 {
 	unsigned long mask = (1 << (DQ_LASTSET_B + QIF_ILIMITS_B)) |
@@ -968,4 +992,5 @@ const struct dquot_operations ocfs2_quota_operations = {
 	.write_info	= ocfs2_write_info,
 	.alloc_dquot	= ocfs2_alloc_dquot,
 	.destroy_dquot	= ocfs2_destroy_dquot,
+	.get_next_id	= ocfs2_get_next_id,
 };
-- 
2.6.2


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 3/3] ocfs2: Implement get_next_id()
@ 2016-02-04 14:28   ` Jan Kara
  0 siblings, 0 replies; 36+ messages in thread
From: Jan Kara @ 2016-02-04 14:28 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: Mark Fasheh, Jan Kara, Joel Becker, ocfs2-devel, xfs

Implement get_next_id() callback to enable use of Q_GETNEXTQUOTA
quotactl for OCFS2.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/ocfs2/ocfs2_trace.h  |  2 ++
 fs/ocfs2/quota_global.c | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/fs/ocfs2/ocfs2_trace.h b/fs/ocfs2/ocfs2_trace.h
index 6cb019b7c6a8..a52a2dbc064e 100644
--- a/fs/ocfs2/ocfs2_trace.h
+++ b/fs/ocfs2/ocfs2_trace.h
@@ -2035,6 +2035,8 @@ DEFINE_OCFS2_UINT_INT_EVENT(ocfs2_release_dquot);
 
 DEFINE_OCFS2_UINT_INT_EVENT(ocfs2_acquire_dquot);
 
+DEFINE_OCFS2_UINT_INT_EVENT(ocfs2_get_next_id);
+
 DEFINE_OCFS2_UINT_INT_EVENT(ocfs2_mark_dquot_dirty);
 
 /* End of trace events for fs/ocfs2/quota_global.c. */
diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c
index fde9ef18cff3..8c903ce08e95 100644
--- a/fs/ocfs2/quota_global.c
+++ b/fs/ocfs2/quota_global.c
@@ -860,6 +860,30 @@ out:
 	return status;
 }
 
+static int ocfs2_get_next_id(struct super_block *sb, struct kqid *qid)
+{
+	int type = qid->type;
+	struct ocfs2_mem_dqinfo *info = sb_dqinfo(sb, type)->dqi_priv;
+	int status = 0;
+
+	trace_ocfs2_get_next_id(from_kqid(&init_user_ns, *qid), type);
+	status = ocfs2_lock_global_qf(info, 0);
+	if (status < 0)
+		goto out;
+	status = ocfs2_qinfo_lock(info, 0);
+	if (status < 0)
+		goto out_global;
+	status = qtree_get_next_id(&info->dqi_gi, qid);
+	ocfs2_qinfo_unlock(info, 0);
+out_global:
+	ocfs2_unlock_global_qf(info, 0);
+out:
+	/* Avoid logging ENOENT since it just means there isn't next ID */
+	if (status && status != -ENOENT)
+		mlog_errno(status);
+	return status;
+}
+
 static int ocfs2_mark_dquot_dirty(struct dquot *dquot)
 {
 	unsigned long mask = (1 << (DQ_LASTSET_B + QIF_ILIMITS_B)) |
@@ -968,4 +992,5 @@ const struct dquot_operations ocfs2_quota_operations = {
 	.write_info	= ocfs2_write_info,
 	.alloc_dquot	= ocfs2_alloc_dquot,
 	.destroy_dquot	= ocfs2_destroy_dquot,
+	.get_next_id	= ocfs2_get_next_id,
 };
-- 
2.6.2

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [Ocfs2-devel] [PATCH 3/3] ocfs2: Implement get_next_id()
@ 2016-02-04 14:28   ` Jan Kara
  0 siblings, 0 replies; 36+ messages in thread
From: Jan Kara @ 2016-02-04 14:28 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: ocfs2-devel, Mark Fasheh, Joel Becker, xfs, Jan Kara

Implement get_next_id() callback to enable use of Q_GETNEXTQUOTA
quotactl for OCFS2.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/ocfs2/ocfs2_trace.h  |  2 ++
 fs/ocfs2/quota_global.c | 25 +++++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/fs/ocfs2/ocfs2_trace.h b/fs/ocfs2/ocfs2_trace.h
index 6cb019b7c6a8..a52a2dbc064e 100644
--- a/fs/ocfs2/ocfs2_trace.h
+++ b/fs/ocfs2/ocfs2_trace.h
@@ -2035,6 +2035,8 @@ DEFINE_OCFS2_UINT_INT_EVENT(ocfs2_release_dquot);
 
 DEFINE_OCFS2_UINT_INT_EVENT(ocfs2_acquire_dquot);
 
+DEFINE_OCFS2_UINT_INT_EVENT(ocfs2_get_next_id);
+
 DEFINE_OCFS2_UINT_INT_EVENT(ocfs2_mark_dquot_dirty);
 
 /* End of trace events for fs/ocfs2/quota_global.c. */
diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c
index fde9ef18cff3..8c903ce08e95 100644
--- a/fs/ocfs2/quota_global.c
+++ b/fs/ocfs2/quota_global.c
@@ -860,6 +860,30 @@ out:
 	return status;
 }
 
+static int ocfs2_get_next_id(struct super_block *sb, struct kqid *qid)
+{
+	int type = qid->type;
+	struct ocfs2_mem_dqinfo *info = sb_dqinfo(sb, type)->dqi_priv;
+	int status = 0;
+
+	trace_ocfs2_get_next_id(from_kqid(&init_user_ns, *qid), type);
+	status = ocfs2_lock_global_qf(info, 0);
+	if (status < 0)
+		goto out;
+	status = ocfs2_qinfo_lock(info, 0);
+	if (status < 0)
+		goto out_global;
+	status = qtree_get_next_id(&info->dqi_gi, qid);
+	ocfs2_qinfo_unlock(info, 0);
+out_global:
+	ocfs2_unlock_global_qf(info, 0);
+out:
+	/* Avoid logging ENOENT since it just means there isn't next ID */
+	if (status && status != -ENOENT)
+		mlog_errno(status);
+	return status;
+}
+
 static int ocfs2_mark_dquot_dirty(struct dquot *dquot)
 {
 	unsigned long mask = (1 << (DQ_LASTSET_B + QIF_ILIMITS_B)) |
@@ -968,4 +992,5 @@ const struct dquot_operations ocfs2_quota_operations = {
 	.write_info	= ocfs2_write_info,
 	.alloc_dquot	= ocfs2_alloc_dquot,
 	.destroy_dquot	= ocfs2_destroy_dquot,
+	.get_next_id	= ocfs2_get_next_id,
 };
-- 
2.6.2

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota
  2016-02-04 14:28   ` Jan Kara
  (?)
@ 2016-02-05  1:05     ` Dave Chinner
  -1 siblings, 0 replies; 36+ messages in thread
From: Dave Chinner @ 2016-02-05  1:05 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-fsdevel, ocfs2-devel, Mark Fasheh, Joel Becker, xfs

On Thu, Feb 04, 2016 at 03:28:05PM +0100, Jan Kara wrote:
> Add infrastructure for supporting get_nextdqblk() callback for VFS
> quotas. Translate the operation into a callback to appropriate
> filesystem and consequently to quota format callback.
> 
> Signed-off-by: Jan Kara <jack@suse.cz>

I'm a little confused here. What patchset is this dependent on? i.e.
what introduces the ->get_nextdqblk method?

The patches I currently have in my XFS working tree introduce this
(quota: add new quotactl Q_XGETNEXTQUOTA) and everythign else is
dependent on this. I looked a coupl eof days ago and I wasnt' able
to find this in your tree.

I'd much prefer that one of us publish a stable branch with just the
quotactl() infrastructure (i.e. commands and bits up to the
->get_nextdqblk() callback) that we can then both base the different
subsystem implementations off, rather than one of us having to pull
in a whole tree of changes just to get the one commit we need...

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota
@ 2016-02-05  1:05     ` Dave Chinner
  0 siblings, 0 replies; 36+ messages in thread
From: Dave Chinner @ 2016-02-05  1:05 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-fsdevel, Mark Fasheh, Joel Becker, ocfs2-devel, xfs

On Thu, Feb 04, 2016 at 03:28:05PM +0100, Jan Kara wrote:
> Add infrastructure for supporting get_nextdqblk() callback for VFS
> quotas. Translate the operation into a callback to appropriate
> filesystem and consequently to quota format callback.
> 
> Signed-off-by: Jan Kara <jack@suse.cz>

I'm a little confused here. What patchset is this dependent on? i.e.
what introduces the ->get_nextdqblk method?

The patches I currently have in my XFS working tree introduce this
(quota: add new quotactl Q_XGETNEXTQUOTA) and everythign else is
dependent on this. I looked a coupl eof days ago and I wasnt' able
to find this in your tree.

I'd much prefer that one of us publish a stable branch with just the
quotactl() infrastructure (i.e. commands and bits up to the
->get_nextdqblk() callback) that we can then both base the different
subsystem implementations off, rather than one of us having to pull
in a whole tree of changes just to get the one commit we need...

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Ocfs2-devel] [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota
@ 2016-02-05  1:05     ` Dave Chinner
  0 siblings, 0 replies; 36+ messages in thread
From: Dave Chinner @ 2016-02-05  1:05 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-fsdevel, ocfs2-devel, Mark Fasheh, Joel Becker, xfs

On Thu, Feb 04, 2016 at 03:28:05PM +0100, Jan Kara wrote:
> Add infrastructure for supporting get_nextdqblk() callback for VFS
> quotas. Translate the operation into a callback to appropriate
> filesystem and consequently to quota format callback.
> 
> Signed-off-by: Jan Kara <jack@suse.cz>

I'm a little confused here. What patchset is this dependent on? i.e.
what introduces the ->get_nextdqblk method?

The patches I currently have in my XFS working tree introduce this
(quota: add new quotactl Q_XGETNEXTQUOTA) and everythign else is
dependent on this. I looked a coupl eof days ago and I wasnt' able
to find this in your tree.

I'd much prefer that one of us publish a stable branch with just the
quotactl() infrastructure (i.e. commands and bits up to the
->get_nextdqblk() callback) that we can then both base the different
subsystem implementations off, rather than one of us having to pull
in a whole tree of changes just to get the one commit we need...

Cheers,

Dave.
-- 
Dave Chinner
david at fromorbit.com

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota
  2016-02-05  1:05     ` Dave Chinner
  (?)
@ 2016-02-08  6:15       ` Dave Chinner
  -1 siblings, 0 replies; 36+ messages in thread
From: Dave Chinner @ 2016-02-08  6:15 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-fsdevel, ocfs2-devel, Mark Fasheh, Joel Becker, xfs

On Fri, Feb 05, 2016 at 12:05:19PM +1100, Dave Chinner wrote:
> On Thu, Feb 04, 2016 at 03:28:05PM +0100, Jan Kara wrote:
> > Add infrastructure for supporting get_nextdqblk() callback for VFS
> > quotas. Translate the operation into a callback to appropriate
> > filesystem and consequently to quota format callback.
> > 
> > Signed-off-by: Jan Kara <jack@suse.cz>
> 
> I'm a little confused here. What patchset is this dependent on? i.e.
> what introduces the ->get_nextdqblk method?
> 
> The patches I currently have in my XFS working tree introduce this
> (quota: add new quotactl Q_XGETNEXTQUOTA) and everythign else is
> dependent on this. I looked a coupl eof days ago and I wasnt' able
> to find this in your tree.
> 
> I'd much prefer that one of us publish a stable branch with just the
> quotactl() infrastructure (i.e. commands and bits up to the
> ->get_nextdqblk() callback) that we can then both base the different
> subsystem implementations off, rather than one of us having to pull
> in a whole tree of changes just to get the one commit we need...

Jan, I've posted a stable branch with the quotactl() changes and
the XFS implementation here:

git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs.git xfs-get-next-dquot-4.6

It's currently in the xfs for-next branch for wider testing - I've
done this because I want to get all the pending XFS code out into
for-next land early in this cycle so I can move on and concentrate
on rmap/reflink for the rest of the cycle.

If you want to do this through your tree instead of the XFS tree
then let me know when you publish a branch with quotactl changes in
it so I can rebuild the XFS for-next branch to use that.
Alternatively, i can pull the rest of the generic changes in this
patch set into the branch I already have, so it's all in one place
for ease of testing....

Cheeers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota
@ 2016-02-08  6:15       ` Dave Chinner
  0 siblings, 0 replies; 36+ messages in thread
From: Dave Chinner @ 2016-02-08  6:15 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-fsdevel, Mark Fasheh, Joel Becker, ocfs2-devel, xfs

On Fri, Feb 05, 2016 at 12:05:19PM +1100, Dave Chinner wrote:
> On Thu, Feb 04, 2016 at 03:28:05PM +0100, Jan Kara wrote:
> > Add infrastructure for supporting get_nextdqblk() callback for VFS
> > quotas. Translate the operation into a callback to appropriate
> > filesystem and consequently to quota format callback.
> > 
> > Signed-off-by: Jan Kara <jack@suse.cz>
> 
> I'm a little confused here. What patchset is this dependent on? i.e.
> what introduces the ->get_nextdqblk method?
> 
> The patches I currently have in my XFS working tree introduce this
> (quota: add new quotactl Q_XGETNEXTQUOTA) and everythign else is
> dependent on this. I looked a coupl eof days ago and I wasnt' able
> to find this in your tree.
> 
> I'd much prefer that one of us publish a stable branch with just the
> quotactl() infrastructure (i.e. commands and bits up to the
> ->get_nextdqblk() callback) that we can then both base the different
> subsystem implementations off, rather than one of us having to pull
> in a whole tree of changes just to get the one commit we need...

Jan, I've posted a stable branch with the quotactl() changes and
the XFS implementation here:

git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs.git xfs-get-next-dquot-4.6

It's currently in the xfs for-next branch for wider testing - I've
done this because I want to get all the pending XFS code out into
for-next land early in this cycle so I can move on and concentrate
on rmap/reflink for the rest of the cycle.

If you want to do this through your tree instead of the XFS tree
then let me know when you publish a branch with quotactl changes in
it so I can rebuild the XFS for-next branch to use that.
Alternatively, i can pull the rest of the generic changes in this
patch set into the branch I already have, so it's all in one place
for ease of testing....

Cheeers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Ocfs2-devel] [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota
@ 2016-02-08  6:15       ` Dave Chinner
  0 siblings, 0 replies; 36+ messages in thread
From: Dave Chinner @ 2016-02-08  6:15 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-fsdevel, ocfs2-devel, Mark Fasheh, Joel Becker, xfs

On Fri, Feb 05, 2016 at 12:05:19PM +1100, Dave Chinner wrote:
> On Thu, Feb 04, 2016 at 03:28:05PM +0100, Jan Kara wrote:
> > Add infrastructure for supporting get_nextdqblk() callback for VFS
> > quotas. Translate the operation into a callback to appropriate
> > filesystem and consequently to quota format callback.
> > 
> > Signed-off-by: Jan Kara <jack@suse.cz>
> 
> I'm a little confused here. What patchset is this dependent on? i.e.
> what introduces the ->get_nextdqblk method?
> 
> The patches I currently have in my XFS working tree introduce this
> (quota: add new quotactl Q_XGETNEXTQUOTA) and everythign else is
> dependent on this. I looked a coupl eof days ago and I wasnt' able
> to find this in your tree.
> 
> I'd much prefer that one of us publish a stable branch with just the
> quotactl() infrastructure (i.e. commands and bits up to the
> ->get_nextdqblk() callback) that we can then both base the different
> subsystem implementations off, rather than one of us having to pull
> in a whole tree of changes just to get the one commit we need...

Jan, I've posted a stable branch with the quotactl() changes and
the XFS implementation here:

git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs.git xfs-get-next-dquot-4.6

It's currently in the xfs for-next branch for wider testing - I've
done this because I want to get all the pending XFS code out into
for-next land early in this cycle so I can move on and concentrate
on rmap/reflink for the rest of the cycle.

If you want to do this through your tree instead of the XFS tree
then let me know when you publish a branch with quotactl changes in
it so I can rebuild the XFS for-next branch to use that.
Alternatively, i can pull the rest of the generic changes in this
patch set into the branch I already have, so it's all in one place
for ease of testing....

Cheeers,

Dave.
-- 
Dave Chinner
david at fromorbit.com

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota
  2016-02-05  1:05     ` Dave Chinner
  (?)
@ 2016-02-08 14:27       ` Jan Kara
  -1 siblings, 0 replies; 36+ messages in thread
From: Jan Kara @ 2016-02-08 14:27 UTC (permalink / raw)
  To: Dave Chinner
  Cc: Jan Kara, linux-fsdevel, ocfs2-devel, Mark Fasheh, Joel Becker, xfs

On Fri 05-02-16 12:05:19, Dave Chinner wrote:
> On Thu, Feb 04, 2016 at 03:28:05PM +0100, Jan Kara wrote:
> > Add infrastructure for supporting get_nextdqblk() callback for VFS
> > quotas. Translate the operation into a callback to appropriate
> > filesystem and consequently to quota format callback.
> > 
> > Signed-off-by: Jan Kara <jack@suse.cz>
> 
> I'm a little confused here. What patchset is this dependent on? i.e.
> what introduces the ->get_nextdqblk method?

It depends on the patches Eric sent which introduce ->get_nextdqblk.

> The patches I currently have in my XFS working tree introduce this
> (quota: add new quotactl Q_XGETNEXTQUOTA) and everythign else is
> dependent on this. I looked a coupl eof days ago and I wasnt' able
> to find this in your tree.

Yeah, I have this patch as well, I just didn't push out.

> I'd much prefer that one of us publish a stable branch with just the
> quotactl() infrastructure (i.e. commands and bits up to the
> ->get_nextdqblk() callback) that we can then both base the different
> subsystem implementations off, rather than one of us having to pull
> in a whole tree of changes just to get the one commit we need...

Sure, I have pushed out:

'getnextquota' branch into my tree

git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs.git 

which contains the patches from Eric I carry (including fixups in comments
other minor stuff I have found during final review). Can you please base
XFS patches on top of this branch? Thanks!

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota
@ 2016-02-08 14:27       ` Jan Kara
  0 siblings, 0 replies; 36+ messages in thread
From: Jan Kara @ 2016-02-08 14:27 UTC (permalink / raw)
  To: Dave Chinner
  Cc: Jan Kara, Mark Fasheh, xfs, Joel Becker, linux-fsdevel, ocfs2-devel

On Fri 05-02-16 12:05:19, Dave Chinner wrote:
> On Thu, Feb 04, 2016 at 03:28:05PM +0100, Jan Kara wrote:
> > Add infrastructure for supporting get_nextdqblk() callback for VFS
> > quotas. Translate the operation into a callback to appropriate
> > filesystem and consequently to quota format callback.
> > 
> > Signed-off-by: Jan Kara <jack@suse.cz>
> 
> I'm a little confused here. What patchset is this dependent on? i.e.
> what introduces the ->get_nextdqblk method?

It depends on the patches Eric sent which introduce ->get_nextdqblk.

> The patches I currently have in my XFS working tree introduce this
> (quota: add new quotactl Q_XGETNEXTQUOTA) and everythign else is
> dependent on this. I looked a coupl eof days ago and I wasnt' able
> to find this in your tree.

Yeah, I have this patch as well, I just didn't push out.

> I'd much prefer that one of us publish a stable branch with just the
> quotactl() infrastructure (i.e. commands and bits up to the
> ->get_nextdqblk() callback) that we can then both base the different
> subsystem implementations off, rather than one of us having to pull
> in a whole tree of changes just to get the one commit we need...

Sure, I have pushed out:

'getnextquota' branch into my tree

git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs.git 

which contains the patches from Eric I carry (including fixups in comments
other minor stuff I have found during final review). Can you please base
XFS patches on top of this branch? Thanks!

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Ocfs2-devel] [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota
@ 2016-02-08 14:27       ` Jan Kara
  0 siblings, 0 replies; 36+ messages in thread
From: Jan Kara @ 2016-02-08 14:27 UTC (permalink / raw)
  To: Dave Chinner
  Cc: Jan Kara, linux-fsdevel, ocfs2-devel, Mark Fasheh, Joel Becker, xfs

On Fri 05-02-16 12:05:19, Dave Chinner wrote:
> On Thu, Feb 04, 2016 at 03:28:05PM +0100, Jan Kara wrote:
> > Add infrastructure for supporting get_nextdqblk() callback for VFS
> > quotas. Translate the operation into a callback to appropriate
> > filesystem and consequently to quota format callback.
> > 
> > Signed-off-by: Jan Kara <jack@suse.cz>
> 
> I'm a little confused here. What patchset is this dependent on? i.e.
> what introduces the ->get_nextdqblk method?

It depends on the patches Eric sent which introduce ->get_nextdqblk.

> The patches I currently have in my XFS working tree introduce this
> (quota: add new quotactl Q_XGETNEXTQUOTA) and everythign else is
> dependent on this. I looked a coupl eof days ago and I wasnt' able
> to find this in your tree.

Yeah, I have this patch as well, I just didn't push out.

> I'd much prefer that one of us publish a stable branch with just the
> quotactl() infrastructure (i.e. commands and bits up to the
> ->get_nextdqblk() callback) that we can then both base the different
> subsystem implementations off, rather than one of us having to pull
> in a whole tree of changes just to get the one commit we need...

Sure, I have pushed out:

'getnextquota' branch into my tree

git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs.git 

which contains the patches from Eric I carry (including fixups in comments
other minor stuff I have found during final review). Can you please base
XFS patches on top of this branch? Thanks!

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota
  2016-02-08 14:27       ` Jan Kara
  (?)
@ 2016-02-08 14:34         ` Jan Kara
  -1 siblings, 0 replies; 36+ messages in thread
From: Jan Kara @ 2016-02-08 14:34 UTC (permalink / raw)
  To: Dave Chinner
  Cc: Jan Kara, linux-fsdevel, ocfs2-devel, Mark Fasheh, Joel Becker, xfs

On Mon 08-02-16 15:27:49, Jan Kara wrote:
> On Fri 05-02-16 12:05:19, Dave Chinner wrote:
> > On Thu, Feb 04, 2016 at 03:28:05PM +0100, Jan Kara wrote:
> > > Add infrastructure for supporting get_nextdqblk() callback for VFS
> > > quotas. Translate the operation into a callback to appropriate
> > > filesystem and consequently to quota format callback.
> > > 
> > > Signed-off-by: Jan Kara <jack@suse.cz>
> > 
> > I'm a little confused here. What patchset is this dependent on? i.e.
> > what introduces the ->get_nextdqblk method?
> 
> It depends on the patches Eric sent which introduce ->get_nextdqblk.
> 
> > The patches I currently have in my XFS working tree introduce this
> > (quota: add new quotactl Q_XGETNEXTQUOTA) and everythign else is
> > dependent on this. I looked a coupl eof days ago and I wasnt' able
> > to find this in your tree.
> 
> Yeah, I have this patch as well, I just didn't push out.
> 
> > I'd much prefer that one of us publish a stable branch with just the
> > quotactl() infrastructure (i.e. commands and bits up to the
> > ->get_nextdqblk() callback) that we can then both base the different
> > subsystem implementations off, rather than one of us having to pull
> > in a whole tree of changes just to get the one commit we need...
> 
> Sure, I have pushed out:
> 
> 'getnextquota' branch into my tree
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs.git 
> 
> which contains the patches from Eric I carry (including fixups in comments
> other minor stuff I have found during final review). Can you please base
> XFS patches on top of this branch? Thanks!

Ah, now I saw your next email and you already created the stable branch.
OK, since I didn't push out anything yet, I will base my branches on top of
yours. I have made some small fixups in the comments but I can push these
as a separate patch.

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota
@ 2016-02-08 14:34         ` Jan Kara
  0 siblings, 0 replies; 36+ messages in thread
From: Jan Kara @ 2016-02-08 14:34 UTC (permalink / raw)
  To: Dave Chinner
  Cc: Jan Kara, Mark Fasheh, xfs, Joel Becker, linux-fsdevel, ocfs2-devel

On Mon 08-02-16 15:27:49, Jan Kara wrote:
> On Fri 05-02-16 12:05:19, Dave Chinner wrote:
> > On Thu, Feb 04, 2016 at 03:28:05PM +0100, Jan Kara wrote:
> > > Add infrastructure for supporting get_nextdqblk() callback for VFS
> > > quotas. Translate the operation into a callback to appropriate
> > > filesystem and consequently to quota format callback.
> > > 
> > > Signed-off-by: Jan Kara <jack@suse.cz>
> > 
> > I'm a little confused here. What patchset is this dependent on? i.e.
> > what introduces the ->get_nextdqblk method?
> 
> It depends on the patches Eric sent which introduce ->get_nextdqblk.
> 
> > The patches I currently have in my XFS working tree introduce this
> > (quota: add new quotactl Q_XGETNEXTQUOTA) and everythign else is
> > dependent on this. I looked a coupl eof days ago and I wasnt' able
> > to find this in your tree.
> 
> Yeah, I have this patch as well, I just didn't push out.
> 
> > I'd much prefer that one of us publish a stable branch with just the
> > quotactl() infrastructure (i.e. commands and bits up to the
> > ->get_nextdqblk() callback) that we can then both base the different
> > subsystem implementations off, rather than one of us having to pull
> > in a whole tree of changes just to get the one commit we need...
> 
> Sure, I have pushed out:
> 
> 'getnextquota' branch into my tree
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs.git 
> 
> which contains the patches from Eric I carry (including fixups in comments
> other minor stuff I have found during final review). Can you please base
> XFS patches on top of this branch? Thanks!

Ah, now I saw your next email and you already created the stable branch.
OK, since I didn't push out anything yet, I will base my branches on top of
yours. I have made some small fixups in the comments but I can push these
as a separate patch.

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Ocfs2-devel] [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota
@ 2016-02-08 14:34         ` Jan Kara
  0 siblings, 0 replies; 36+ messages in thread
From: Jan Kara @ 2016-02-08 14:34 UTC (permalink / raw)
  To: Dave Chinner
  Cc: Jan Kara, linux-fsdevel, ocfs2-devel, Mark Fasheh, Joel Becker, xfs

On Mon 08-02-16 15:27:49, Jan Kara wrote:
> On Fri 05-02-16 12:05:19, Dave Chinner wrote:
> > On Thu, Feb 04, 2016 at 03:28:05PM +0100, Jan Kara wrote:
> > > Add infrastructure for supporting get_nextdqblk() callback for VFS
> > > quotas. Translate the operation into a callback to appropriate
> > > filesystem and consequently to quota format callback.
> > > 
> > > Signed-off-by: Jan Kara <jack@suse.cz>
> > 
> > I'm a little confused here. What patchset is this dependent on? i.e.
> > what introduces the ->get_nextdqblk method?
> 
> It depends on the patches Eric sent which introduce ->get_nextdqblk.
> 
> > The patches I currently have in my XFS working tree introduce this
> > (quota: add new quotactl Q_XGETNEXTQUOTA) and everythign else is
> > dependent on this. I looked a coupl eof days ago and I wasnt' able
> > to find this in your tree.
> 
> Yeah, I have this patch as well, I just didn't push out.
> 
> > I'd much prefer that one of us publish a stable branch with just the
> > quotactl() infrastructure (i.e. commands and bits up to the
> > ->get_nextdqblk() callback) that we can then both base the different
> > subsystem implementations off, rather than one of us having to pull
> > in a whole tree of changes just to get the one commit we need...
> 
> Sure, I have pushed out:
> 
> 'getnextquota' branch into my tree
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs.git 
> 
> which contains the patches from Eric I carry (including fixups in comments
> other minor stuff I have found during final review). Can you please base
> XFS patches on top of this branch? Thanks!

Ah, now I saw your next email and you already created the stable branch.
OK, since I didn't push out anything yet, I will base my branches on top of
yours. I have made some small fixups in the comments but I can push these
as a separate patch.

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota
  2016-02-04 14:28   ` Jan Kara
  (?)
@ 2016-02-19 17:31     ` Eric Sandeen
  -1 siblings, 0 replies; 36+ messages in thread
From: Eric Sandeen @ 2016-02-19 17:31 UTC (permalink / raw)
  To: Jan Kara, linux-fsdevel; +Cc: ocfs2-devel, Mark Fasheh, Joel Becker, xfs



On 2/4/16 8:28 AM, Jan Kara wrote:
> Add infrastructure for supporting get_nextdqblk() callback for VFS
> quotas. Translate the operation into a callback to appropriate
> filesystem and consequently to quota format callback.
> 
> Signed-off-by: Jan Kara <jack@suse.cz>
> ---
>  fs/ext4/super.c          |  1 +
>  fs/quota/dquot.c         | 39 +++++++++++++++++++++++++++++++++++++++
>  fs/reiserfs/super.c      |  1 +
>  include/linux/quota.h    |  3 +++
>  include/linux/quotaops.h |  3 +++
>  5 files changed, 47 insertions(+)
> 
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index f1b56ff01208..51649f442bf6 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -1100,6 +1100,7 @@ static const struct dquot_operations ext4_quota_operations = {
>  	.write_info	= ext4_write_info,
>  	.alloc_dquot	= dquot_alloc,
>  	.destroy_dquot	= dquot_destroy,
> +	.get_next_id	= dquot_get_next_id,
>  };

Hi Jan, doesn't this also need to set:


+       .get_nextdqblk  = dquot_get_next_dqblk,

in ext4_qctl_sysfile_operations?

Thanks,
-Eric

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota
@ 2016-02-19 17:31     ` Eric Sandeen
  0 siblings, 0 replies; 36+ messages in thread
From: Eric Sandeen @ 2016-02-19 17:31 UTC (permalink / raw)
  To: Jan Kara, linux-fsdevel; +Cc: Mark Fasheh, Joel Becker, ocfs2-devel, xfs



On 2/4/16 8:28 AM, Jan Kara wrote:
> Add infrastructure for supporting get_nextdqblk() callback for VFS
> quotas. Translate the operation into a callback to appropriate
> filesystem and consequently to quota format callback.
> 
> Signed-off-by: Jan Kara <jack@suse.cz>
> ---
>  fs/ext4/super.c          |  1 +
>  fs/quota/dquot.c         | 39 +++++++++++++++++++++++++++++++++++++++
>  fs/reiserfs/super.c      |  1 +
>  include/linux/quota.h    |  3 +++
>  include/linux/quotaops.h |  3 +++
>  5 files changed, 47 insertions(+)
> 
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index f1b56ff01208..51649f442bf6 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -1100,6 +1100,7 @@ static const struct dquot_operations ext4_quota_operations = {
>  	.write_info	= ext4_write_info,
>  	.alloc_dquot	= dquot_alloc,
>  	.destroy_dquot	= dquot_destroy,
> +	.get_next_id	= dquot_get_next_id,
>  };

Hi Jan, doesn't this also need to set:


+       .get_nextdqblk  = dquot_get_next_dqblk,

in ext4_qctl_sysfile_operations?

Thanks,
-Eric

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Ocfs2-devel] [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota
@ 2016-02-19 17:31     ` Eric Sandeen
  0 siblings, 0 replies; 36+ messages in thread
From: Eric Sandeen @ 2016-02-19 17:31 UTC (permalink / raw)
  To: Jan Kara, linux-fsdevel; +Cc: ocfs2-devel, Mark Fasheh, Joel Becker, xfs



On 2/4/16 8:28 AM, Jan Kara wrote:
> Add infrastructure for supporting get_nextdqblk() callback for VFS
> quotas. Translate the operation into a callback to appropriate
> filesystem and consequently to quota format callback.
> 
> Signed-off-by: Jan Kara <jack@suse.cz>
> ---
>  fs/ext4/super.c          |  1 +
>  fs/quota/dquot.c         | 39 +++++++++++++++++++++++++++++++++++++++
>  fs/reiserfs/super.c      |  1 +
>  include/linux/quota.h    |  3 +++
>  include/linux/quotaops.h |  3 +++
>  5 files changed, 47 insertions(+)
> 
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index f1b56ff01208..51649f442bf6 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -1100,6 +1100,7 @@ static const struct dquot_operations ext4_quota_operations = {
>  	.write_info	= ext4_write_info,
>  	.alloc_dquot	= dquot_alloc,
>  	.destroy_dquot	= dquot_destroy,
> +	.get_next_id	= dquot_get_next_id,
>  };

Hi Jan, doesn't this also need to set:


+       .get_nextdqblk  = dquot_get_next_dqblk,

in ext4_qctl_sysfile_operations?

Thanks,
-Eric

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota
  2016-02-19 17:31     ` Eric Sandeen
  (?)
@ 2016-02-19 18:33       ` Jan Kara
  -1 siblings, 0 replies; 36+ messages in thread
From: Jan Kara @ 2016-02-19 18:33 UTC (permalink / raw)
  To: Eric Sandeen
  Cc: Jan Kara, linux-fsdevel, ocfs2-devel, Mark Fasheh, Joel Becker, xfs

On Fri 19-02-16 11:31:58, Eric Sandeen wrote:
> 
> 
> On 2/4/16 8:28 AM, Jan Kara wrote:
> > Add infrastructure for supporting get_nextdqblk() callback for VFS
> > quotas. Translate the operation into a callback to appropriate
> > filesystem and consequently to quota format callback.
> > 
> > Signed-off-by: Jan Kara <jack@suse.cz>
> > ---
> >  fs/ext4/super.c          |  1 +
> >  fs/quota/dquot.c         | 39 +++++++++++++++++++++++++++++++++++++++
> >  fs/reiserfs/super.c      |  1 +
> >  include/linux/quota.h    |  3 +++
> >  include/linux/quotaops.h |  3 +++
> >  5 files changed, 47 insertions(+)
> > 
> > diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> > index f1b56ff01208..51649f442bf6 100644
> > --- a/fs/ext4/super.c
> > +++ b/fs/ext4/super.c
> > @@ -1100,6 +1100,7 @@ static const struct dquot_operations ext4_quota_operations = {
> >  	.write_info	= ext4_write_info,
> >  	.alloc_dquot	= dquot_alloc,
> >  	.destroy_dquot	= dquot_destroy,
> > +	.get_next_id	= dquot_get_next_id,
> >  };
> 
> Hi Jan, doesn't this also need to set:
> 
> 
> +       .get_nextdqblk  = dquot_get_next_dqblk,
> 
> in ext4_qctl_sysfile_operations?

Indeed, thanks for catching this. Patch added (with your authorship and
sign-off) into my tree and this time I've properly tested Q_GETNEXTQUOTA
for ext4 with quota in hidden inodes indeed works (previously I've tested
only visible quota files).

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota
@ 2016-02-19 18:33       ` Jan Kara
  0 siblings, 0 replies; 36+ messages in thread
From: Jan Kara @ 2016-02-19 18:33 UTC (permalink / raw)
  To: Eric Sandeen
  Cc: Jan Kara, Mark Fasheh, xfs, Joel Becker, linux-fsdevel, ocfs2-devel

On Fri 19-02-16 11:31:58, Eric Sandeen wrote:
> 
> 
> On 2/4/16 8:28 AM, Jan Kara wrote:
> > Add infrastructure for supporting get_nextdqblk() callback for VFS
> > quotas. Translate the operation into a callback to appropriate
> > filesystem and consequently to quota format callback.
> > 
> > Signed-off-by: Jan Kara <jack@suse.cz>
> > ---
> >  fs/ext4/super.c          |  1 +
> >  fs/quota/dquot.c         | 39 +++++++++++++++++++++++++++++++++++++++
> >  fs/reiserfs/super.c      |  1 +
> >  include/linux/quota.h    |  3 +++
> >  include/linux/quotaops.h |  3 +++
> >  5 files changed, 47 insertions(+)
> > 
> > diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> > index f1b56ff01208..51649f442bf6 100644
> > --- a/fs/ext4/super.c
> > +++ b/fs/ext4/super.c
> > @@ -1100,6 +1100,7 @@ static const struct dquot_operations ext4_quota_operations = {
> >  	.write_info	= ext4_write_info,
> >  	.alloc_dquot	= dquot_alloc,
> >  	.destroy_dquot	= dquot_destroy,
> > +	.get_next_id	= dquot_get_next_id,
> >  };
> 
> Hi Jan, doesn't this also need to set:
> 
> 
> +       .get_nextdqblk  = dquot_get_next_dqblk,
> 
> in ext4_qctl_sysfile_operations?

Indeed, thanks for catching this. Patch added (with your authorship and
sign-off) into my tree and this time I've properly tested Q_GETNEXTQUOTA
for ext4 with quota in hidden inodes indeed works (previously I've tested
only visible quota files).

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Ocfs2-devel] [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota
@ 2016-02-19 18:33       ` Jan Kara
  0 siblings, 0 replies; 36+ messages in thread
From: Jan Kara @ 2016-02-19 18:33 UTC (permalink / raw)
  To: Eric Sandeen
  Cc: Jan Kara, linux-fsdevel, ocfs2-devel, Mark Fasheh, Joel Becker, xfs

On Fri 19-02-16 11:31:58, Eric Sandeen wrote:
> 
> 
> On 2/4/16 8:28 AM, Jan Kara wrote:
> > Add infrastructure for supporting get_nextdqblk() callback for VFS
> > quotas. Translate the operation into a callback to appropriate
> > filesystem and consequently to quota format callback.
> > 
> > Signed-off-by: Jan Kara <jack@suse.cz>
> > ---
> >  fs/ext4/super.c          |  1 +
> >  fs/quota/dquot.c         | 39 +++++++++++++++++++++++++++++++++++++++
> >  fs/reiserfs/super.c      |  1 +
> >  include/linux/quota.h    |  3 +++
> >  include/linux/quotaops.h |  3 +++
> >  5 files changed, 47 insertions(+)
> > 
> > diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> > index f1b56ff01208..51649f442bf6 100644
> > --- a/fs/ext4/super.c
> > +++ b/fs/ext4/super.c
> > @@ -1100,6 +1100,7 @@ static const struct dquot_operations ext4_quota_operations = {
> >  	.write_info	= ext4_write_info,
> >  	.alloc_dquot	= dquot_alloc,
> >  	.destroy_dquot	= dquot_destroy,
> > +	.get_next_id	= dquot_get_next_id,
> >  };
> 
> Hi Jan, doesn't this also need to set:
> 
> 
> +       .get_nextdqblk  = dquot_get_next_dqblk,
> 
> in ext4_qctl_sysfile_operations?

Indeed, thanks for catching this. Patch added (with your authorship and
sign-off) into my tree and this time I've properly tested Q_GETNEXTQUOTA
for ext4 with quota in hidden inodes indeed works (previously I've tested
only visible quota files).

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota
  2016-02-19 18:33       ` Jan Kara
  (?)
@ 2016-02-19 18:43         ` Eric Sandeen
  -1 siblings, 0 replies; 36+ messages in thread
From: Eric Sandeen @ 2016-02-19 18:43 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-fsdevel, ocfs2-devel, Mark Fasheh, Joel Becker, xfs



On 2/19/16 12:33 PM, Jan Kara wrote:
> On Fri 19-02-16 11:31:58, Eric Sandeen wrote:
>>
>>
>> On 2/4/16 8:28 AM, Jan Kara wrote:
>>> Add infrastructure for supporting get_nextdqblk() callback for VFS
>>> quotas. Translate the operation into a callback to appropriate
>>> filesystem and consequently to quota format callback.
>>>
>>> Signed-off-by: Jan Kara <jack@suse.cz>
>>> ---
>>>  fs/ext4/super.c          |  1 +
>>>  fs/quota/dquot.c         | 39 +++++++++++++++++++++++++++++++++++++++
>>>  fs/reiserfs/super.c      |  1 +
>>>  include/linux/quota.h    |  3 +++
>>>  include/linux/quotaops.h |  3 +++
>>>  5 files changed, 47 insertions(+)
>>>
>>> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
>>> index f1b56ff01208..51649f442bf6 100644
>>> --- a/fs/ext4/super.c
>>> +++ b/fs/ext4/super.c
>>> @@ -1100,6 +1100,7 @@ static const struct dquot_operations ext4_quota_operations = {
>>>  	.write_info	= ext4_write_info,
>>>  	.alloc_dquot	= dquot_alloc,
>>>  	.destroy_dquot	= dquot_destroy,
>>> +	.get_next_id	= dquot_get_next_id,
>>>  };
>>
>> Hi Jan, doesn't this also need to set:
>>
>>
>> +       .get_nextdqblk  = dquot_get_next_dqblk,
>>
>> in ext4_qctl_sysfile_operations?
> 
> Indeed, thanks for catching this. Patch added (with your authorship and
> sign-off) into my tree and this time I've properly tested Q_GETNEXTQUOTA
> for ext4 with quota in hidden inodes indeed works (previously I've tested
> only visible quota files).

Thanks Jan, I wasn't quite sure what it should be doing, but this seemed
right.  ;)  Sorry for not sending a proper patch.

So, when you tested visible quota files, I assume it was just falling
back to the non-next variants of the quotactl, right?  We should not
be hooking up the call for the visible quota files, right?

FWIW, there is a test in [x]fstests now for the [X]GETNEXT calls, it's
generic/244

Thanks!
-Eric

> 								Honza
> 

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota
@ 2016-02-19 18:43         ` Eric Sandeen
  0 siblings, 0 replies; 36+ messages in thread
From: Eric Sandeen @ 2016-02-19 18:43 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-fsdevel, Mark Fasheh, Joel Becker, ocfs2-devel, xfs



On 2/19/16 12:33 PM, Jan Kara wrote:
> On Fri 19-02-16 11:31:58, Eric Sandeen wrote:
>>
>>
>> On 2/4/16 8:28 AM, Jan Kara wrote:
>>> Add infrastructure for supporting get_nextdqblk() callback for VFS
>>> quotas. Translate the operation into a callback to appropriate
>>> filesystem and consequently to quota format callback.
>>>
>>> Signed-off-by: Jan Kara <jack@suse.cz>
>>> ---
>>>  fs/ext4/super.c          |  1 +
>>>  fs/quota/dquot.c         | 39 +++++++++++++++++++++++++++++++++++++++
>>>  fs/reiserfs/super.c      |  1 +
>>>  include/linux/quota.h    |  3 +++
>>>  include/linux/quotaops.h |  3 +++
>>>  5 files changed, 47 insertions(+)
>>>
>>> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
>>> index f1b56ff01208..51649f442bf6 100644
>>> --- a/fs/ext4/super.c
>>> +++ b/fs/ext4/super.c
>>> @@ -1100,6 +1100,7 @@ static const struct dquot_operations ext4_quota_operations = {
>>>  	.write_info	= ext4_write_info,
>>>  	.alloc_dquot	= dquot_alloc,
>>>  	.destroy_dquot	= dquot_destroy,
>>> +	.get_next_id	= dquot_get_next_id,
>>>  };
>>
>> Hi Jan, doesn't this also need to set:
>>
>>
>> +       .get_nextdqblk  = dquot_get_next_dqblk,
>>
>> in ext4_qctl_sysfile_operations?
> 
> Indeed, thanks for catching this. Patch added (with your authorship and
> sign-off) into my tree and this time I've properly tested Q_GETNEXTQUOTA
> for ext4 with quota in hidden inodes indeed works (previously I've tested
> only visible quota files).

Thanks Jan, I wasn't quite sure what it should be doing, but this seemed
right.  ;)  Sorry for not sending a proper patch.

So, when you tested visible quota files, I assume it was just falling
back to the non-next variants of the quotactl, right?  We should not
be hooking up the call for the visible quota files, right?

FWIW, there is a test in [x]fstests now for the [X]GETNEXT calls, it's
generic/244

Thanks!
-Eric

> 								Honza
> 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Ocfs2-devel] [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota
@ 2016-02-19 18:43         ` Eric Sandeen
  0 siblings, 0 replies; 36+ messages in thread
From: Eric Sandeen @ 2016-02-19 18:43 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-fsdevel, ocfs2-devel, Mark Fasheh, Joel Becker, xfs



On 2/19/16 12:33 PM, Jan Kara wrote:
> On Fri 19-02-16 11:31:58, Eric Sandeen wrote:
>>
>>
>> On 2/4/16 8:28 AM, Jan Kara wrote:
>>> Add infrastructure for supporting get_nextdqblk() callback for VFS
>>> quotas. Translate the operation into a callback to appropriate
>>> filesystem and consequently to quota format callback.
>>>
>>> Signed-off-by: Jan Kara <jack@suse.cz>
>>> ---
>>>  fs/ext4/super.c          |  1 +
>>>  fs/quota/dquot.c         | 39 +++++++++++++++++++++++++++++++++++++++
>>>  fs/reiserfs/super.c      |  1 +
>>>  include/linux/quota.h    |  3 +++
>>>  include/linux/quotaops.h |  3 +++
>>>  5 files changed, 47 insertions(+)
>>>
>>> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
>>> index f1b56ff01208..51649f442bf6 100644
>>> --- a/fs/ext4/super.c
>>> +++ b/fs/ext4/super.c
>>> @@ -1100,6 +1100,7 @@ static const struct dquot_operations ext4_quota_operations = {
>>>  	.write_info	= ext4_write_info,
>>>  	.alloc_dquot	= dquot_alloc,
>>>  	.destroy_dquot	= dquot_destroy,
>>> +	.get_next_id	= dquot_get_next_id,
>>>  };
>>
>> Hi Jan, doesn't this also need to set:
>>
>>
>> +       .get_nextdqblk  = dquot_get_next_dqblk,
>>
>> in ext4_qctl_sysfile_operations?
> 
> Indeed, thanks for catching this. Patch added (with your authorship and
> sign-off) into my tree and this time I've properly tested Q_GETNEXTQUOTA
> for ext4 with quota in hidden inodes indeed works (previously I've tested
> only visible quota files).

Thanks Jan, I wasn't quite sure what it should be doing, but this seemed
right.  ;)  Sorry for not sending a proper patch.

So, when you tested visible quota files, I assume it was just falling
back to the non-next variants of the quotactl, right?  We should not
be hooking up the call for the visible quota files, right?

FWIW, there is a test in [x]fstests now for the [X]GETNEXT calls, it's
generic/244

Thanks!
-Eric

> 								Honza
> 

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota
  2016-02-19 18:43         ` Eric Sandeen
  (?)
@ 2016-02-22  8:01           ` Jan Kara
  -1 siblings, 0 replies; 36+ messages in thread
From: Jan Kara @ 2016-02-22  8:01 UTC (permalink / raw)
  To: Eric Sandeen
  Cc: Jan Kara, linux-fsdevel, ocfs2-devel, Mark Fasheh, Joel Becker, xfs

On Fri 19-02-16 12:43:13, Eric Sandeen wrote:
> 
> 
> On 2/19/16 12:33 PM, Jan Kara wrote:
> > On Fri 19-02-16 11:31:58, Eric Sandeen wrote:
> >>
> >>
> >> On 2/4/16 8:28 AM, Jan Kara wrote:
> >>> Add infrastructure for supporting get_nextdqblk() callback for VFS
> >>> quotas. Translate the operation into a callback to appropriate
> >>> filesystem and consequently to quota format callback.
> >>>
> >>> Signed-off-by: Jan Kara <jack@suse.cz>
> >>> ---
> >>>  fs/ext4/super.c          |  1 +
> >>>  fs/quota/dquot.c         | 39 +++++++++++++++++++++++++++++++++++++++
> >>>  fs/reiserfs/super.c      |  1 +
> >>>  include/linux/quota.h    |  3 +++
> >>>  include/linux/quotaops.h |  3 +++
> >>>  5 files changed, 47 insertions(+)
> >>>
> >>> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> >>> index f1b56ff01208..51649f442bf6 100644
> >>> --- a/fs/ext4/super.c
> >>> +++ b/fs/ext4/super.c
> >>> @@ -1100,6 +1100,7 @@ static const struct dquot_operations ext4_quota_operations = {
> >>>  	.write_info	= ext4_write_info,
> >>>  	.alloc_dquot	= dquot_alloc,
> >>>  	.destroy_dquot	= dquot_destroy,
> >>> +	.get_next_id	= dquot_get_next_id,
> >>>  };
> >>
> >> Hi Jan, doesn't this also need to set:
> >>
> >>
> >> +       .get_nextdqblk  = dquot_get_next_dqblk,
> >>
> >> in ext4_qctl_sysfile_operations?
> > 
> > Indeed, thanks for catching this. Patch added (with your authorship and
> > sign-off) into my tree and this time I've properly tested Q_GETNEXTQUOTA
> > for ext4 with quota in hidden inodes indeed works (previously I've tested
> > only visible quota files).
> 
> Thanks Jan, I wasn't quite sure what it should be doing, but this seemed
> right.  ;)  Sorry for not sending a proper patch.
> 
> So, when you tested visible quota files, I assume it was just falling
> back to the non-next variants of the quotactl, right?  We should not
> be hooking up the call for the visible quota files, right?

We are hooking up the call for visible quota files since it works without
issues. It is upto userspace to decide whether it wants to read the quota
file directly or use Q_GETNEXTQUOTA call to iterate over all dquots.

> FWIW, there is a test in [x]fstests now for the [X]GETNEXT calls, it's
> generic/244

Great, thanks!

								Honza

-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota
@ 2016-02-22  8:01           ` Jan Kara
  0 siblings, 0 replies; 36+ messages in thread
From: Jan Kara @ 2016-02-22  8:01 UTC (permalink / raw)
  To: Eric Sandeen
  Cc: Jan Kara, Mark Fasheh, xfs, Joel Becker, linux-fsdevel, ocfs2-devel

On Fri 19-02-16 12:43:13, Eric Sandeen wrote:
> 
> 
> On 2/19/16 12:33 PM, Jan Kara wrote:
> > On Fri 19-02-16 11:31:58, Eric Sandeen wrote:
> >>
> >>
> >> On 2/4/16 8:28 AM, Jan Kara wrote:
> >>> Add infrastructure for supporting get_nextdqblk() callback for VFS
> >>> quotas. Translate the operation into a callback to appropriate
> >>> filesystem and consequently to quota format callback.
> >>>
> >>> Signed-off-by: Jan Kara <jack@suse.cz>
> >>> ---
> >>>  fs/ext4/super.c          |  1 +
> >>>  fs/quota/dquot.c         | 39 +++++++++++++++++++++++++++++++++++++++
> >>>  fs/reiserfs/super.c      |  1 +
> >>>  include/linux/quota.h    |  3 +++
> >>>  include/linux/quotaops.h |  3 +++
> >>>  5 files changed, 47 insertions(+)
> >>>
> >>> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> >>> index f1b56ff01208..51649f442bf6 100644
> >>> --- a/fs/ext4/super.c
> >>> +++ b/fs/ext4/super.c
> >>> @@ -1100,6 +1100,7 @@ static const struct dquot_operations ext4_quota_operations = {
> >>>  	.write_info	= ext4_write_info,
> >>>  	.alloc_dquot	= dquot_alloc,
> >>>  	.destroy_dquot	= dquot_destroy,
> >>> +	.get_next_id	= dquot_get_next_id,
> >>>  };
> >>
> >> Hi Jan, doesn't this also need to set:
> >>
> >>
> >> +       .get_nextdqblk  = dquot_get_next_dqblk,
> >>
> >> in ext4_qctl_sysfile_operations?
> > 
> > Indeed, thanks for catching this. Patch added (with your authorship and
> > sign-off) into my tree and this time I've properly tested Q_GETNEXTQUOTA
> > for ext4 with quota in hidden inodes indeed works (previously I've tested
> > only visible quota files).
> 
> Thanks Jan, I wasn't quite sure what it should be doing, but this seemed
> right.  ;)  Sorry for not sending a proper patch.
> 
> So, when you tested visible quota files, I assume it was just falling
> back to the non-next variants of the quotactl, right?  We should not
> be hooking up the call for the visible quota files, right?

We are hooking up the call for visible quota files since it works without
issues. It is upto userspace to decide whether it wants to read the quota
file directly or use Q_GETNEXTQUOTA call to iterate over all dquots.

> FWIW, there is a test in [x]fstests now for the [X]GETNEXT calls, it's
> generic/244

Great, thanks!

								Honza

-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Ocfs2-devel] [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota
@ 2016-02-22  8:01           ` Jan Kara
  0 siblings, 0 replies; 36+ messages in thread
From: Jan Kara @ 2016-02-22  8:01 UTC (permalink / raw)
  To: Eric Sandeen
  Cc: Jan Kara, linux-fsdevel, ocfs2-devel, Mark Fasheh, Joel Becker, xfs

On Fri 19-02-16 12:43:13, Eric Sandeen wrote:
> 
> 
> On 2/19/16 12:33 PM, Jan Kara wrote:
> > On Fri 19-02-16 11:31:58, Eric Sandeen wrote:
> >>
> >>
> >> On 2/4/16 8:28 AM, Jan Kara wrote:
> >>> Add infrastructure for supporting get_nextdqblk() callback for VFS
> >>> quotas. Translate the operation into a callback to appropriate
> >>> filesystem and consequently to quota format callback.
> >>>
> >>> Signed-off-by: Jan Kara <jack@suse.cz>
> >>> ---
> >>>  fs/ext4/super.c          |  1 +
> >>>  fs/quota/dquot.c         | 39 +++++++++++++++++++++++++++++++++++++++
> >>>  fs/reiserfs/super.c      |  1 +
> >>>  include/linux/quota.h    |  3 +++
> >>>  include/linux/quotaops.h |  3 +++
> >>>  5 files changed, 47 insertions(+)
> >>>
> >>> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> >>> index f1b56ff01208..51649f442bf6 100644
> >>> --- a/fs/ext4/super.c
> >>> +++ b/fs/ext4/super.c
> >>> @@ -1100,6 +1100,7 @@ static const struct dquot_operations ext4_quota_operations = {
> >>>  	.write_info	= ext4_write_info,
> >>>  	.alloc_dquot	= dquot_alloc,
> >>>  	.destroy_dquot	= dquot_destroy,
> >>> +	.get_next_id	= dquot_get_next_id,
> >>>  };
> >>
> >> Hi Jan, doesn't this also need to set:
> >>
> >>
> >> +       .get_nextdqblk  = dquot_get_next_dqblk,
> >>
> >> in ext4_qctl_sysfile_operations?
> > 
> > Indeed, thanks for catching this. Patch added (with your authorship and
> > sign-off) into my tree and this time I've properly tested Q_GETNEXTQUOTA
> > for ext4 with quota in hidden inodes indeed works (previously I've tested
> > only visible quota files).
> 
> Thanks Jan, I wasn't quite sure what it should be doing, but this seemed
> right.  ;)  Sorry for not sending a proper patch.
> 
> So, when you tested visible quota files, I assume it was just falling
> back to the non-next variants of the quotactl, right?  We should not
> be hooking up the call for the visible quota files, right?

We are hooking up the call for visible quota files since it works without
issues. It is upto userspace to decide whether it wants to read the quota
file directly or use Q_GETNEXTQUOTA call to iterate over all dquots.

> FWIW, there is a test in [x]fstests now for the [X]GETNEXT calls, it's
> generic/244

Great, thanks!

								Honza

-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2016-02-22  8:20 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-04 14:28 [PATCH 0/3 v2] Q_GETNEXTQUOTA support Jan Kara
2016-02-04 14:28 ` [Ocfs2-devel] " Jan Kara
2016-02-04 14:28 ` Jan Kara
2016-02-04 14:28 ` [PATCH 1/3] quota: Add support for ->get_nextdqblk() for VFS quota Jan Kara
2016-02-04 14:28   ` [Ocfs2-devel] " Jan Kara
2016-02-04 14:28   ` Jan Kara
2016-02-05  1:05   ` Dave Chinner
2016-02-05  1:05     ` [Ocfs2-devel] " Dave Chinner
2016-02-05  1:05     ` Dave Chinner
2016-02-08  6:15     ` Dave Chinner
2016-02-08  6:15       ` [Ocfs2-devel] " Dave Chinner
2016-02-08  6:15       ` Dave Chinner
2016-02-08 14:27     ` Jan Kara
2016-02-08 14:27       ` [Ocfs2-devel] " Jan Kara
2016-02-08 14:27       ` Jan Kara
2016-02-08 14:34       ` Jan Kara
2016-02-08 14:34         ` [Ocfs2-devel] " Jan Kara
2016-02-08 14:34         ` Jan Kara
2016-02-19 17:31   ` Eric Sandeen
2016-02-19 17:31     ` [Ocfs2-devel] " Eric Sandeen
2016-02-19 17:31     ` Eric Sandeen
2016-02-19 18:33     ` Jan Kara
2016-02-19 18:33       ` [Ocfs2-devel] " Jan Kara
2016-02-19 18:33       ` Jan Kara
2016-02-19 18:43       ` Eric Sandeen
2016-02-19 18:43         ` [Ocfs2-devel] " Eric Sandeen
2016-02-19 18:43         ` Eric Sandeen
2016-02-22  8:01         ` Jan Kara
2016-02-22  8:01           ` [Ocfs2-devel] " Jan Kara
2016-02-22  8:01           ` Jan Kara
2016-02-04 14:28 ` [PATCH 2/3] quota_v2: Implement get_next_id() for V2 quota format Jan Kara
2016-02-04 14:28   ` [Ocfs2-devel] " Jan Kara
2016-02-04 14:28   ` Jan Kara
2016-02-04 14:28 ` [PATCH 3/3] ocfs2: Implement get_next_id() Jan Kara
2016-02-04 14:28   ` [Ocfs2-devel] " Jan Kara
2016-02-04 14:28   ` Jan Kara

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.