VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Steven Whitehouse <swhiteho@redhat.com> 2006-03-30 15:46:23 -0500 committer: Steven Whitehouse <swhiteho@redhat.com> 2006-03-30 15:46:23 -0500 commit: e3167ded1f1b16424bc14d5673cdc5414f179970 parent: cd45697f0ddbb58f3f83c29fe164713ee7765e21
Commit Summary:
[GFS] Fix bug in endian conversion for metadata header
Diffstat:
1 file changed, 3 insertions, 4 deletions
diff --git a/fs/gfs2/util.h b/fs/gfs2/util.h
index addbe304993e..4532dbab0a2c 100644
--- a/fs/gfs2/util.h
+++ b/fs/gfs2/util.h
@@ -107,12 +107,11 @@ static inline int gfs2_metatype_check_i(struct gfs2_sbd *sdp,
 {
 	struct gfs2_meta_header *mh = (struct gfs2_meta_header *)bh->b_data;
 	uint32_t magic = mh->mh_magic;
-	uint16_t t = mh->mh_type;
+	uint16_t t = be32_to_cpu(mh->mh_type);
 	magic = be32_to_cpu(magic);
 	if (unlikely(magic != GFS2_MAGIC))
 		return gfs2_meta_check_ii(sdp, bh, "magic number", function,
 					  file, line);
-	t = be16_to_cpu(t);
         if (unlikely(t != type))
 		return gfs2_metatype_check_ii(sdp, bh, type, t, function,
 					      file, line);
@@ -127,8 +126,8 @@ static inline void gfs2_metatype_set(struct buffer_head *bh, uint16_t type,
 {
 	struct gfs2_meta_header *mh;
 	mh = (struct gfs2_meta_header *)bh->b_data;
-	mh->mh_type = cpu_to_be16(type);
-	mh->mh_format = cpu_to_be16(format);
+	mh->mh_type = cpu_to_be32(type);
+	mh->mh_format = cpu_to_be32(format);
 }