aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/ext2fs/ext2_balloc.c
diff options
context:
space:
mode:
authorFedor Uporov <fsu@FreeBSD.org>2020-05-17 14:52:54 +0000
committerFedor Uporov <fsu@FreeBSD.org>2020-05-17 14:52:54 +0000
commitcd3acfe7f372a8cbee8ef8f32aa896ce926154ee (patch)
treebbd092716cee98e511b8231556c300aa676acd90 /sys/fs/ext2fs/ext2_balloc.c
parent4bd6d63dc5e89f1165b3c4403b019bab953d9fe0 (diff)
downloadsrc-cd3acfe7f372a8cbee8ef8f32aa896ce926154ee.tar.gz
src-cd3acfe7f372a8cbee8ef8f32aa896ce926154ee.zip
Add BE architectures support.
Author of most initial version: pfg (https://reviews.freebsd.org/D23259) Reviewed by: pfg MFC after: 3 months Differential Revision: https://reviews.freebsd.org/D24685
Notes
Notes: svn path=/head/; revision=361136
Diffstat (limited to 'sys/fs/ext2fs/ext2_balloc.c')
-rw-r--r--sys/fs/ext2fs/ext2_balloc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/fs/ext2fs/ext2_balloc.c b/sys/fs/ext2fs/ext2_balloc.c
index db8f20eb6db0..b2c97181c8f1 100644
--- a/sys/fs/ext2fs/ext2_balloc.c
+++ b/sys/fs/ext2fs/ext2_balloc.c
@@ -40,6 +40,7 @@
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/endian.h>
#include <sys/bio.h>
#include <sys/buf.h>
#include <sys/limits.h>
@@ -220,7 +221,7 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t lbn, int size, struct ucred *cred,
return (error);
}
bap = (e2fs_daddr_t *)bp->b_data;
- nb = bap[indirs[i].in_off];
+ nb = le32toh(bap[indirs[i].in_off]);
if (i == num)
break;
i += 1;
@@ -252,7 +253,7 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t lbn, int size, struct ucred *cred,
brelse(bp);
return (error);
}
- bap[indirs[i - 1].in_off] = nb;
+ bap[indirs[i - 1].in_off] = htole32(nb);
/*
* If required, write synchronously, otherwise use
* delayed write.
@@ -284,7 +285,7 @@ ext2_balloc(struct inode *ip, e2fs_lbn_t lbn, int size, struct ucred *cred,
nbp->b_blkno = fsbtodb(fs, nb);
if (flags & BA_CLRBUF)
vfs_bio_clrbuf(nbp);
- bap[indirs[i].in_off] = nb;
+ bap[indirs[i].in_off] = htole32(nb);
/*
* If required, write synchronously, otherwise use
* delayed write.