{
struct gfs2_dirent *tmp, *cur;
char *bh_end;
- uint32_t cur_rec_len;
+ uint16_t cur_rec_len;
cur = *dent;
bh_end = bh->b_data + bh->b_size;
- cur_rec_len = be32_to_cpu(cur->de_rec_len);
+ cur_rec_len = be16_to_cpu(cur->de_rec_len);
if ((char *)cur + cur_rec_len >= bh_end) {
if ((char *)cur + cur_rec_len > bh_end) {
tmp = (struct gfs2_dirent *)((char *)cur + cur_rec_len);
- if ((char *)tmp + be32_to_cpu(tmp->de_rec_len) > bh_end) {
+ if ((char *)tmp + be16_to_cpu(tmp->de_rec_len) > bh_end) {
gfs2_consist_inode(dip);
return -EIO;
}
static void dirent_del(struct gfs2_inode *dip, struct buffer_head *bh,
struct gfs2_dirent *prev, struct gfs2_dirent *cur)
{
- uint32_t cur_rec_len, prev_rec_len;
+ uint16_t cur_rec_len, prev_rec_len;
if (!cur->de_inum.no_addr) {
gfs2_consist_inode(dip);
/* Combine this dentry with the previous one. */
- prev_rec_len = be32_to_cpu(prev->de_rec_len);
- cur_rec_len = be32_to_cpu(cur->de_rec_len);
+ prev_rec_len = be16_to_cpu(prev->de_rec_len);
+ cur_rec_len = be16_to_cpu(cur->de_rec_len);
if ((char *)prev + prev_rec_len != (char *)cur)
gfs2_consist_inode(dip);
gfs2_consist_inode(dip);
prev_rec_len += cur_rec_len;
- prev->de_rec_len = cpu_to_be32(prev_rec_len);
+ prev->de_rec_len = cpu_to_be16(prev_rec_len);
}
/**
gfs2_trans_add_bh(dip->i_gl, bh, 1);
dent->de_rec_len = bh->b_size - offset;
- dent->de_rec_len = cpu_to_be32(dent->de_rec_len);
+ dent->de_rec_len = cpu_to_be16(dent->de_rec_len);
dent->de_name_len = name_len;
*dent_out = dent;
}
do {
- uint32_t cur_rec_len, cur_name_len;
+ uint16_t cur_rec_len;
+ uint32_t cur_name_len;
- cur_rec_len = be32_to_cpu(dent->de_rec_len);
+ cur_rec_len = be16_to_cpu(dent->de_rec_len);
cur_name_len = dent->de_name_len;
if ((!dent->de_inum.no_addr && cur_rec_len >= rec_len) ||
memset(new, 0, sizeof(struct gfs2_dirent));
new->de_rec_len = cur_rec_len - GFS2_DIRENT_SIZE(cur_name_len);
- new->de_rec_len = cpu_to_be32(new->de_rec_len);
+ new->de_rec_len = cpu_to_be16(new->de_rec_len);
new->de_name_len = name_len;
- dent->de_rec_len = cur_rec_len - be32_to_cpu(new->de_rec_len);
- dent->de_rec_len = cpu_to_be32(dent->de_rec_len);
+ dent->de_rec_len = cur_rec_len - be16_to_cpu(new->de_rec_len);
+ dent->de_rec_len = cpu_to_be16(dent->de_rec_len);
*dent_out = new;
return 0;
return 1;
do {
- uint32_t cur_rec_len, cur_name_len;
+ uint16_t cur_rec_len;
+ uint32_t cur_name_len;
- cur_rec_len = be32_to_cpu(dent->de_rec_len);
+ cur_rec_len = be16_to_cpu(dent->de_rec_len);
cur_name_len = dent->de_name_len;
if ((!dent->de_inum.no_addr && cur_rec_len >= rec_len) ||
/* Adjust the last dirent's record length
(Remember that dent still points to the last entry.) */
- dent->de_rec_len = be32_to_cpu(dent->de_rec_len) +
+ dent->de_rec_len = be16_to_cpu(dent->de_rec_len) +
sizeof(struct gfs2_dinode) -
sizeof(struct gfs2_leaf);
- dent->de_rec_len = cpu_to_be32(dent->de_rec_len);
+ dent->de_rec_len = cpu_to_be16(dent->de_rec_len);
brelse(bh);
/*
- * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
- * Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
- *
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU General Public License v.2.
- */
+* Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
+* Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
+*
+* This copyrighted material is made available to anyone wishing to use,
+* modify, copy, or redistribute it subject to the terms and conditions
+* of the GNU General Public License v.2.
+*/
#ifndef __GFS2_ONDISK_DOT_H__
#define __GFS2_ONDISK_DOT_H__
#define GFS2_FORMAT_LH 800
#define GFS2_FORMAT_LD 900
#define GFS2_FORMAT_LB 1000
-#define GFS2_FORMAT_EA 1100
-#define GFS2_FORMAT_ED 1200
+#define GFS2_FORMAT_EA 1600
+#define GFS2_FORMAT_ED 1700
#define GFS2_FORMAT_UT 1300
#define GFS2_FORMAT_QC 1400
/* These are format numbers for entities contained in files */
-#define GFS2_FORMAT_RI 1500
-#define GFS2_FORMAT_DE 1600
-#define GFS2_FORMAT_QU 1700
+#define GFS2_FORMAT_RI 1100
+#define GFS2_FORMAT_DE 1200
+#define GFS2_FORMAT_QU 1500
/* These are part of the superblock */
#define GFS2_FORMAT_FS 1801
#define GFS2_FORMAT_MULTI 1900
#define GFS2_METATYPE_JD 7
#define GFS2_METATYPE_LH 8
#define GFS2_METATYPE_LD 9
-#define GFS2_METATYPE_LB 10
-#define GFS2_METATYPE_EA 11
-#define GFS2_METATYPE_ED 12
+#define GFS2_METATYPE_LB 12
+#define GFS2_METATYPE_EA 10
+#define GFS2_METATYPE_ED 11
#define GFS2_METATYPE_UT 13
#define GFS2_METATYPE_QC 14
__be64 qu_limit;
__be64 qu_warn;
__be64 qu_value;
+ __u8 qu_reserved[64];
};
/*
struct gfs2_dirent {
struct gfs2_inum de_inum;
__be32 de_hash;
- __be32 de_rec_len;
- __u8 de_name_len;
- __u8 de_type;
- __u16 __pad1;
- __u32 __pad2;
+ __be16 de_rec_len;
+ __be16 de_name_len;
+ __be16 de_type;
+ __u8 __pad[14];
};
/*
__be32 lf_dirent_format; /* Format of the dirents */
__be64 lf_next; /* Next leaf, if overflow */
- __u8 lf_reserved[32];
+ __u8 lf_reserved[64];
};
/*