aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/quota/xfs_qm_syscalls.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/quota/xfs_qm_syscalls.c')
-rw-r--r--fs/xfs/quota/xfs_qm_syscalls.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/fs/xfs/quota/xfs_qm_syscalls.c b/fs/xfs/quota/xfs_qm_syscalls.c
index 2df67fd913e5..ad5579d4eac4 100644
--- a/fs/xfs/quota/xfs_qm_syscalls.c
+++ b/fs/xfs/quota/xfs_qm_syscalls.c
@@ -81,18 +81,13 @@ STATIC void xfs_qm_export_dquot(xfs_mount_t *, xfs_disk_dquot_t *,
81 */ 81 */
82int 82int
83xfs_qm_quotactl( 83xfs_qm_quotactl(
84 struct bhv_desc *bdp, 84 xfs_mount_t *mp,
85 int cmd, 85 int cmd,
86 int id, 86 int id,
87 xfs_caddr_t addr) 87 xfs_caddr_t addr)
88{ 88{
89 xfs_mount_t *mp;
90 bhv_vfs_t *vfsp;
91 int error; 89 int error;
92 90
93 vfsp = bhvtovfs(bdp);
94 mp = XFS_VFSTOM(vfsp);
95
96 ASSERT(addr != NULL || cmd == Q_XQUOTASYNC); 91 ASSERT(addr != NULL || cmd == Q_XQUOTASYNC);
97 92
98 /* 93 /*
@@ -105,7 +100,7 @@ xfs_qm_quotactl(
105 */ 100 */
106 if (XFS_IS_QUOTA_ON(mp)) 101 if (XFS_IS_QUOTA_ON(mp))
107 return XFS_ERROR(EINVAL); 102 return XFS_ERROR(EINVAL);
108 if (vfsp->vfs_flag & VFS_RDONLY) 103 if (mp->m_flags & XFS_MOUNT_RDONLY)
109 return XFS_ERROR(EROFS); 104 return XFS_ERROR(EROFS);
110 return (xfs_qm_scall_trunc_qfiles(mp, 105 return (xfs_qm_scall_trunc_qfiles(mp,
111 xfs_qm_import_qtype_flags(*(uint *)addr))); 106 xfs_qm_import_qtype_flags(*(uint *)addr)));
@@ -121,13 +116,13 @@ xfs_qm_quotactl(
121 * QUOTAON - enabling quota enforcement. 116 * QUOTAON - enabling quota enforcement.
122 * Quota accounting must be turned on at mount time. 117 * Quota accounting must be turned on at mount time.
123 */ 118 */
124 if (vfsp->vfs_flag & VFS_RDONLY) 119 if (mp->m_flags & XFS_MOUNT_RDONLY)
125 return XFS_ERROR(EROFS); 120 return XFS_ERROR(EROFS);
126 return (xfs_qm_scall_quotaon(mp, 121 return (xfs_qm_scall_quotaon(mp,
127 xfs_qm_import_flags(*(uint *)addr))); 122 xfs_qm_import_flags(*(uint *)addr)));
128 123
129 case Q_XQUOTAOFF: 124 case Q_XQUOTAOFF:
130 if (vfsp->vfs_flag & VFS_RDONLY) 125 if (mp->m_flags & XFS_MOUNT_RDONLY)
131 return XFS_ERROR(EROFS); 126 return XFS_ERROR(EROFS);
132 break; 127 break;
133 128
@@ -143,7 +138,7 @@ xfs_qm_quotactl(
143 138
144 switch (cmd) { 139 switch (cmd) {
145 case Q_XQUOTAOFF: 140 case Q_XQUOTAOFF:
146 if (vfsp->vfs_flag & VFS_RDONLY) 141 if (mp->m_flags & XFS_MOUNT_RDONLY)
147 return XFS_ERROR(EROFS); 142 return XFS_ERROR(EROFS);
148 error = xfs_qm_scall_quotaoff(mp, 143 error = xfs_qm_scall_quotaoff(mp,
149 xfs_qm_import_flags(*(uint *)addr), 144 xfs_qm_import_flags(*(uint *)addr),
@@ -164,19 +159,19 @@ xfs_qm_quotactl(
164 break; 159 break;
165 160
166 case Q_XSETQLIM: 161 case Q_XSETQLIM:
167 if (vfsp->vfs_flag & VFS_RDONLY) 162 if (mp->m_flags & XFS_MOUNT_RDONLY)
168 return XFS_ERROR(EROFS); 163 return XFS_ERROR(EROFS);
169 error = xfs_qm_scall_setqlim(mp, (xfs_dqid_t)id, XFS_DQ_USER, 164 error = xfs_qm_scall_setqlim(mp, (xfs_dqid_t)id, XFS_DQ_USER,
170 (fs_disk_quota_t *)addr); 165 (fs_disk_quota_t *)addr);
171 break; 166 break;
172 case Q_XSETGQLIM: 167 case Q_XSETGQLIM:
173 if (vfsp->vfs_flag & VFS_RDONLY) 168 if (mp->m_flags & XFS_MOUNT_RDONLY)
174 return XFS_ERROR(EROFS); 169 return XFS_ERROR(EROFS);
175 error = xfs_qm_scall_setqlim(mp, (xfs_dqid_t)id, XFS_DQ_GROUP, 170 error = xfs_qm_scall_setqlim(mp, (xfs_dqid_t)id, XFS_DQ_GROUP,
176 (fs_disk_quota_t *)addr); 171 (fs_disk_quota_t *)addr);
177 break; 172 break;
178 case Q_XSETPQLIM: 173 case Q_XSETPQLIM:
179 if (vfsp->vfs_flag & VFS_RDONLY) 174 if (mp->m_flags & XFS_MOUNT_RDONLY)
180 return XFS_ERROR(EROFS); 175 return XFS_ERROR(EROFS);
181 error = xfs_qm_scall_setqlim(mp, (xfs_dqid_t)id, XFS_DQ_PROJ, 176 error = xfs_qm_scall_setqlim(mp, (xfs_dqid_t)id, XFS_DQ_PROJ,
182 (fs_disk_quota_t *)addr); 177 (fs_disk_quota_t *)addr);