]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
[XFS] All xfs_disk_dquot_t values are (as the name says) disk endian.
authorChristoph Hellwig <hch@lst.de>
Fri, 28 Jul 2006 07:04:26 +0000 (17:04 +1000)
committerNathan Scott <nathans@sgi.com>
Fri, 28 Jul 2006 07:04:26 +0000 (17:04 +1000)
Before putting them into struct statfs they should be endian-swapped.

SGI-PV: 954580
SGI-Modid: xfs-linux-melb:xfs-kern:26550a

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nathan Scott <nathans@sgi.com>
fs/xfs/quota/xfs_qm_bhv.c

index e95e99f7168fdb78f6f7b724fbc66a5acdf35aef..f137856c3261b3ebabf84345aa492c0897d3c932 100644 (file)
@@ -217,17 +217,24 @@ xfs_qm_statvfs(
                return 0;
        dp = &dqp->q_core;
 
-       limit = dp->d_blk_softlimit ? dp->d_blk_softlimit : dp->d_blk_hardlimit;
+       limit = dp->d_blk_softlimit ?
+               be64_to_cpu(dp->d_blk_softlimit) :
+               be64_to_cpu(dp->d_blk_hardlimit);
        if (limit && statp->f_blocks > limit) {
                statp->f_blocks = limit;
-               statp->f_bfree = (statp->f_blocks > dp->d_bcount) ?
-                                       (statp->f_blocks - dp->d_bcount) : 0;
+               statp->f_bfree =
+                       (statp->f_blocks > be64_to_cpu(dp->d_bcount)) ?
+                        (statp->f_blocks - be64_to_cpu(dp->d_bcount)) : 0;
        }
-       limit = dp->d_ino_softlimit ? dp->d_ino_softlimit : dp->d_ino_hardlimit;
+
+       limit = dp->d_ino_softlimit ?
+               be64_to_cpu(dp->d_ino_softlimit) :
+               be64_to_cpu(dp->d_ino_hardlimit);
        if (limit && statp->f_files > limit) {
                statp->f_files = limit;
-               statp->f_ffree = (statp->f_files > dp->d_icount) ?
-                                       (statp->f_ffree - dp->d_icount) : 0;
+               statp->f_ffree =
+                       (statp->f_files > be64_to_cpu(dp->d_icount)) ?
+                        (statp->f_ffree - be64_to_cpu(dp->d_icount)) : 0;
        }
 
        xfs_qm_dqput(dqp);