aboutsummaryrefslogtreecommitdiffstats
path: root/fs/quota/quota_v2.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/quota/quota_v2.c')
-rw-r--r--fs/quota/quota_v2.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/fs/quota/quota_v2.c b/fs/quota/quota_v2.c
index f1ab3604db5a..02751ec695c5 100644
--- a/fs/quota/quota_v2.c
+++ b/fs/quota/quota_v2.c
@@ -196,7 +196,7 @@ static void v2r0_mem2diskdqb(void *dp, struct dquot *dquot)
196 struct v2r0_disk_dqblk *d = dp; 196 struct v2r0_disk_dqblk *d = dp;
197 struct mem_dqblk *m = &dquot->dq_dqb; 197 struct mem_dqblk *m = &dquot->dq_dqb;
198 struct qtree_mem_dqinfo *info = 198 struct qtree_mem_dqinfo *info =
199 sb_dqinfo(dquot->dq_sb, dquot->dq_type)->dqi_priv; 199 sb_dqinfo(dquot->dq_sb, dquot->dq_id.type)->dqi_priv;
200 200
201 d->dqb_ihardlimit = cpu_to_le32(m->dqb_ihardlimit); 201 d->dqb_ihardlimit = cpu_to_le32(m->dqb_ihardlimit);
202 d->dqb_isoftlimit = cpu_to_le32(m->dqb_isoftlimit); 202 d->dqb_isoftlimit = cpu_to_le32(m->dqb_isoftlimit);
@@ -206,7 +206,7 @@ static void v2r0_mem2diskdqb(void *dp, struct dquot *dquot)
206 d->dqb_bsoftlimit = cpu_to_le32(v2_stoqb(m->dqb_bsoftlimit)); 206 d->dqb_bsoftlimit = cpu_to_le32(v2_stoqb(m->dqb_bsoftlimit));
207 d->dqb_curspace = cpu_to_le64(m->dqb_curspace); 207 d->dqb_curspace = cpu_to_le64(m->dqb_curspace);
208 d->dqb_btime = cpu_to_le64(m->dqb_btime); 208 d->dqb_btime = cpu_to_le64(m->dqb_btime);
209 d->dqb_id = cpu_to_le32(dquot->dq_id); 209 d->dqb_id = cpu_to_le32(from_kqid(&init_user_ns, dquot->dq_id));
210 if (qtree_entry_unused(info, dp)) 210 if (qtree_entry_unused(info, dp))
211 d->dqb_itime = cpu_to_le64(1); 211 d->dqb_itime = cpu_to_le64(1);
212} 212}
@@ -215,11 +215,13 @@ static int v2r0_is_id(void *dp, struct dquot *dquot)
215{ 215{
216 struct v2r0_disk_dqblk *d = dp; 216 struct v2r0_disk_dqblk *d = dp;
217 struct qtree_mem_dqinfo *info = 217 struct qtree_mem_dqinfo *info =
218 sb_dqinfo(dquot->dq_sb, dquot->dq_type)->dqi_priv; 218 sb_dqinfo(dquot->dq_sb, dquot->dq_id.type)->dqi_priv;
219 219
220 if (qtree_entry_unused(info, dp)) 220 if (qtree_entry_unused(info, dp))
221 return 0; 221 return 0;
222 return le32_to_cpu(d->dqb_id) == dquot->dq_id; 222 return qid_eq(make_kqid(&init_user_ns, dquot->dq_id.type,
223 le32_to_cpu(d->dqb_id)),
224 dquot->dq_id);
223} 225}
224 226
225static void v2r1_disk2memdqb(struct dquot *dquot, void *dp) 227static void v2r1_disk2memdqb(struct dquot *dquot, void *dp)
@@ -247,7 +249,7 @@ static void v2r1_mem2diskdqb(void *dp, struct dquot *dquot)
247 struct v2r1_disk_dqblk *d = dp; 249 struct v2r1_disk_dqblk *d = dp;
248 struct mem_dqblk *m = &dquot->dq_dqb; 250 struct mem_dqblk *m = &dquot->dq_dqb;
249 struct qtree_mem_dqinfo *info = 251 struct qtree_mem_dqinfo *info =
250 sb_dqinfo(dquot->dq_sb, dquot->dq_type)->dqi_priv; 252 sb_dqinfo(dquot->dq_sb, dquot->dq_id.type)->dqi_priv;
251 253
252 d->dqb_ihardlimit = cpu_to_le64(m->dqb_ihardlimit); 254 d->dqb_ihardlimit = cpu_to_le64(m->dqb_ihardlimit);
253 d->dqb_isoftlimit = cpu_to_le64(m->dqb_isoftlimit); 255 d->dqb_isoftlimit = cpu_to_le64(m->dqb_isoftlimit);
@@ -257,7 +259,7 @@ static void v2r1_mem2diskdqb(void *dp, struct dquot *dquot)
257 d->dqb_bsoftlimit = cpu_to_le64(v2_stoqb(m->dqb_bsoftlimit)); 259 d->dqb_bsoftlimit = cpu_to_le64(v2_stoqb(m->dqb_bsoftlimit));
258 d->dqb_curspace = cpu_to_le64(m->dqb_curspace); 260 d->dqb_curspace = cpu_to_le64(m->dqb_curspace);
259 d->dqb_btime = cpu_to_le64(m->dqb_btime); 261 d->dqb_btime = cpu_to_le64(m->dqb_btime);
260 d->dqb_id = cpu_to_le32(dquot->dq_id); 262 d->dqb_id = cpu_to_le32(from_kqid(&init_user_ns, dquot->dq_id));
261 if (qtree_entry_unused(info, dp)) 263 if (qtree_entry_unused(info, dp))
262 d->dqb_itime = cpu_to_le64(1); 264 d->dqb_itime = cpu_to_le64(1);
263} 265}
@@ -266,26 +268,28 @@ static int v2r1_is_id(void *dp, struct dquot *dquot)
266{ 268{
267 struct v2r1_disk_dqblk *d = dp; 269 struct v2r1_disk_dqblk *d = dp;
268 struct qtree_mem_dqinfo *info = 270 struct qtree_mem_dqinfo *info =
269 sb_dqinfo(dquot->dq_sb, dquot->dq_type)->dqi_priv; 271 sb_dqinfo(dquot->dq_sb, dquot->dq_id.type)->dqi_priv;
270 272
271 if (qtree_entry_unused(info, dp)) 273 if (qtree_entry_unused(info, dp))
272 return 0; 274 return 0;
273 return le32_to_cpu(d->dqb_id) == dquot->dq_id; 275 return qid_eq(make_kqid(&init_user_ns, dquot->dq_id.type,
276 le32_to_cpu(d->dqb_id)),
277 dquot->dq_id);
274} 278}
275 279
276static int v2_read_dquot(struct dquot *dquot) 280static int v2_read_dquot(struct dquot *dquot)
277{ 281{
278 return qtree_read_dquot(sb_dqinfo(dquot->dq_sb, dquot->dq_type)->dqi_priv, dquot); 282 return qtree_read_dquot(sb_dqinfo(dquot->dq_sb, dquot->dq_id.type)->dqi_priv, dquot);
279} 283}
280 284
281static int v2_write_dquot(struct dquot *dquot) 285static int v2_write_dquot(struct dquot *dquot)
282{ 286{
283 return qtree_write_dquot(sb_dqinfo(dquot->dq_sb, dquot->dq_type)->dqi_priv, dquot); 287 return qtree_write_dquot(sb_dqinfo(dquot->dq_sb, dquot->dq_id.type)->dqi_priv, dquot);
284} 288}
285 289
286static int v2_release_dquot(struct dquot *dquot) 290static int v2_release_dquot(struct dquot *dquot)
287{ 291{
288 return qtree_release_dquot(sb_dqinfo(dquot->dq_sb, dquot->dq_type)->dqi_priv, dquot); 292 return qtree_release_dquot(sb_dqinfo(dquot->dq_sb, dquot->dq_id.type)->dqi_priv, dquot);
289} 293}
290 294
291static int v2_free_file_info(struct super_block *sb, int type) 295static int v2_free_file_info(struct super_block *sb, int type)