diff options
Diffstat (limited to 'fs/xfs/quota/xfs_dquot.c')
-rw-r--r-- | fs/xfs/quota/xfs_dquot.c | 237 |
1 files changed, 107 insertions, 130 deletions
diff --git a/fs/xfs/quota/xfs_dquot.c b/fs/xfs/quota/xfs_dquot.c index e2e8d35fa4d0..00b5043dfa5a 100644 --- a/fs/xfs/quota/xfs_dquot.c +++ b/fs/xfs/quota/xfs_dquot.c | |||
@@ -1,39 +1,25 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved. | 2 | * Copyright (c) 2000-2003 Silicon Graphics, Inc. |
3 | * All Rights Reserved. | ||
3 | * | 4 | * |
4 | * This program is free software; you can redistribute it and/or modify it | 5 | * This program is free software; you can redistribute it and/or |
5 | * under the terms of version 2 of the GNU General Public License as | 6 | * modify it under the terms of the GNU General Public License as |
6 | * published by the Free Software Foundation. | 7 | * published by the Free Software Foundation. |
7 | * | 8 | * |
8 | * This program is distributed in the hope that it would be useful, but | 9 | * This program is distributed in the hope that it would be useful, |
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * GNU General Public License for more details. | ||
11 | * | 13 | * |
12 | * Further, this software is distributed without any warranty that it is | 14 | * You should have received a copy of the GNU General Public License |
13 | * free of the rightful claim of any third person regarding infringement | 15 | * along with this program; if not, write the Free Software Foundation, |
14 | * or the like. Any license provided herein, whether implied or | 16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
15 | * otherwise, applies only to this software file. Patent licenses, if | ||
16 | * any, provided herein do not apply to combinations of this program with | ||
17 | * other software, or any other product whatsoever. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License along | ||
20 | * with this program; if not, write the Free Software Foundation, Inc., 59 | ||
21 | * Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
22 | * | ||
23 | * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, | ||
24 | * Mountain View, CA 94043, or: | ||
25 | * | ||
26 | * http://www.sgi.com | ||
27 | * | ||
28 | * For further information regarding this notice, see: | ||
29 | * | ||
30 | * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ | ||
31 | */ | 17 | */ |
32 | |||
33 | #include "xfs.h" | 18 | #include "xfs.h" |
34 | #include "xfs_fs.h" | 19 | #include "xfs_fs.h" |
35 | #include "xfs_inum.h" | 20 | #include "xfs_bit.h" |
36 | #include "xfs_log.h" | 21 | #include "xfs_log.h" |
22 | #include "xfs_inum.h" | ||
37 | #include "xfs_trans.h" | 23 | #include "xfs_trans.h" |
38 | #include "xfs_sb.h" | 24 | #include "xfs_sb.h" |
39 | #include "xfs_ag.h" | 25 | #include "xfs_ag.h" |
@@ -43,18 +29,17 @@ | |||
43 | #include "xfs_dmapi.h" | 29 | #include "xfs_dmapi.h" |
44 | #include "xfs_quota.h" | 30 | #include "xfs_quota.h" |
45 | #include "xfs_mount.h" | 31 | #include "xfs_mount.h" |
46 | #include "xfs_alloc_btree.h" | ||
47 | #include "xfs_bmap_btree.h" | 32 | #include "xfs_bmap_btree.h" |
33 | #include "xfs_alloc_btree.h" | ||
48 | #include "xfs_ialloc_btree.h" | 34 | #include "xfs_ialloc_btree.h" |
49 | #include "xfs_btree.h" | ||
50 | #include "xfs_ialloc.h" | ||
51 | #include "xfs_attr_sf.h" | ||
52 | #include "xfs_dir_sf.h" | 35 | #include "xfs_dir_sf.h" |
53 | #include "xfs_dir2_sf.h" | 36 | #include "xfs_dir2_sf.h" |
37 | #include "xfs_attr_sf.h" | ||
54 | #include "xfs_dinode.h" | 38 | #include "xfs_dinode.h" |
55 | #include "xfs_inode.h" | 39 | #include "xfs_inode.h" |
40 | #include "xfs_btree.h" | ||
41 | #include "xfs_ialloc.h" | ||
56 | #include "xfs_bmap.h" | 42 | #include "xfs_bmap.h" |
57 | #include "xfs_bit.h" | ||
58 | #include "xfs_rtalloc.h" | 43 | #include "xfs_rtalloc.h" |
59 | #include "xfs_error.h" | 44 | #include "xfs_error.h" |
60 | #include "xfs_itable.h" | 45 | #include "xfs_itable.h" |
@@ -66,7 +51,6 @@ | |||
66 | #include "xfs_buf_item.h" | 51 | #include "xfs_buf_item.h" |
67 | #include "xfs_trans_space.h" | 52 | #include "xfs_trans_space.h" |
68 | #include "xfs_trans_priv.h" | 53 | #include "xfs_trans_priv.h" |
69 | |||
70 | #include "xfs_qm.h" | 54 | #include "xfs_qm.h" |
71 | 55 | ||
72 | 56 | ||
@@ -112,7 +96,7 @@ xfs_qm_dqinit( | |||
112 | 96 | ||
113 | brandnewdquot = xfs_qm_dqalloc_incore(&dqp); | 97 | brandnewdquot = xfs_qm_dqalloc_incore(&dqp); |
114 | dqp->dq_flags = type; | 98 | dqp->dq_flags = type; |
115 | INT_SET(dqp->q_core.d_id, ARCH_CONVERT, id); | 99 | dqp->q_core.d_id = cpu_to_be32(id); |
116 | dqp->q_mount = mp; | 100 | dqp->q_mount = mp; |
117 | 101 | ||
118 | /* | 102 | /* |
@@ -194,10 +178,10 @@ xfs_qm_dqinit_core( | |||
194 | /* | 178 | /* |
195 | * Caller has zero'd the entire dquot 'chunk' already. | 179 | * Caller has zero'd the entire dquot 'chunk' already. |
196 | */ | 180 | */ |
197 | INT_SET(d->dd_diskdq.d_magic, ARCH_CONVERT, XFS_DQUOT_MAGIC); | 181 | d->dd_diskdq.d_magic = cpu_to_be16(XFS_DQUOT_MAGIC); |
198 | INT_SET(d->dd_diskdq.d_version, ARCH_CONVERT, XFS_DQUOT_VERSION); | 182 | d->dd_diskdq.d_version = XFS_DQUOT_VERSION; |
199 | INT_SET(d->dd_diskdq.d_id, ARCH_CONVERT, id); | 183 | d->dd_diskdq.d_id = cpu_to_be32(id); |
200 | INT_SET(d->dd_diskdq.d_flags, ARCH_CONVERT, type); | 184 | d->dd_diskdq.d_flags = type; |
201 | } | 185 | } |
202 | 186 | ||
203 | 187 | ||
@@ -227,19 +211,13 @@ __xfs_dqtrace_entry( | |||
227 | (void *)(__psint_t)dqp->q_nrefs, | 211 | (void *)(__psint_t)dqp->q_nrefs, |
228 | (void *)(__psint_t)dqp->dq_flags, | 212 | (void *)(__psint_t)dqp->dq_flags, |
229 | (void *)(__psint_t)dqp->q_res_bcount, | 213 | (void *)(__psint_t)dqp->q_res_bcount, |
230 | (void *)(__psint_t)INT_GET(dqp->q_core.d_bcount, | 214 | (void *)(__psint_t)be64_to_cpu(dqp->q_core.d_bcount), |
231 | ARCH_CONVERT), | 215 | (void *)(__psint_t)be64_to_cpu(dqp->q_core.d_icount), |
232 | (void *)(__psint_t)INT_GET(dqp->q_core.d_icount, | 216 | (void *)(__psint_t)be64_to_cpu(dqp->q_core.d_blk_hardlimit), |
233 | ARCH_CONVERT), | 217 | (void *)(__psint_t)be64_to_cpu(dqp->q_core.d_blk_softlimit), |
234 | (void *)(__psint_t)INT_GET(dqp->q_core.d_blk_hardlimit, | 218 | (void *)(__psint_t)be64_to_cpu(dqp->q_core.d_ino_hardlimit), |
235 | ARCH_CONVERT), | 219 | (void *)(__psint_t)be64_to_cpu(dqp->q_core.d_ino_softlimit), |
236 | (void *)(__psint_t)INT_GET(dqp->q_core.d_blk_softlimit, | 220 | (void *)(__psint_t)be32_to_cpu(dqp->q_core.d_id), |
237 | ARCH_CONVERT), | ||
238 | (void *)(__psint_t)INT_GET(dqp->q_core.d_ino_hardlimit, | ||
239 | ARCH_CONVERT), | ||
240 | (void *)(__psint_t)INT_GET(dqp->q_core.d_ino_softlimit, | ||
241 | ARCH_CONVERT), | ||
242 | (void *)(__psint_t)INT_GET(dqp->q_core.d_id, ARCH_CONVERT), | ||
243 | (void *)(__psint_t)current_pid(), | 221 | (void *)(__psint_t)current_pid(), |
244 | (void *)(__psint_t)ino, | 222 | (void *)(__psint_t)ino, |
245 | (void *)(__psint_t)retaddr, | 223 | (void *)(__psint_t)retaddr, |
@@ -264,17 +242,17 @@ xfs_qm_adjust_dqlimits( | |||
264 | ASSERT(d->d_id); | 242 | ASSERT(d->d_id); |
265 | 243 | ||
266 | if (q->qi_bsoftlimit && !d->d_blk_softlimit) | 244 | if (q->qi_bsoftlimit && !d->d_blk_softlimit) |
267 | INT_SET(d->d_blk_softlimit, ARCH_CONVERT, q->qi_bsoftlimit); | 245 | d->d_blk_softlimit = cpu_to_be64(q->qi_bsoftlimit); |
268 | if (q->qi_bhardlimit && !d->d_blk_hardlimit) | 246 | if (q->qi_bhardlimit && !d->d_blk_hardlimit) |
269 | INT_SET(d->d_blk_hardlimit, ARCH_CONVERT, q->qi_bhardlimit); | 247 | d->d_blk_hardlimit = cpu_to_be64(q->qi_bhardlimit); |
270 | if (q->qi_isoftlimit && !d->d_ino_softlimit) | 248 | if (q->qi_isoftlimit && !d->d_ino_softlimit) |
271 | INT_SET(d->d_ino_softlimit, ARCH_CONVERT, q->qi_isoftlimit); | 249 | d->d_ino_softlimit = cpu_to_be64(q->qi_isoftlimit); |
272 | if (q->qi_ihardlimit && !d->d_ino_hardlimit) | 250 | if (q->qi_ihardlimit && !d->d_ino_hardlimit) |
273 | INT_SET(d->d_ino_hardlimit, ARCH_CONVERT, q->qi_ihardlimit); | 251 | d->d_ino_hardlimit = cpu_to_be64(q->qi_ihardlimit); |
274 | if (q->qi_rtbsoftlimit && !d->d_rtb_softlimit) | 252 | if (q->qi_rtbsoftlimit && !d->d_rtb_softlimit) |
275 | INT_SET(d->d_rtb_softlimit, ARCH_CONVERT, q->qi_rtbsoftlimit); | 253 | d->d_rtb_softlimit = cpu_to_be64(q->qi_rtbsoftlimit); |
276 | if (q->qi_rtbhardlimit && !d->d_rtb_hardlimit) | 254 | if (q->qi_rtbhardlimit && !d->d_rtb_hardlimit) |
277 | INT_SET(d->d_rtb_hardlimit, ARCH_CONVERT, q->qi_rtbhardlimit); | 255 | d->d_rtb_hardlimit = cpu_to_be64(q->qi_rtbhardlimit); |
278 | } | 256 | } |
279 | 257 | ||
280 | /* | 258 | /* |
@@ -298,81 +276,81 @@ xfs_qm_adjust_dqtimers( | |||
298 | ASSERT(d->d_id); | 276 | ASSERT(d->d_id); |
299 | 277 | ||
300 | #ifdef QUOTADEBUG | 278 | #ifdef QUOTADEBUG |
301 | if (INT_GET(d->d_blk_hardlimit, ARCH_CONVERT)) | 279 | if (d->d_blk_hardlimit) |
302 | ASSERT(INT_GET(d->d_blk_softlimit, ARCH_CONVERT) <= | 280 | ASSERT(be64_to_cpu(d->d_blk_softlimit) <= |
303 | INT_GET(d->d_blk_hardlimit, ARCH_CONVERT)); | 281 | be64_to_cpu(d->d_blk_hardlimit)); |
304 | if (INT_GET(d->d_ino_hardlimit, ARCH_CONVERT)) | 282 | if (d->d_ino_hardlimit) |
305 | ASSERT(INT_GET(d->d_ino_softlimit, ARCH_CONVERT) <= | 283 | ASSERT(be64_to_cpu(d->d_ino_softlimit) <= |
306 | INT_GET(d->d_ino_hardlimit, ARCH_CONVERT)); | 284 | be64_to_cpu(d->d_ino_hardlimit)); |
307 | if (INT_GET(d->d_rtb_hardlimit, ARCH_CONVERT)) | 285 | if (d->d_rtb_hardlimit) |
308 | ASSERT(INT_GET(d->d_rtb_softlimit, ARCH_CONVERT) <= | 286 | ASSERT(be64_to_cpu(d->d_rtb_softlimit) <= |
309 | INT_GET(d->d_rtb_hardlimit, ARCH_CONVERT)); | 287 | be64_to_cpu(d->d_rtb_hardlimit)); |
310 | #endif | 288 | #endif |
311 | if (!d->d_btimer) { | 289 | if (!d->d_btimer) { |
312 | if ((INT_GET(d->d_blk_softlimit, ARCH_CONVERT) && | 290 | if ((d->d_blk_softlimit && |
313 | (INT_GET(d->d_bcount, ARCH_CONVERT) >= | 291 | (be64_to_cpu(d->d_bcount) >= |
314 | INT_GET(d->d_blk_softlimit, ARCH_CONVERT))) || | 292 | be64_to_cpu(d->d_blk_softlimit))) || |
315 | (INT_GET(d->d_blk_hardlimit, ARCH_CONVERT) && | 293 | (d->d_blk_hardlimit && |
316 | (INT_GET(d->d_bcount, ARCH_CONVERT) >= | 294 | (be64_to_cpu(d->d_bcount) >= |
317 | INT_GET(d->d_blk_hardlimit, ARCH_CONVERT)))) { | 295 | be64_to_cpu(d->d_blk_hardlimit)))) { |
318 | INT_SET(d->d_btimer, ARCH_CONVERT, | 296 | d->d_btimer = cpu_to_be32(get_seconds() + |
319 | get_seconds() + XFS_QI_BTIMELIMIT(mp)); | 297 | XFS_QI_BTIMELIMIT(mp)); |
320 | } else { | 298 | } else { |
321 | d->d_bwarns = 0; | 299 | d->d_bwarns = 0; |
322 | } | 300 | } |
323 | } else { | 301 | } else { |
324 | if ((!d->d_blk_softlimit || | 302 | if ((!d->d_blk_softlimit || |
325 | (INT_GET(d->d_bcount, ARCH_CONVERT) < | 303 | (be64_to_cpu(d->d_bcount) < |
326 | INT_GET(d->d_blk_softlimit, ARCH_CONVERT))) && | 304 | be64_to_cpu(d->d_blk_softlimit))) && |
327 | (!d->d_blk_hardlimit || | 305 | (!d->d_blk_hardlimit || |
328 | (INT_GET(d->d_bcount, ARCH_CONVERT) < | 306 | (be64_to_cpu(d->d_bcount) < |
329 | INT_GET(d->d_blk_hardlimit, ARCH_CONVERT)))) { | 307 | be64_to_cpu(d->d_blk_hardlimit)))) { |
330 | d->d_btimer = 0; | 308 | d->d_btimer = 0; |
331 | } | 309 | } |
332 | } | 310 | } |
333 | 311 | ||
334 | if (!d->d_itimer) { | 312 | if (!d->d_itimer) { |
335 | if ((INT_GET(d->d_ino_softlimit, ARCH_CONVERT) && | 313 | if ((d->d_ino_softlimit && |
336 | (INT_GET(d->d_icount, ARCH_CONVERT) >= | 314 | (be64_to_cpu(d->d_icount) >= |
337 | INT_GET(d->d_ino_softlimit, ARCH_CONVERT))) || | 315 | be64_to_cpu(d->d_ino_softlimit))) || |
338 | (INT_GET(d->d_ino_hardlimit, ARCH_CONVERT) && | 316 | (d->d_ino_hardlimit && |
339 | (INT_GET(d->d_icount, ARCH_CONVERT) >= | 317 | (be64_to_cpu(d->d_icount) >= |
340 | INT_GET(d->d_ino_hardlimit, ARCH_CONVERT)))) { | 318 | be64_to_cpu(d->d_ino_hardlimit)))) { |
341 | INT_SET(d->d_itimer, ARCH_CONVERT, | 319 | d->d_itimer = cpu_to_be32(get_seconds() + |
342 | get_seconds() + XFS_QI_ITIMELIMIT(mp)); | 320 | XFS_QI_ITIMELIMIT(mp)); |
343 | } else { | 321 | } else { |
344 | d->d_iwarns = 0; | 322 | d->d_iwarns = 0; |
345 | } | 323 | } |
346 | } else { | 324 | } else { |
347 | if ((!d->d_ino_softlimit || | 325 | if ((!d->d_ino_softlimit || |
348 | (INT_GET(d->d_icount, ARCH_CONVERT) < | 326 | (be64_to_cpu(d->d_icount) < |
349 | INT_GET(d->d_ino_softlimit, ARCH_CONVERT))) && | 327 | be64_to_cpu(d->d_ino_softlimit))) && |
350 | (!d->d_ino_hardlimit || | 328 | (!d->d_ino_hardlimit || |
351 | (INT_GET(d->d_icount, ARCH_CONVERT) < | 329 | (be64_to_cpu(d->d_icount) < |
352 | INT_GET(d->d_ino_hardlimit, ARCH_CONVERT)))) { | 330 | be64_to_cpu(d->d_ino_hardlimit)))) { |
353 | d->d_itimer = 0; | 331 | d->d_itimer = 0; |
354 | } | 332 | } |
355 | } | 333 | } |
356 | 334 | ||
357 | if (!d->d_rtbtimer) { | 335 | if (!d->d_rtbtimer) { |
358 | if ((INT_GET(d->d_rtb_softlimit, ARCH_CONVERT) && | 336 | if ((d->d_rtb_softlimit && |
359 | (INT_GET(d->d_rtbcount, ARCH_CONVERT) >= | 337 | (be64_to_cpu(d->d_rtbcount) >= |
360 | INT_GET(d->d_rtb_softlimit, ARCH_CONVERT))) || | 338 | be64_to_cpu(d->d_rtb_softlimit))) || |
361 | (INT_GET(d->d_rtb_hardlimit, ARCH_CONVERT) && | 339 | (d->d_rtb_hardlimit && |
362 | (INT_GET(d->d_rtbcount, ARCH_CONVERT) >= | 340 | (be64_to_cpu(d->d_rtbcount) >= |
363 | INT_GET(d->d_rtb_hardlimit, ARCH_CONVERT)))) { | 341 | be64_to_cpu(d->d_rtb_hardlimit)))) { |
364 | INT_SET(d->d_rtbtimer, ARCH_CONVERT, | 342 | d->d_rtbtimer = cpu_to_be32(get_seconds() + |
365 | get_seconds() + XFS_QI_RTBTIMELIMIT(mp)); | 343 | XFS_QI_RTBTIMELIMIT(mp)); |
366 | } else { | 344 | } else { |
367 | d->d_rtbwarns = 0; | 345 | d->d_rtbwarns = 0; |
368 | } | 346 | } |
369 | } else { | 347 | } else { |
370 | if ((!d->d_rtb_softlimit || | 348 | if ((!d->d_rtb_softlimit || |
371 | (INT_GET(d->d_rtbcount, ARCH_CONVERT) < | 349 | (be64_to_cpu(d->d_rtbcount) < |
372 | INT_GET(d->d_rtb_softlimit, ARCH_CONVERT))) && | 350 | be64_to_cpu(d->d_rtb_softlimit))) && |
373 | (!d->d_rtb_hardlimit || | 351 | (!d->d_rtb_hardlimit || |
374 | (INT_GET(d->d_rtbcount, ARCH_CONVERT) < | 352 | (be64_to_cpu(d->d_rtbcount) < |
375 | INT_GET(d->d_rtb_hardlimit, ARCH_CONVERT)))) { | 353 | be64_to_cpu(d->d_rtb_hardlimit)))) { |
376 | d->d_rtbtimer = 0; | 354 | d->d_rtbtimer = 0; |
377 | } | 355 | } |
378 | } | 356 | } |
@@ -490,7 +468,7 @@ xfs_qm_dqalloc( | |||
490 | * Make a chunk of dquots out of this buffer and log | 468 | * Make a chunk of dquots out of this buffer and log |
491 | * the entire thing. | 469 | * the entire thing. |
492 | */ | 470 | */ |
493 | xfs_qm_init_dquot_blk(tp, mp, INT_GET(dqp->q_core.d_id, ARCH_CONVERT), | 471 | xfs_qm_init_dquot_blk(tp, mp, be32_to_cpu(dqp->q_core.d_id), |
494 | dqp->dq_flags & XFS_DQ_ALLTYPES, bp); | 472 | dqp->dq_flags & XFS_DQ_ALLTYPES, bp); |
495 | 473 | ||
496 | /* | 474 | /* |
@@ -554,7 +532,7 @@ xfs_qm_dqtobp( | |||
554 | xfs_trans_t *tp = (tpp ? *tpp : NULL); | 532 | xfs_trans_t *tp = (tpp ? *tpp : NULL); |
555 | 533 | ||
556 | mp = dqp->q_mount; | 534 | mp = dqp->q_mount; |
557 | id = INT_GET(dqp->q_core.d_id, ARCH_CONVERT); | 535 | id = be32_to_cpu(dqp->q_core.d_id); |
558 | nmaps = 1; | 536 | nmaps = 1; |
559 | newdquot = B_FALSE; | 537 | newdquot = B_FALSE; |
560 | 538 | ||
@@ -563,8 +541,7 @@ xfs_qm_dqtobp( | |||
563 | */ | 541 | */ |
564 | if (dqp->q_blkno == (xfs_daddr_t) 0) { | 542 | if (dqp->q_blkno == (xfs_daddr_t) 0) { |
565 | /* We use the id as an index */ | 543 | /* We use the id as an index */ |
566 | dqp->q_fileoffset = (xfs_fileoff_t) ((uint)id / | 544 | dqp->q_fileoffset = (xfs_fileoff_t)id / XFS_QM_DQPERBLK(mp); |
567 | XFS_QM_DQPERBLK(mp)); | ||
568 | nmaps = 1; | 545 | nmaps = 1; |
569 | quotip = XFS_DQ_TO_QIP(dqp); | 546 | quotip = XFS_DQ_TO_QIP(dqp); |
570 | xfs_ilock(quotip, XFS_ILOCK_SHARED); | 547 | xfs_ilock(quotip, XFS_ILOCK_SHARED); |
@@ -694,16 +671,16 @@ xfs_qm_dqread( | |||
694 | 671 | ||
695 | /* copy everything from disk dquot to the incore dquot */ | 672 | /* copy everything from disk dquot to the incore dquot */ |
696 | memcpy(&dqp->q_core, ddqp, sizeof(xfs_disk_dquot_t)); | 673 | memcpy(&dqp->q_core, ddqp, sizeof(xfs_disk_dquot_t)); |
697 | ASSERT(INT_GET(dqp->q_core.d_id, ARCH_CONVERT) == id); | 674 | ASSERT(be32_to_cpu(dqp->q_core.d_id) == id); |
698 | xfs_qm_dquot_logitem_init(dqp); | 675 | xfs_qm_dquot_logitem_init(dqp); |
699 | 676 | ||
700 | /* | 677 | /* |
701 | * Reservation counters are defined as reservation plus current usage | 678 | * Reservation counters are defined as reservation plus current usage |
702 | * to avoid having to add everytime. | 679 | * to avoid having to add everytime. |
703 | */ | 680 | */ |
704 | dqp->q_res_bcount = INT_GET(ddqp->d_bcount, ARCH_CONVERT); | 681 | dqp->q_res_bcount = be64_to_cpu(ddqp->d_bcount); |
705 | dqp->q_res_icount = INT_GET(ddqp->d_icount, ARCH_CONVERT); | 682 | dqp->q_res_icount = be64_to_cpu(ddqp->d_icount); |
706 | dqp->q_res_rtbcount = INT_GET(ddqp->d_rtbcount, ARCH_CONVERT); | 683 | dqp->q_res_rtbcount = be64_to_cpu(ddqp->d_rtbcount); |
707 | 684 | ||
708 | /* Mark the buf so that this will stay incore a little longer */ | 685 | /* Mark the buf so that this will stay incore a little longer */ |
709 | XFS_BUF_SET_VTYPE_REF(bp, B_FS_DQUOT, XFS_DQUOT_REF); | 686 | XFS_BUF_SET_VTYPE_REF(bp, B_FS_DQUOT, XFS_DQUOT_REF); |
@@ -829,7 +806,7 @@ xfs_qm_dqlookup( | |||
829 | * dqlock to look at the id field of the dquot, since the | 806 | * dqlock to look at the id field of the dquot, since the |
830 | * id can't be modified without the hashlock anyway. | 807 | * id can't be modified without the hashlock anyway. |
831 | */ | 808 | */ |
832 | if (INT_GET(dqp->q_core.d_id, ARCH_CONVERT) == id && dqp->q_mount == mp) { | 809 | if (be32_to_cpu(dqp->q_core.d_id) == id && dqp->q_mount == mp) { |
833 | xfs_dqtrace_entry(dqp, "DQFOUND BY LOOKUP"); | 810 | xfs_dqtrace_entry(dqp, "DQFOUND BY LOOKUP"); |
834 | /* | 811 | /* |
835 | * All in core dquots must be on the dqlist of mp | 812 | * All in core dquots must be on the dqlist of mp |
@@ -860,7 +837,7 @@ xfs_qm_dqlookup( | |||
860 | * id couldn't have changed; we had the hashlock all | 837 | * id couldn't have changed; we had the hashlock all |
861 | * along | 838 | * along |
862 | */ | 839 | */ |
863 | ASSERT(INT_GET(dqp->q_core.d_id, ARCH_CONVERT) == id); | 840 | ASSERT(be32_to_cpu(dqp->q_core.d_id) == id); |
864 | 841 | ||
865 | if (flist_locked) { | 842 | if (flist_locked) { |
866 | if (dqp->q_nrefs != 0) { | 843 | if (dqp->q_nrefs != 0) { |
@@ -1282,7 +1259,7 @@ xfs_qm_dqflush( | |||
1282 | return (error); | 1259 | return (error); |
1283 | } | 1260 | } |
1284 | 1261 | ||
1285 | if (xfs_qm_dqcheck(&dqp->q_core, INT_GET(ddqp->d_id, ARCH_CONVERT), | 1262 | if (xfs_qm_dqcheck(&dqp->q_core, be32_to_cpu(ddqp->d_id), |
1286 | 0, XFS_QMOPT_DOWARN, "dqflush (incore copy)")) { | 1263 | 0, XFS_QMOPT_DOWARN, "dqflush (incore copy)")) { |
1287 | xfs_force_shutdown(dqp->q_mount, XFS_CORRUPT_INCORE); | 1264 | xfs_force_shutdown(dqp->q_mount, XFS_CORRUPT_INCORE); |
1288 | return XFS_ERROR(EIO); | 1265 | return XFS_ERROR(EIO); |
@@ -1435,8 +1412,8 @@ xfs_dqlock2( | |||
1435 | { | 1412 | { |
1436 | if (d1 && d2) { | 1413 | if (d1 && d2) { |
1437 | ASSERT(d1 != d2); | 1414 | ASSERT(d1 != d2); |
1438 | if (INT_GET(d1->q_core.d_id, ARCH_CONVERT) > | 1415 | if (be32_to_cpu(d1->q_core.d_id) > |
1439 | INT_GET(d2->q_core.d_id, ARCH_CONVERT)) { | 1416 | be32_to_cpu(d2->q_core.d_id)) { |
1440 | xfs_dqlock(d2); | 1417 | xfs_dqlock(d2); |
1441 | xfs_dqlock(d1); | 1418 | xfs_dqlock(d1); |
1442 | } else { | 1419 | } else { |
@@ -1558,33 +1535,33 @@ xfs_qm_dqprint(xfs_dquot_t *dqp) | |||
1558 | { | 1535 | { |
1559 | cmn_err(CE_DEBUG, "-----------KERNEL DQUOT----------------"); | 1536 | cmn_err(CE_DEBUG, "-----------KERNEL DQUOT----------------"); |
1560 | cmn_err(CE_DEBUG, "---- dquotID = %d", | 1537 | cmn_err(CE_DEBUG, "---- dquotID = %d", |
1561 | (int)INT_GET(dqp->q_core.d_id, ARCH_CONVERT)); | 1538 | (int)be32_to_cpu(dqp->q_core.d_id)); |
1562 | cmn_err(CE_DEBUG, "---- type = %s", DQFLAGTO_TYPESTR(dqp)); | 1539 | cmn_err(CE_DEBUG, "---- type = %s", DQFLAGTO_TYPESTR(dqp)); |
1563 | cmn_err(CE_DEBUG, "---- fs = 0x%p", dqp->q_mount); | 1540 | cmn_err(CE_DEBUG, "---- fs = 0x%p", dqp->q_mount); |
1564 | cmn_err(CE_DEBUG, "---- blkno = 0x%x", (int) dqp->q_blkno); | 1541 | cmn_err(CE_DEBUG, "---- blkno = 0x%x", (int) dqp->q_blkno); |
1565 | cmn_err(CE_DEBUG, "---- boffset = 0x%x", (int) dqp->q_bufoffset); | 1542 | cmn_err(CE_DEBUG, "---- boffset = 0x%x", (int) dqp->q_bufoffset); |
1566 | cmn_err(CE_DEBUG, "---- blkhlimit = %Lu (0x%x)", | 1543 | cmn_err(CE_DEBUG, "---- blkhlimit = %Lu (0x%x)", |
1567 | INT_GET(dqp->q_core.d_blk_hardlimit, ARCH_CONVERT), | 1544 | be64_to_cpu(dqp->q_core.d_blk_hardlimit), |
1568 | (int) INT_GET(dqp->q_core.d_blk_hardlimit, ARCH_CONVERT)); | 1545 | (int)be64_to_cpu(dqp->q_core.d_blk_hardlimit)); |
1569 | cmn_err(CE_DEBUG, "---- blkslimit = %Lu (0x%x)", | 1546 | cmn_err(CE_DEBUG, "---- blkslimit = %Lu (0x%x)", |
1570 | INT_GET(dqp->q_core.d_blk_softlimit, ARCH_CONVERT), | 1547 | be64_to_cpu(dqp->q_core.d_blk_softlimit), |
1571 | (int)INT_GET(dqp->q_core.d_blk_softlimit, ARCH_CONVERT)); | 1548 | (int)be64_to_cpu(dqp->q_core.d_blk_softlimit)); |
1572 | cmn_err(CE_DEBUG, "---- inohlimit = %Lu (0x%x)", | 1549 | cmn_err(CE_DEBUG, "---- inohlimit = %Lu (0x%x)", |
1573 | INT_GET(dqp->q_core.d_ino_hardlimit, ARCH_CONVERT), | 1550 | be64_to_cpu(dqp->q_core.d_ino_hardlimit), |
1574 | (int)INT_GET(dqp->q_core.d_ino_hardlimit, ARCH_CONVERT)); | 1551 | (int)be64_to_cpu(dqp->q_core.d_ino_hardlimit)); |
1575 | cmn_err(CE_DEBUG, "---- inoslimit = %Lu (0x%x)", | 1552 | cmn_err(CE_DEBUG, "---- inoslimit = %Lu (0x%x)", |
1576 | INT_GET(dqp->q_core.d_ino_softlimit, ARCH_CONVERT), | 1553 | be64_to_cpu(dqp->q_core.d_ino_softlimit), |
1577 | (int)INT_GET(dqp->q_core.d_ino_softlimit, ARCH_CONVERT)); | 1554 | (int)be64_to_cpu(dqp->q_core.d_ino_softlimit)); |
1578 | cmn_err(CE_DEBUG, "---- bcount = %Lu (0x%x)", | 1555 | cmn_err(CE_DEBUG, "---- bcount = %Lu (0x%x)", |
1579 | INT_GET(dqp->q_core.d_bcount, ARCH_CONVERT), | 1556 | be64_to_cpu(dqp->q_core.d_bcount), |
1580 | (int)INT_GET(dqp->q_core.d_bcount, ARCH_CONVERT)); | 1557 | (int)be64_to_cpu(dqp->q_core.d_bcount)); |
1581 | cmn_err(CE_DEBUG, "---- icount = %Lu (0x%x)", | 1558 | cmn_err(CE_DEBUG, "---- icount = %Lu (0x%x)", |
1582 | INT_GET(dqp->q_core.d_icount, ARCH_CONVERT), | 1559 | be64_to_cpu(dqp->q_core.d_icount), |
1583 | (int)INT_GET(dqp->q_core.d_icount, ARCH_CONVERT)); | 1560 | (int)be64_to_cpu(dqp->q_core.d_icount)); |
1584 | cmn_err(CE_DEBUG, "---- btimer = %d", | 1561 | cmn_err(CE_DEBUG, "---- btimer = %d", |
1585 | (int)INT_GET(dqp->q_core.d_btimer, ARCH_CONVERT)); | 1562 | (int)be32_to_cpu(dqp->q_core.d_btimer)); |
1586 | cmn_err(CE_DEBUG, "---- itimer = %d", | 1563 | cmn_err(CE_DEBUG, "---- itimer = %d", |
1587 | (int)INT_GET(dqp->q_core.d_itimer, ARCH_CONVERT)); | 1564 | (int)be32_to_cpu(dqp->q_core.d_itimer)); |
1588 | cmn_err(CE_DEBUG, "---------------------------"); | 1565 | cmn_err(CE_DEBUG, "---------------------------"); |
1589 | } | 1566 | } |
1590 | #endif | 1567 | #endif |