]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ufs endianness bugfixes
authorAlexander Viro <viro@www.linux.org.uk>
Wed, 6 Oct 2004 00:54:38 +0000 (17:54 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 6 Oct 2004 00:54:38 +0000 (17:54 -0700)
missing conversions from on-disk to host-endian in a couple of places...

Signed-off-by: Al Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/ufs/balloc.c
fs/ufs/super.c

index 66bf176f6a6069d9d1832a825e0ad3b7d43b184c..9195c9dfa8030757f922cfebf028ea7cd06284fd 100644 (file)
@@ -412,7 +412,7 @@ ufs_add_fragments (struct inode * inode, unsigned fragment,
        count = newcount - oldcount;
        
        cgno = ufs_dtog(fragment);
-       if (UFS_SB(sb)->fs_cs(cgno).cs_nffree < count)
+       if (fs32_to_cpu(sb, UFS_SB(sb)->fs_cs(cgno).cs_nffree) < count)
                return 0;
        if ((ufs_fragnum (fragment) + newcount) > uspi->s_fpb)
                return 0;
index ce845e872faf45b1e743e97f580b705e013ffe56..4ff38a0ab44a5b385d2ecf86db966360b611498c 100644 (file)
@@ -1129,7 +1129,7 @@ static int ufs_statfs (struct super_block *sb, struct kstatfs *buf)
        flags = UFS_SB(sb)->s_flags;
        if ((flags & UFS_TYPE_MASK) == UFS_TYPE_UFS2) {
                buf->f_type = UFS2_MAGIC;
-               buf->f_blocks = usb->fs_u11.fs_u2.fs_dsize;
+               buf->f_blocks = fs64_to_cpu(sb, usb->fs_u11.fs_u2.fs_dsize);
                buf->f_bfree = ufs_blkstofrags(fs64_to_cpu(sb, usb->fs_u11.fs_u2.fs_cstotal.cs_nbfree)) +
                        fs64_to_cpu(sb, usb->fs_u11.fs_u2.fs_cstotal.cs_nffree);
                buf->f_ffree = fs64_to_cpu(sb,