linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7 V3] quota: add new quotactl Q_GETNEXTQUOTA
@ 2016-01-22 18:25 Eric Sandeen
  2016-01-22 18:25 ` [PATCH 1/7] quota: remove unused cmd argument from quota_quotaon() Eric Sandeen
                   ` (8 more replies)
  0 siblings, 9 replies; 23+ messages in thread
From: Eric Sandeen @ 2016-01-22 18:25 UTC (permalink / raw)
  To: linux-fsdevel, xfs; +Cc: jack

This adds a new quotactl, Q_GETNEXTQUOTA.

Q_GETNEXTQUOTA is exactly like Q_GETQUOTA, except that it will
return quota information for the id equal to or greater than
the id requested.  In other words, if the specified id has
no quota, the command will return quota information for the
next higher id which does have a quota set.  If no higher id
has an active quota, -ESRCH is returned.

So if you ask for id X, you can get back quota for id X,
id X+N, or -ESRCH if no higher id has a quota.

This allows filesystems to do efficient iteration in kernelspace,
much like extN filesystems do in userspace when asked to report
all active quotas.

Today, filesystems such as XFS require getpwent()-style iterations,
and for systems which have i.e. LDAP backends, this can be very
slow, or even impossible if iteration is not allowed in the
configuration.

Patches 1 and 4 are just small fixups that turned up along the way;
2 and 3 add the actual quota plumbing, and the rest are xfs-specific
to allow xfs to support this new interface.

For non-xfs quota, this does require a new structure which is
able to pass back the discovered ID along with the quota info.
For xfs-quota, the id is already present in the structure.

V3:
* Remove 32-bit compat stuff (i686/x86_64 at least works w/o it...)
* Require CAP_SYS_ADMIN for these calls
* Pass back found ID in &qid passed to ->get_nextdqblk, rather
  than modifying struct qc_dqblk
* Munge that found ID back through user-namespace conversions
  before returning it in the user structure.

Thanks,
-Eric

^ permalink raw reply	[flat|nested] 23+ messages in thread
* [PATCH 0/7 V2] quota: add new quotactl Q_GETNEXTQUOTA
@ 2016-01-22  4:07 Eric Sandeen
  2016-01-22  4:07 ` [PATCH 5/7] xfs: get quota inode from mp & flags rather than dqp Eric Sandeen
  0 siblings, 1 reply; 23+ messages in thread
From: Eric Sandeen @ 2016-01-22  4:07 UTC (permalink / raw)
  To: linux-fsdevel, xfs; +Cc: jack

This adds a new quotactl, Q_GETNEXTQUOTA.

Q_GETNEXTQUOTA is exactly like Q_GETQUOTA, except that it will
return quota information for the id equal to or greater than
the id requested.  In other words, if the specified id has
no quota, the command will return quota information for the
next higher id which does have a quota set.  If no higher id
has an active quota, -ESRCH is returned.

So if you ask for id X, you can get back quota for id X,
id X+N, or -ESRCH if no higher id has a quota.

This allows filesystems to do efficient iteration in kernelspace,
much like extN filesystems do in userspace when asked to report
all active quotas.

Today, filesystems such as XFS require getpwent()-style iterations,
and for systems which have i.e. LDAP backends, this can be very
slow, or even impossible if iteration is not allowed in the
configuration.

Patches 1 and 4 are just small fixups that turned up along the way;
2 and 3 add the actual quota plumbing, and the rest are xfs-specific
to allow xfs to support this new interface.

For non-xfs quota, this does require a new structure which is
able to pass back the discovered ID along with the quota info.
For xfs-quota, the id is already present in the structure.

I sent a regression test to the fstests list today, and will
send updated xfsprogs & linux-quota patches soon.

Thanks,
-Eric


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

end of thread, other threads:[~2016-01-26 20:40 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-22 18:25 [PATCH 0/7 V3] quota: add new quotactl Q_GETNEXTQUOTA Eric Sandeen
2016-01-22 18:25 ` [PATCH 1/7] quota: remove unused cmd argument from quota_quotaon() Eric Sandeen
2016-01-25 14:47   ` Jan Kara
2016-01-25 14:49     ` Jan Kara
2016-01-22 18:25 ` [PATCH 2/7] quota: add new quotactl Q_XGETNEXTQUOTA Eric Sandeen
2016-01-25 14:51   ` Jan Kara
2016-01-26 12:57   ` Jan Kara
2016-01-26 15:00     ` Eric Sandeen
2016-01-26 17:52       ` Jan Kara
2016-01-26 17:57         ` Eric Sandeen
2016-01-26 18:39         ` Eric Sandeen
2016-01-26 20:40           ` Jan Kara
2016-01-22 18:25 ` [PATCH 3/7] quota: add new quotactl Q_GETNEXTQUOTA Eric Sandeen
2016-01-25 14:51   ` Jan Kara
2016-01-22 18:25 ` [PATCH 4/7] xfs: don't overflow quota ID when initializing dqblk Eric Sandeen
2016-01-22 18:25 ` [PATCH 5/7] xfs: get quota inode from mp & flags rather than dqp Eric Sandeen
2016-01-22 18:25 ` [PATCH 6/7] xfs: Factor xfs_seek_hole_data into helper Eric Sandeen
2016-01-22 18:25 ` [PATCH 7/7] xfs: wire up Q_XGETNEXTQUOTA / get_nextdqblk Eric Sandeen
2016-01-26 18:40   ` [PATCH 7/7 V4] " Eric Sandeen
2016-01-25 15:07 ` [PATCH 0/7 V3] quota: add new quotactl Q_GETNEXTQUOTA Jan Kara
2016-01-25 16:04   ` Eric Sandeen
2016-01-26 13:10 ` Jan Kara
  -- strict thread matches above, loose matches on Subject: below --
2016-01-22  4:07 [PATCH 0/7 V2] " Eric Sandeen
2016-01-22  4:07 ` [PATCH 5/7] xfs: get quota inode from mp & flags rather than dqp Eric Sandeen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).