Add quotactl_fd() support

To be able to set quotas on filesystems without a backing device, quota tools
should be able to use quotactl_fd().
To achieve that, add a new helper, do_quotactl(), to select between quotactl()
and quotactl_fd().

This shouldn't change the semantics of current code. quotactl_fd() will be
called if and only if the handlers contain an empty device, and a valid
All current calls containing a value device should be still handled by quotactl().
The same is true for calls passing a NULL device on purpose, aiming to sync
active quotas.

Signed-off-by: Carlos Maiolino <>
Signed-off-by: Lukas Czerner <>
Signed-off-by: Jan Kara <>
13 files changed