|
Lines 900-905
grub_xfs_iterate_dir (grub_fshelp_node_t dir,
Link Here
|
| 900 |
{ |
900 |
{ |
| 901 |
struct grub_xfs_dir2_entry *direntry = |
901 |
struct grub_xfs_dir2_entry *direntry = |
| 902 |
grub_xfs_first_de(dir->data, dirblock); |
902 |
grub_xfs_first_de(dir->data, dirblock); |
|
|
903 |
struct grub_xfs_dirblock_tail *tail = grub_xfs_dir_tail (dir->data, dirblock); |
| 904 |
|
| 903 |
int entries = -1; |
905 |
int entries = -1; |
| 904 |
char *end = dirblock + dirblk_size; |
906 |
char *end = dirblock + dirblk_size; |
| 905 |
|
907 |
|
|
Lines 918-935
grub_xfs_iterate_dir (grub_fshelp_node_t dir,
Link Here
|
| 918 |
*/ |
920 |
*/ |
| 919 |
if (dir->inode.nextents == grub_cpu_to_be32_compile_time (1)) |
921 |
if (dir->inode.nextents == grub_cpu_to_be32_compile_time (1)) |
| 920 |
{ |
922 |
{ |
| 921 |
struct grub_xfs_dirblock_tail *tail = grub_xfs_dir_tail (dir->data, dirblock); |
|
|
| 922 |
|
| 923 |
end = (char *) tail; |
923 |
end = (char *) tail; |
| 924 |
|
924 |
|
| 925 |
/* Subtract the space used by leaf nodes. */ |
925 |
/* Subtract the space used by leaf nodes. */ |
| 926 |
end -= grub_be_to_cpu32 (tail->leaf_count) * sizeof (struct grub_xfs_dir_leaf_entry); |
926 |
end -= grub_be_to_cpu32 (tail->leaf_count) * sizeof (struct grub_xfs_dir_leaf_entry); |
|
|
927 |
} |
| 927 |
|
928 |
|
| 928 |
entries = grub_be_to_cpu32 (tail->leaf_count) - grub_be_to_cpu32 (tail->leaf_stale); |
929 |
entries = grub_be_to_cpu32 (tail->leaf_count) - grub_be_to_cpu32 (tail->leaf_stale); |
| 929 |
|
930 |
|
| 930 |
if (!entries) |
931 |
if (!entries) |
| 931 |
continue; |
932 |
continue; |
| 932 |
} |
|
|
| 933 |
|
933 |
|
| 934 |
/* Iterate over all entries within this block. */ |
934 |
/* Iterate over all entries within this block. */ |
| 935 |
while ((char *) direntry < (char *) end) |
935 |
while ((char *) direntry < (char *) end) |