Commit a2ea8116 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] ufs endianness bugfixes

missing conversions from on-disk to host-endian in a couple of places...
Signed-off-by: default avatarAl Viro <viro@parcelfarce.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c20f2b96
...@@ -412,7 +412,7 @@ ufs_add_fragments (struct inode * inode, unsigned fragment, ...@@ -412,7 +412,7 @@ ufs_add_fragments (struct inode * inode, unsigned fragment,
count = newcount - oldcount; count = newcount - oldcount;
cgno = ufs_dtog(fragment); 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; return 0;
if ((ufs_fragnum (fragment) + newcount) > uspi->s_fpb) if ((ufs_fragnum (fragment) + newcount) > uspi->s_fpb)
return 0; return 0;
......
...@@ -1129,7 +1129,7 @@ static int ufs_statfs (struct super_block *sb, struct kstatfs *buf) ...@@ -1129,7 +1129,7 @@ static int ufs_statfs (struct super_block *sb, struct kstatfs *buf)
flags = UFS_SB(sb)->s_flags; flags = UFS_SB(sb)->s_flags;
if ((flags & UFS_TYPE_MASK) == UFS_TYPE_UFS2) { if ((flags & UFS_TYPE_MASK) == UFS_TYPE_UFS2) {
buf->f_type = UFS2_MAGIC; 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)) + 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); fs64_to_cpu(sb, usb->fs_u11.fs_u2.fs_cstotal.cs_nffree);
buf->f_ffree = fs64_to_cpu(sb, buf->f_ffree = fs64_to_cpu(sb,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment