diff options
author | Christoph Hellwig <hch@infradead.org> | 2010-05-06 17:05:17 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2010-05-21 13:30:44 -0400 |
commit | c472b43275976512e4c1c32da5ced03f339cb380 (patch) | |
tree | 9159fbfd1190456e8b3e699b856022c23f6ec10c /fs/xfs | |
parent | b9b2dd36c1bc64430f8e13990ab135cbecc10076 (diff) |
quota: unify ->set_dqblk
Pass the larger struct fs_disk_quota to the ->set_dqblk operation so
that the Q_SETQUOTA and Q_XSETQUOTA operations can be implemented
with a single filesystem operation and we can retire the ->set_xquota
operation. The additional information (RT-subvolume accounting and
warn counts) are left zero for the VFS quota implementation.
Add new fieldmask values for setting the numer of blocks and inodes
values which is required for the VFS quota, but wasn't for XFS.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_quotaops.c | 4 | ||||
-rw-r--r-- | fs/xfs/quota/xfs_qm_syscalls.c | 10 |
2 files changed, 9 insertions, 5 deletions
diff --git a/fs/xfs/linux-2.6/xfs_quotaops.c b/fs/xfs/linux-2.6/xfs_quotaops.c index 3d473f43c9a9..e31bf21fe5d3 100644 --- a/fs/xfs/linux-2.6/xfs_quotaops.c +++ b/fs/xfs/linux-2.6/xfs_quotaops.c | |||
@@ -114,7 +114,7 @@ xfs_fs_get_dqblk( | |||
114 | } | 114 | } |
115 | 115 | ||
116 | STATIC int | 116 | STATIC int |
117 | xfs_fs_set_xquota( | 117 | xfs_fs_set_dqblk( |
118 | struct super_block *sb, | 118 | struct super_block *sb, |
119 | int type, | 119 | int type, |
120 | qid_t id, | 120 | qid_t id, |
@@ -136,5 +136,5 @@ const struct quotactl_ops xfs_quotactl_operations = { | |||
136 | .get_xstate = xfs_fs_get_xstate, | 136 | .get_xstate = xfs_fs_get_xstate, |
137 | .set_xstate = xfs_fs_set_xstate, | 137 | .set_xstate = xfs_fs_set_xstate, |
138 | .get_dqblk = xfs_fs_get_dqblk, | 138 | .get_dqblk = xfs_fs_get_dqblk, |
139 | .set_xquota = xfs_fs_set_xquota, | 139 | .set_dqblk = xfs_fs_set_dqblk, |
140 | }; | 140 | }; |
diff --git a/fs/xfs/quota/xfs_qm_syscalls.c b/fs/xfs/quota/xfs_qm_syscalls.c index 26fa43140f2e..92b002f1805f 100644 --- a/fs/xfs/quota/xfs_qm_syscalls.c +++ b/fs/xfs/quota/xfs_qm_syscalls.c | |||
@@ -448,6 +448,9 @@ xfs_qm_scall_getqstat( | |||
448 | return 0; | 448 | return 0; |
449 | } | 449 | } |
450 | 450 | ||
451 | #define XFS_DQ_MASK \ | ||
452 | (FS_DQ_LIMIT_MASK | FS_DQ_TIMER_MASK | FS_DQ_WARNS_MASK) | ||
453 | |||
451 | /* | 454 | /* |
452 | * Adjust quota limits, and start/stop timers accordingly. | 455 | * Adjust quota limits, and start/stop timers accordingly. |
453 | */ | 456 | */ |
@@ -465,9 +468,10 @@ xfs_qm_scall_setqlim( | |||
465 | int error; | 468 | int error; |
466 | xfs_qcnt_t hard, soft; | 469 | xfs_qcnt_t hard, soft; |
467 | 470 | ||
468 | if ((newlim->d_fieldmask & | 471 | if (newlim->d_fieldmask & ~XFS_DQ_MASK) |
469 | (FS_DQ_LIMIT_MASK|FS_DQ_TIMER_MASK|FS_DQ_WARNS_MASK)) == 0) | 472 | return EINVAL; |
470 | return (0); | 473 | if ((newlim->d_fieldmask & XFS_DQ_MASK) == 0) |
474 | return 0; | ||
471 | 475 | ||
472 | tp = xfs_trans_alloc(mp, XFS_TRANS_QM_SETQLIM); | 476 | tp = xfs_trans_alloc(mp, XFS_TRANS_QM_SETQLIM); |
473 | if ((error = xfs_trans_reserve(tp, 0, sizeof(xfs_disk_dquot_t) + 128, | 477 | if ((error = xfs_trans_reserve(tp, 0, sizeof(xfs_disk_dquot_t) + 128, |