diff options
-rw-r--r-- | fs/ext4/super.c | 1 | ||||
-rw-r--r-- | fs/quota/dquot.c | 39 | ||||
-rw-r--r-- | fs/reiserfs/super.c | 1 | ||||
-rw-r--r-- | include/linux/quota.h | 3 | ||||
-rw-r--r-- | include/linux/quotaops.h | 3 |
5 files changed, 47 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 3ed01ec011d7..b5bcbddceb91 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -1132,6 +1132,7 @@ static const struct dquot_operations ext4_quota_operations = { | |||
1132 | .alloc_dquot = dquot_alloc, | 1132 | .alloc_dquot = dquot_alloc, |
1133 | .destroy_dquot = dquot_destroy, | 1133 | .destroy_dquot = dquot_destroy, |
1134 | .get_projid = ext4_get_projid, | 1134 | .get_projid = ext4_get_projid, |
1135 | .get_next_id = dquot_get_next_id, | ||
1135 | }; | 1136 | }; |
1136 | 1137 | ||
1137 | static const struct quotactl_ops ext4_qctl_operations = { | 1138 | static const struct quotactl_ops ext4_qctl_operations = { |
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 3c3b81bb6dfe..7e0137bde6d6 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) | |||
2031 | } | 2031 | } |
2032 | EXPORT_SYMBOL(dquot_commit_info); | 2032 | EXPORT_SYMBOL(dquot_commit_info); |
2033 | 2033 | ||
2034 | int dquot_get_next_id(struct super_block *sb, struct kqid *qid) | ||
2035 | { | ||
2036 | struct quota_info *dqopt = sb_dqopt(sb); | ||
2037 | int err; | ||
2038 | |||
2039 | if (!dqopt->ops[qid->type]->get_next_id) | ||
2040 | return -ENOSYS; | ||
2041 | mutex_lock(&dqopt->dqio_mutex); | ||
2042 | err = dqopt->ops[qid->type]->get_next_id(sb, qid); | ||
2043 | mutex_unlock(&dqopt->dqio_mutex); | ||
2044 | |||
2045 | return err; | ||
2046 | } | ||
2047 | EXPORT_SYMBOL(dquot_get_next_id); | ||
2048 | |||
2034 | /* | 2049 | /* |
2035 | * Definitions of diskquota operations. | 2050 | * Definitions of diskquota operations. |
2036 | */ | 2051 | */ |
@@ -2042,6 +2057,7 @@ const struct dquot_operations dquot_operations = { | |||
2042 | .write_info = dquot_commit_info, | 2057 | .write_info = dquot_commit_info, |
2043 | .alloc_dquot = dquot_alloc, | 2058 | .alloc_dquot = dquot_alloc, |
2044 | .destroy_dquot = dquot_destroy, | 2059 | .destroy_dquot = dquot_destroy, |
2060 | .get_next_id = dquot_get_next_id, | ||
2045 | }; | 2061 | }; |
2046 | EXPORT_SYMBOL(dquot_operations); | 2062 | EXPORT_SYMBOL(dquot_operations); |
2047 | 2063 | ||
@@ -2565,6 +2581,27 @@ int dquot_get_dqblk(struct super_block *sb, struct kqid qid, | |||
2565 | } | 2581 | } |
2566 | EXPORT_SYMBOL(dquot_get_dqblk); | 2582 | EXPORT_SYMBOL(dquot_get_dqblk); |
2567 | 2583 | ||
2584 | int dquot_get_next_dqblk(struct super_block *sb, struct kqid *qid, | ||
2585 | struct qc_dqblk *di) | ||
2586 | { | ||
2587 | struct dquot *dquot; | ||
2588 | int err; | ||
2589 | |||
2590 | if (!sb->dq_op->get_next_id) | ||
2591 | return -ENOSYS; | ||
2592 | err = sb->dq_op->get_next_id(sb, qid); | ||
2593 | if (err < 0) | ||
2594 | return err; | ||
2595 | dquot = dqget(sb, *qid); | ||
2596 | if (IS_ERR(dquot)) | ||
2597 | return PTR_ERR(dquot); | ||
2598 | do_get_dqblk(dquot, di); | ||
2599 | dqput(dquot); | ||
2600 | |||
2601 | return 0; | ||
2602 | } | ||
2603 | EXPORT_SYMBOL(dquot_get_next_dqblk); | ||
2604 | |||
2568 | #define VFS_QC_MASK \ | 2605 | #define VFS_QC_MASK \ |
2569 | (QC_SPACE | QC_SPC_SOFT | QC_SPC_HARD | \ | 2606 | (QC_SPACE | QC_SPC_SOFT | QC_SPC_HARD | \ |
2570 | QC_INO_COUNT | QC_INO_SOFT | QC_INO_HARD | \ | 2607 | QC_INO_COUNT | QC_INO_SOFT | QC_INO_HARD | \ |
@@ -2765,6 +2802,7 @@ const struct quotactl_ops dquot_quotactl_ops = { | |||
2765 | .get_state = dquot_get_state, | 2802 | .get_state = dquot_get_state, |
2766 | .set_info = dquot_set_dqinfo, | 2803 | .set_info = dquot_set_dqinfo, |
2767 | .get_dqblk = dquot_get_dqblk, | 2804 | .get_dqblk = dquot_get_dqblk, |
2805 | .get_nextdqblk = dquot_get_next_dqblk, | ||
2768 | .set_dqblk = dquot_set_dqblk | 2806 | .set_dqblk = dquot_set_dqblk |
2769 | }; | 2807 | }; |
2770 | EXPORT_SYMBOL(dquot_quotactl_ops); | 2808 | EXPORT_SYMBOL(dquot_quotactl_ops); |
@@ -2776,6 +2814,7 @@ const struct quotactl_ops dquot_quotactl_sysfile_ops = { | |||
2776 | .get_state = dquot_get_state, | 2814 | .get_state = dquot_get_state, |
2777 | .set_info = dquot_set_dqinfo, | 2815 | .set_info = dquot_set_dqinfo, |
2778 | .get_dqblk = dquot_get_dqblk, | 2816 | .get_dqblk = dquot_get_dqblk, |
2817 | .get_nextdqblk = dquot_get_next_dqblk, | ||
2779 | .set_dqblk = dquot_set_dqblk | 2818 | .set_dqblk = dquot_set_dqblk |
2780 | }; | 2819 | }; |
2781 | EXPORT_SYMBOL(dquot_quotactl_sysfile_ops); | 2820 | EXPORT_SYMBOL(dquot_quotactl_sysfile_ops); |
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index c0306ec8ed7b..b8f2d1e8c645 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c | |||
@@ -802,6 +802,7 @@ static const struct dquot_operations reiserfs_quota_operations = { | |||
802 | .write_info = reiserfs_write_info, | 802 | .write_info = reiserfs_write_info, |
803 | .alloc_dquot = dquot_alloc, | 803 | .alloc_dquot = dquot_alloc, |
804 | .destroy_dquot = dquot_destroy, | 804 | .destroy_dquot = dquot_destroy, |
805 | .get_next_id = dquot_get_next_id, | ||
805 | }; | 806 | }; |
806 | 807 | ||
807 | static const struct quotactl_ops reiserfs_qctl_operations = { | 808 | 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 { | |||
306 | int (*read_dqblk)(struct dquot *dquot); /* Read structure for one user */ | 306 | int (*read_dqblk)(struct dquot *dquot); /* Read structure for one user */ |
307 | int (*commit_dqblk)(struct dquot *dquot); /* Write structure for one user */ | 307 | int (*commit_dqblk)(struct dquot *dquot); /* Write structure for one user */ |
308 | int (*release_dqblk)(struct dquot *dquot); /* Called when last reference to dquot is being dropped */ | 308 | int (*release_dqblk)(struct dquot *dquot); /* Called when last reference to dquot is being dropped */ |
309 | int (*get_next_id)(struct super_block *sb, struct kqid *qid); /* Get next ID with existing structure in the quota file */ | ||
309 | }; | 310 | }; |
310 | 311 | ||
311 | /* Operations working with dquots */ | 312 | /* Operations working with dquots */ |
@@ -321,6 +322,8 @@ struct dquot_operations { | |||
321 | * quota code only */ | 322 | * quota code only */ |
322 | qsize_t *(*get_reserved_space) (struct inode *); | 323 | qsize_t *(*get_reserved_space) (struct inode *); |
323 | int (*get_projid) (struct inode *, kprojid_t *);/* Get project ID */ | 324 | int (*get_projid) (struct inode *, kprojid_t *);/* Get project ID */ |
325 | /* Get next ID with active quota structure */ | ||
326 | int (*get_next_id) (struct super_block *sb, struct kqid *qid); | ||
324 | }; | 327 | }; |
325 | 328 | ||
326 | struct path; | 329 | 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); | |||
82 | int dquot_acquire(struct dquot *dquot); | 82 | int dquot_acquire(struct dquot *dquot); |
83 | int dquot_release(struct dquot *dquot); | 83 | int dquot_release(struct dquot *dquot); |
84 | int dquot_commit_info(struct super_block *sb, int type); | 84 | int dquot_commit_info(struct super_block *sb, int type); |
85 | int dquot_get_next_id(struct super_block *sb, struct kqid *qid); | ||
85 | int dquot_mark_dquot_dirty(struct dquot *dquot); | 86 | int dquot_mark_dquot_dirty(struct dquot *dquot); |
86 | 87 | ||
87 | int dquot_file_open(struct inode *inode, struct file *file); | 88 | 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); | |||
99 | int dquot_set_dqinfo(struct super_block *sb, int type, struct qc_info *ii); | 100 | int dquot_set_dqinfo(struct super_block *sb, int type, struct qc_info *ii); |
100 | int dquot_get_dqblk(struct super_block *sb, struct kqid id, | 101 | int dquot_get_dqblk(struct super_block *sb, struct kqid id, |
101 | struct qc_dqblk *di); | 102 | struct qc_dqblk *di); |
103 | int dquot_get_next_dqblk(struct super_block *sb, struct kqid *id, | ||
104 | struct qc_dqblk *di); | ||
102 | int dquot_set_dqblk(struct super_block *sb, struct kqid id, | 105 | int dquot_set_dqblk(struct super_block *sb, struct kqid id, |
103 | struct qc_dqblk *di); | 106 | struct qc_dqblk *di); |
104 | 107 | ||