57 #include <linux/slab.h>
58 #include <linux/string.h>
60 #include <linux/xattr.h>
77 u64 *next_block,
int *next_offset,
u64 index_start,
78 int index_offset,
int i_count,
const char *
name,
86 TRACE(
"Entered get_dir_index_using_name, i_count %d\n", i_count);
90 ERROR(
"Failed to allocate squashfs_dir_index\n");
98 for (i = 0; i < i_count; i++) {
100 &index_offset,
sizeof(*index));
108 &index_offset, size);
139 const unsigned char *name = dentry->
d_name.name;
140 int len = dentry->
d_name.len;
149 TRACE(
"Entered squashfs_lookup [%llx:%x]\n", block, offset);
153 ERROR(
"Failed to allocate squashfs_dir_entry\n");
162 length = get_dir_index_using_name(dir->
i_sb, &block, &offset,
163 squashfs_i(dir)->dir_idx_start,
164 squashfs_i(dir)->dir_idx_offset,
165 squashfs_i(dir)->dir_idx_cnt, name, len);
167 while (length < i_size_read(dir)) {
172 &offset,
sizeof(dirh));
176 length +=
sizeof(dirh);
183 while (dir_count--) {
188 &offset,
sizeof(*dire));
199 &block, &offset, size);
203 length +=
sizeof(*dire) +
size;
205 if (name[0] < dire->
name[0])
208 if (len == size && !
strncmp(name, dire->
name, len)) {
209 unsigned int blk, off, ino_num;
217 TRACE(
"calling squashfs_iget for directory "
218 "entry %s, inode %x:%x, %d\n", name,
235 ERROR(
"Unable to read directory block [%llx:%x]\n",
237 squashfs_i(dir)->offset);
245 .lookup = squashfs_lookup,