BUG_ON(buf == NULL);
- switch(be16_to_cpu(h->mh_type)) {
+ switch(be32_to_cpu(h->mh_type)) {
case GFS2_METATYPE_LF:
offset = sizeof(struct gfs2_leaf);
break;
return offset;
wrong_type:
printk(KERN_WARNING "gfs2_scan_dirent: wrong block type %u\n",
- be16_to_cpu(h->mh_type));
+ be32_to_cpu(h->mh_type));
return -1;
}
{
struct gfs2_meta_header *h = (struct gfs2_meta_header *)bh->b_data;
- if (be16_to_cpu(h->mh_type) == GFS2_METATYPE_LF) {
+ if (be32_to_cpu(h->mh_type) == GFS2_METATYPE_LF) {
if (gfs2_meta_check(dip->i_sbd, bh))
return -EIO;
*dent = (struct gfs2_dirent *)(bh->b_data +
lh = (struct gfs2_log_header *)bh->b_data;
memset(lh, 0, sizeof(struct gfs2_log_header));
lh->lh_header.mh_magic = cpu_to_be32(GFS2_MAGIC);
- lh->lh_header.mh_type = cpu_to_be16(GFS2_METATYPE_LH);
- lh->lh_header.mh_format = cpu_to_be16(GFS2_FORMAT_LH);
+ lh->lh_header.mh_type = cpu_to_be32(GFS2_METATYPE_LH);
+ lh->lh_header.mh_format = cpu_to_be32(GFS2_FORMAT_LH);
lh->lh_sequence = be64_to_cpu(sdp->sd_log_sequence++);
lh->lh_flags = be32_to_cpu(flags);
lh->lh_tail = be32_to_cpu(tail);
ld = (struct gfs2_log_descriptor *)bh->b_data;
ptr = (__be64 *)(bh->b_data + offset);
ld->ld_header.mh_magic = cpu_to_be32(GFS2_MAGIC);
- ld->ld_header.mh_type = cpu_to_be16(GFS2_METATYPE_LD);
- ld->ld_header.mh_format = cpu_to_be16(GFS2_FORMAT_LD);
+ ld->ld_header.mh_type = cpu_to_be32(GFS2_METATYPE_LD);
+ ld->ld_header.mh_format = cpu_to_be32(GFS2_FORMAT_LD);
ld->ld_type = cpu_to_be32(GFS2_LOG_DESC_METADATA);
ld->ld_length = cpu_to_be32(num + 1);
ld->ld_data1 = cpu_to_be32(num);
bh = gfs2_log_get_buf(sdp);
ld = (struct gfs2_log_descriptor *)bh->b_data;
ld->ld_header.mh_magic = cpu_to_be32(GFS2_MAGIC);
- ld->ld_header.mh_type = cpu_to_be16(GFS2_METATYPE_LD);
- ld->ld_header.mh_format = cpu_to_be16(GFS2_FORMAT_LD);
+ ld->ld_header.mh_type = cpu_to_be32(GFS2_METATYPE_LD);
+ ld->ld_header.mh_format = cpu_to_be32(GFS2_FORMAT_LD);
ld->ld_type = cpu_to_be32(GFS2_LOG_DESC_REVOKE);
ld->ld_length = cpu_to_be32(gfs2_struct2blk(sdp, sdp->sd_log_num_revoke,
sizeof(uint64_t)));
bh = gfs2_log_get_buf(sdp);
mh = (struct gfs2_meta_header *)bh->b_data;
mh->mh_magic = cpu_to_be32(GFS2_MAGIC);
- mh->mh_type = cpu_to_be16(GFS2_METATYPE_LB);
- mh->mh_format = cpu_to_be16(GFS2_FORMAT_LB);
+ mh->mh_type = cpu_to_be32(GFS2_METATYPE_LB);
+ mh->mh_format = cpu_to_be32(GFS2_FORMAT_LB);
offset = sizeof(struct gfs2_meta_header);
}
ld->ld_header.mh_magic =
cpu_to_be32(GFS2_MAGIC);
ld->ld_header.mh_type =
- cpu_to_be16(GFS2_METATYPE_LD);
+ cpu_to_be32(GFS2_METATYPE_LD);
ld->ld_header.mh_format =
- cpu_to_be16(GFS2_FORMAT_LD);
+ cpu_to_be32(GFS2_FORMAT_LD);
ld->ld_type =
cpu_to_be32(GFS2_LOG_DESC_JDATA);
ld->ld_length = cpu_to_be32(num + 1);
struct gfs2_meta_header *str = (struct gfs2_meta_header *)buf;
mh->mh_magic = be32_to_cpu(str->mh_magic);
- mh->mh_type = be16_to_cpu(str->mh_type);
- mh->mh_format = be16_to_cpu(str->mh_format);
+ mh->mh_type = be32_to_cpu(str->mh_type);
+ mh->mh_format = be32_to_cpu(str->mh_format);
}
static void gfs2_meta_header_out(struct gfs2_meta_header *mh, char *buf)
struct gfs2_meta_header *str = (struct gfs2_meta_header *)buf;
str->mh_magic = cpu_to_be32(mh->mh_magic);
- str->mh_type = cpu_to_be16(mh->mh_type);
- str->mh_format = cpu_to_be16(mh->mh_format);
+ str->mh_type = cpu_to_be32(mh->mh_type);
+ str->mh_format = cpu_to_be32(mh->mh_format);
}
void gfs2_meta_header_print(struct gfs2_meta_header *mh)
ld = (struct gfs2_log_descriptor *)bh->b_data;
length = be32_to_cpu(ld->ld_length);
- if (be16_to_cpu(ld->ld_header.mh_type) == GFS2_METATYPE_LH) {
+ if (be32_to_cpu(ld->ld_header.mh_type) == GFS2_METATYPE_LH) {
struct gfs2_log_header lh;
error = get_log_header(jd, start, &lh);
if (!error) {
memset(lh, 0, sizeof(struct gfs2_log_header));
lh->lh_header.mh_magic = cpu_to_be32(GFS2_MAGIC);
lh->lh_header.mh_type = cpu_to_be16(GFS2_METATYPE_LH);
- lh->lh_header.mh_format = cpu_to_be16(GFS2_FORMAT_LH);
+ lh->lh_header.mh_format = cpu_to_be32(GFS2_FORMAT_LH);
lh->lh_sequence = cpu_to_be64(head->lh_sequence + 1);
lh->lh_flags = cpu_to_be32(GFS2_LOG_HEAD_UNMOUNT);
lh->lh_blkno = cpu_to_be32(lblock);
{
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);
{
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);
}