Lines Matching +full:lookup +full:- +full:table

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Squashfs - a compressed read only filesystem for Linux
14 * The export code uses an inode lookup table to map inode numbers passed in
15 * filehandles to an inode location on disk. This table is stored compressed
16 * into metadata blocks. A second index table is used to locate these. This
17 * second index table for speed of access (and because it is small) is read at
20 * The inode lookup table is used only by the export code, inode disk
22 * without an intermediate lookup for all operations except the export ops.
37 * Look-up inode number (ino) in table, returning the inode location.
41 struct squashfs_sb_info *msblk = sb->s_fs_info; in squashfs_inode_lookup()
42 int blk = SQUASHFS_LOOKUP_BLOCK(ino_num - 1); in squashfs_inode_lookup()
43 int offset = SQUASHFS_LOOKUP_BLOCK_OFFSET(ino_num - 1); in squashfs_inode_lookup()
50 if (ino_num == 0 || (ino_num - 1) >= msblk->inodes) in squashfs_inode_lookup()
51 return -EINVAL; in squashfs_inode_lookup()
53 start = le64_to_cpu(msblk->inode_lookup_table[blk]); in squashfs_inode_lookup()
70 struct dentry *dentry = ERR_PTR(-ENOENT); in squashfs_export_iget()
89 return squashfs_export_iget(sb, fid->i32.ino); in squashfs_fh_to_dentry()
99 return squashfs_export_iget(sb, fid->i32.parent_ino); in squashfs_fh_to_parent()
106 unsigned int parent_ino = squashfs_i(inode)->parent; in squashfs_get_parent()
108 return squashfs_export_iget(inode->i_sb, parent_ino); in squashfs_get_parent()
113 * Read uncompressed inode lookup table indexes off disk into memory
121 __le64 *table; in squashfs_read_inode_lookup_table() local
130 return ERR_PTR(-EINVAL); in squashfs_read_inode_lookup_table()
133 * The computed size of the lookup table (length bytes) should exactly in squashfs_read_inode_lookup_table()
134 * match the table start and end points in squashfs_read_inode_lookup_table()
136 if (length != (next_table - lookup_table_start)) in squashfs_read_inode_lookup_table()
137 return ERR_PTR(-EINVAL); in squashfs_read_inode_lookup_table()
139 table = squashfs_read_table(sb, lookup_table_start, length); in squashfs_read_inode_lookup_table()
140 if (IS_ERR(table)) in squashfs_read_inode_lookup_table()
141 return table; in squashfs_read_inode_lookup_table()
144 * table0], table[1], ... table[indexes - 1] store the locations in squashfs_read_inode_lookup_table()
145 * of the compressed inode lookup blocks. Each entry should be in squashfs_read_inode_lookup_table()
146 * less than the next (i.e. table[0] < table[1]), and the difference in squashfs_read_inode_lookup_table()
148 * table[indexes - 1] should be less than lookup_table_start, and in squashfs_read_inode_lookup_table()
151 for (n = 0; n < (indexes - 1); n++) { in squashfs_read_inode_lookup_table()
152 start = le64_to_cpu(table[n]); in squashfs_read_inode_lookup_table()
153 end = le64_to_cpu(table[n + 1]); in squashfs_read_inode_lookup_table()
156 || (end - start) > in squashfs_read_inode_lookup_table()
158 kfree(table); in squashfs_read_inode_lookup_table()
159 return ERR_PTR(-EINVAL); in squashfs_read_inode_lookup_table()
163 start = le64_to_cpu(table[indexes - 1]); in squashfs_read_inode_lookup_table()
165 (lookup_table_start - start) > in squashfs_read_inode_lookup_table()
167 kfree(table); in squashfs_read_inode_lookup_table()
168 return ERR_PTR(-EINVAL); in squashfs_read_inode_lookup_table()
171 return table; in squashfs_read_inode_lookup_table()