extents.c (efdcd41b4e41560375bb34ad8b095bcaa1c3a93f) extents.c (395a87bfefbc400011417e9eaae33169f9f036c0)
1/*
2 * Copyright (c) 2003-2006, Cluster File Systems, Inc, info@clusterfs.com
3 * Written by Alex Tomas <alex@clusterfs.com>
4 *
5 * Architecture independence:
6 * Copyright (c) 2005, Bull S.A.
7 * Written by Pierre Peiffer <pierre.peiffer@bull.net>
8 *

--- 1108 unchanged lines hidden (view full) ---

1117ext4_ext_search_right(struct inode *inode, struct ext4_ext_path *path,
1118 ext4_lblk_t *logical, ext4_fsblk_t *phys)
1119{
1120 struct buffer_head *bh = NULL;
1121 struct ext4_extent_header *eh;
1122 struct ext4_extent_idx *ix;
1123 struct ext4_extent *ex;
1124 ext4_fsblk_t block;
1/*
2 * Copyright (c) 2003-2006, Cluster File Systems, Inc, info@clusterfs.com
3 * Written by Alex Tomas <alex@clusterfs.com>
4 *
5 * Architecture independence:
6 * Copyright (c) 2005, Bull S.A.
7 * Written by Pierre Peiffer <pierre.peiffer@bull.net>
8 *

--- 1108 unchanged lines hidden (view full) ---

1117ext4_ext_search_right(struct inode *inode, struct ext4_ext_path *path,
1118 ext4_lblk_t *logical, ext4_fsblk_t *phys)
1119{
1120 struct buffer_head *bh = NULL;
1121 struct ext4_extent_header *eh;
1122 struct ext4_extent_idx *ix;
1123 struct ext4_extent *ex;
1124 ext4_fsblk_t block;
1125 int depth, ee_len;
1125 int depth; /* Note, NOT eh_depth; depth from top of tree */
1126 int ee_len;
1126
1127 BUG_ON(path == NULL);
1128 depth = path->p_depth;
1129 *phys = 0;
1130
1131 if (depth == 0 && path->p_ext == NULL)
1132 return 0;
1133

--- 40 unchanged lines hidden (view full) ---

1174 * block to the right */
1175 ix++;
1176 block = idx_pblock(ix);
1177 while (++depth < path->p_depth) {
1178 bh = sb_bread(inode->i_sb, block);
1179 if (bh == NULL)
1180 return -EIO;
1181 eh = ext_block_hdr(bh);
1127
1128 BUG_ON(path == NULL);
1129 depth = path->p_depth;
1130 *phys = 0;
1131
1132 if (depth == 0 && path->p_ext == NULL)
1133 return 0;
1134

--- 40 unchanged lines hidden (view full) ---

1175 * block to the right */
1176 ix++;
1177 block = idx_pblock(ix);
1178 while (++depth < path->p_depth) {
1179 bh = sb_bread(inode->i_sb, block);
1180 if (bh == NULL)
1181 return -EIO;
1182 eh = ext_block_hdr(bh);
1182 if (ext4_ext_check_header(inode, eh, depth)) {
1183 /* subtract from p_depth to get proper eh_depth */
1184 if (ext4_ext_check_header(inode, eh, path->p_depth - depth)) {
1183 put_bh(bh);
1184 return -EIO;
1185 }
1186 ix = EXT_FIRST_INDEX(eh);
1187 block = idx_pblock(ix);
1188 put_bh(bh);
1189 }
1190

--- 2029 unchanged lines hidden ---
1185 put_bh(bh);
1186 return -EIO;
1187 }
1188 ix = EXT_FIRST_INDEX(eh);
1189 block = idx_pblock(ix);
1190 put_bh(bh);
1191 }
1192

--- 2029 unchanged lines hidden ---