diff options
author | Marcus Brinkmann <marcus@gnu.org> | 2000-11-27 19:58:35 +0000 |
---|---|---|
committer | Marcus Brinkmann <marcus@gnu.org> | 2000-11-27 19:58:35 +0000 |
commit | dcf87038f6e0cba736b974204a7e8c1bbe2c4858 (patch) | |
tree | 96dc178cd1706247113e505c45d50a9571bfcb3e /isofs/lookup.c | |
parent | ea5ea50352cde95ee275859aba3b5d0bb0c3d341 (diff) |
2000-11-27 Marcus Brinkmann <marcus@gnu.org>
The last two changes introduced two new inode overlaps
(file_start was not shifted by store block size, and directories'
shifted file_start offset can be the same as the struct dirrect
offset of their first directory entry).
* inode.c (use_file_start_as_id): New function to determine
if to use file_start or struct dirrect * as node id.
The directory recognition code comes from read_disknode.
(cache_inode): Use use_file_start_as_id instead doing the work
ourselve. Shift file_start by store->log2_block_size.
(load_inode): Likewise.
* lookup.c (diskfs_get_directs): Likewise.
Declare use_file_start_id.
Diffstat (limited to 'isofs/lookup.c')
-rw-r--r-- | isofs/lookup.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/isofs/lookup.c b/isofs/lookup.c index d8325a9d..e6ee692f 100644 --- a/isofs/lookup.c +++ b/isofs/lookup.c @@ -22,6 +22,9 @@ #include <dirent.h> #include "isofs.h" +/* From inode.c */ +int use_file_start_id (struct dirrect *record, struct rrip_lookup *rr); + /* Forward */ static error_t dirscanblock (void *, const char *, size_t, struct dirrect **, struct rrip_lookup *); @@ -353,12 +356,10 @@ diskfs_get_directs (struct node *dp, /* Fill in entry */ - if (rr.valid & VALID_SL || isonum_733 (ep->size) == 0) - userp->d_fileno = (ino_t) ((void *) ep - (void *) disk_image); - else + if (use_file_start_id (ep, &rr)) { off_t file_start; - + err = calculate_file_start (ep, &file_start, &rr); if (err) { @@ -368,8 +369,10 @@ diskfs_get_directs (struct node *dp, return err; } - userp->d_fileno = file_start; + userp->d_fileno = file_start << store->log2_block_size; } + else + userp->d_fileno = (ino_t) ((void *) ep - (void *) disk_image); userp->d_type = DT_UNKNOWN; userp->d_reclen = reclen; |