[Cluster-devel] [PATCH 01/17] quota: Split -set_xstate callback into two

2015-01-16 Thread Jan Kara
Split -set_xstate callback into two callbacks - one for turning quotas on (-quota_enable) and one for turning quotas off (-quota_disable). That way we don't have to pass quotactl command into the callback which seems cleaner. Signed-off-by: Jan Kara j...@suse.cz --- fs/quota/quota.c | 20

[Cluster-devel] [PATCH 0/17 v3] quota: Unify VFS and XFS quota interfaces

2015-01-16 Thread Jan Kara
Hello, this is another iteration of patches to unify VFS and XFS quota interfaces so that XFS quotactls work for filesystems with VFS quotas and vice versa. This is useful so that userspace doesn't have to care that much about which filesystem it is using at least when using basic quota

[Cluster-devel] [PATCH 04/17] ext4: Use generic helpers for quotaon and quotaoff

2015-01-16 Thread Jan Kara
Ext4 can just use the generic helpers provided by quota code for turning quotas on and off when quota files are stored as system inodes. The only difference is the feature test in ext4_quota_on_sysfile() but the same is achieved in dquot_quota_enable() by checking whether usage tracking for the

[Cluster-devel] [PATCH 10/17] quota: Make VFS quotas use new interface for getting quota info

2015-01-16 Thread Jan Kara
Create new internal interface for getting information about quota which contains everything needed for both VFS quotas and XFS quotas. Make VFS use this and hook it up to Q_GETINFO. Signed-off-by: Jan Kara j...@suse.cz --- fs/ext3/super.c | 2 +- fs/ext4/super.c | 2 +-

[Cluster-devel] [PATCH 06/17] quota: Remove quota_on_meta callback

2015-01-16 Thread Jan Kara
There are no more users for quota_on_meta callback. Just remove it. Signed-off-by: Jan Kara j...@suse.cz --- fs/quota/quota.c | 5 + include/linux/quota.h | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/fs/quota/quota.c b/fs/quota/quota.c index

[Cluster-devel] [PATCH 07/17] quota: Switch -get_dqblk() and -set_dqblk() to use bytes as space units

2015-01-16 Thread Jan Kara
Currently -get_dqblk() and -set_dqblk() use struct fs_disk_quota which tracks space limits and usage in 512-byte blocks. However VFS quotas track usage in bytes (as some filesystems require that) and we need to somehow pass this information. Upto now it wasn't a problem because we didn't do any

[Cluster-devel] [PATCH 03/17] quota: Add -quota_{enable, disable} callbacks for VFS quotas

2015-01-16 Thread Jan Kara
Add functions which translate -quota_enable / -quota_disable calls into appropriate changes in VFS quota. This will enable filesystems supporting VFS quota files in system inodes to be controlled via Q_XQUOTA[ON|OFF] quotactls for better userspace compatibility. Also provide a vector for quotactl

[Cluster-devel] [PATCH 05/17] ocfs2: Use generic helpers for quotaon and quotaoff

2015-01-16 Thread Jan Kara
Ocfs2 can just use the generic helpers provided by quota code for turning quotas on and off when quota files are stored as system inodes. The only difference is the feature test in ocfs2_quota_on() and that is covered by dquot_quota_enable() checking whether usage tracking is enabled (which can

[Cluster-devel] [PATCH 02/17] quota: Wire up -quota_{enable, disable} callbacks into Q_QUOTA{ON, OFF}

2015-01-16 Thread Jan Kara
Make Q_QUOTAON / Q_QUOTAOFF quotactl call -quota_enable / -quota_disable callback when provided. To match current behavior of ocfs2 ext4 we make these quotactls turn on / off quota enforcement for appropriate quota type. Signed-off-by: Jan Kara j...@suse.cz --- fs/quota/quota.c | 31

[Cluster-devel] [PATCH 16/17] xfs: Add support for Q_SETINFO

2015-01-16 Thread Jan Kara
Add support to XFS so that time limits can be set through Q_SETINFO quotactl. Signed-off-by: Jan Kara j...@suse.cz --- fs/xfs/xfs_qm.h | 2 ++ fs/xfs/xfs_qm_syscalls.c | 25 + fs/xfs/xfs_quotaops.c| 16 3 files changed, 43 insertions(+)

[Cluster-devel] [PATCH 15/17] quota: Make -set_info use structure with neccesary info to VFS and XFS

2015-01-16 Thread Jan Kara
Change -set_info to take new qc_info structure which contains all the necessary information both for XFS and VFS. Convert Q_SETINFO handler to use this structure. Signed-off-by: Jan Kara j...@suse.cz --- fs/quota/dquot.c | 27 --- fs/quota/quota.c | 21

[Cluster-devel] [PATCH 08/17] quota: Store maximum space limit in bytes

2015-01-16 Thread Jan Kara
Currently maximum space limit quota format supports is in blocks however since we store space limits in bytes, this is somewhat confusing. So store the maximum limit in bytes as well. Also rename the field to match the new unit and related inode field to match the new naming scheme.

[Cluster-devel] [PATCH 09/17] quota: Make Q_XQUOTASYNC support VFS quota syncing

2015-01-16 Thread Jan Kara
Call -quota_sync method from Q_XQUOTASYNC for better userspace compatibility. Signed-off-by: Jan Kara j...@suse.cz --- fs/quota/quota.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/quota/quota.c b/fs/quota/quota.c index 2cc50b35a3b5..5ec04321aace 100644 ---

[Cluster-devel] [PATCH 13/17] gfs2: Convert to using -get_state callback

2015-01-16 Thread Jan Kara
Convert gfs2 to use -get_state callback instead of -get_xstate. Signed-off-by: Jan Kara j...@suse.cz --- fs/gfs2/quota.c | 28 +++- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 3e193cb36996..aebfe50da6b1 100644

[Cluster-devel] [PATCH 17/17] quota: Hook up Q_XSETQLIM for id 0 to -set_info

2015-01-16 Thread Jan Kara
Setting timers or warning counts for id 0 via Q_XSETQLIM is used to actually set time limits and warning limits for all users. Hook up -set_info to this so that VFS quota time limits get set the same way as XFS ones. When doing this Q_XSETQLIM for XFS is effectively split into two independent

[Cluster-devel] [PATCH 11/17] quota: Wire up Q_GETXSTATE and Q_GETXSTATV calls to work with -get_state

2015-01-16 Thread Jan Kara
Add appropriate conversion functions so that filesystems supporting -get_state() method can be queried using Q_GETXSTATE and Q_GETXSTATV calls. Signed-off-by: Jan Kara j...@suse.cz --- fs/quota/quota.c | 138 +-- 1 file changed, 134

[Cluster-devel] [PATCH 14/17] quota: Remove -get_xstate and -get_xstatev callbacks

2015-01-16 Thread Jan Kara
These callbacks are now unused. Remove them. Signed-off-by: Jan Kara j...@suse.cz --- fs/quota/quota.c | 14 -- include/linux/quota.h | 2 -- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/fs/quota/quota.c b/fs/quota/quota.c index 7d04b95dfbbf..cb52a1d9c91a

[Cluster-devel] [PATCH 12/17] xfs: Convert to using -get_state callback

2015-01-16 Thread Jan Kara
Convert xfs to use -get_state callback instead of -get_xstate and -get_xstatev. Signed-off-by: Jan Kara j...@suse.cz --- fs/xfs/xfs_qm.h | 6 +- fs/xfs/xfs_qm_syscalls.c | 219 --- fs/xfs/xfs_quotaops.c| 26 +- 3 files changed, 58