aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_quotaops.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_quotaops.c')
-rw-r--r--fs/xfs/xfs_quotaops.c36
1 files changed, 34 insertions, 2 deletions
diff --git a/fs/xfs/xfs_quotaops.c b/fs/xfs/xfs_quotaops.c
index 7795e0d01382..f82d79a8c694 100644
--- a/fs/xfs/xfs_quotaops.c
+++ b/fs/xfs/xfs_quotaops.c
@@ -231,14 +231,45 @@ xfs_fs_get_dqblk(
231 struct qc_dqblk *qdq) 231 struct qc_dqblk *qdq)
232{ 232{
233 struct xfs_mount *mp = XFS_M(sb); 233 struct xfs_mount *mp = XFS_M(sb);
234 xfs_dqid_t id;
234 235
235 if (!XFS_IS_QUOTA_RUNNING(mp)) 236 if (!XFS_IS_QUOTA_RUNNING(mp))
236 return -ENOSYS; 237 return -ENOSYS;
237 if (!XFS_IS_QUOTA_ON(mp)) 238 if (!XFS_IS_QUOTA_ON(mp))
238 return -ESRCH; 239 return -ESRCH;
239 240
240 return xfs_qm_scall_getquota(mp, from_kqid(&init_user_ns, qid), 241 id = from_kqid(&init_user_ns, qid);
241 xfs_quota_type(qid.type), qdq); 242 return xfs_qm_scall_getquota(mp, &id,
243 xfs_quota_type(qid.type), qdq, 0);
244}
245
246/* Return quota info for active quota >= this qid */
247STATIC int
248xfs_fs_get_nextdqblk(
249 struct super_block *sb,
250 struct kqid *qid,
251 struct qc_dqblk *qdq)
252{
253 int ret;
254 struct xfs_mount *mp = XFS_M(sb);
255 xfs_dqid_t id;
256
257 if (!XFS_IS_QUOTA_RUNNING(mp))
258 return -ENOSYS;
259 if (!XFS_IS_QUOTA_ON(mp))
260 return -ESRCH;
261
262 id = from_kqid(&init_user_ns, *qid);
263 ret = xfs_qm_scall_getquota(mp, &id,
264 xfs_quota_type(qid->type), qdq,
265 XFS_QMOPT_DQNEXT);
266 if (ret)
267 return ret;
268
269 /* ID may be different, so convert back what we got */
270 *qid = make_kqid(current_user_ns(), qid->type, id);
271 return 0;
272
242} 273}
243 274
244STATIC int 275STATIC int
@@ -267,5 +298,6 @@ const struct quotactl_ops xfs_quotactl_operations = {
267 .quota_disable = xfs_quota_disable, 298 .quota_disable = xfs_quota_disable,
268 .rm_xquota = xfs_fs_rm_xquota, 299 .rm_xquota = xfs_fs_rm_xquota,
269 .get_dqblk = xfs_fs_get_dqblk, 300 .get_dqblk = xfs_fs_get_dqblk,
301 .get_nextdqblk = xfs_fs_get_nextdqblk,
270 .set_dqblk = xfs_fs_set_dqblk, 302 .set_dqblk = xfs_fs_set_dqblk,
271}; 303};