summaryrefslogtreecommitdiff
path: root/isofs/lookup.c
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus@gnu.org>2000-11-26 16:53:40 +0000
committerMarcus Brinkmann <marcus@gnu.org>2000-11-26 16:53:40 +0000
commite3b1ae2acca631296b3fdc3342a543beac69360a (patch)
tree8972fa01b27d5593d5ca89ed83b0e3a803f9fa70 /isofs/lookup.c
parentce0f972cecd30fc1457aa0a9a0fa1ad966d23c12 (diff)
2000-11-26 Marcus Brinkmann <marcus@gnu.org>
Fix hard link handling for non-zero length files. * inode.c: Fix comment about inode numbers. (node_cache): New member ID to store unique identifier. (inode_cache_find): Change RECORD arg into ID and compare it with id member of node_cache. (cache_inode): Swap order of args and add new arg RR (change dr into record along the way). Use RR to find out cache ID. Use id member of node_cache to look for ID. Cache ID. (load_inode): Call inode_cache_find with correct ID, depending on RR and file size. Frob arguments to cache_inode to comply with the new definition. (read_disknode): Set st_ino according depending on RR and file size. * lookup.c: Doc spelling fix. (diskfs_get_directs): Include code again that was removed by last change, but use it only if not symlink or zero length file.
Diffstat (limited to 'isofs/lookup.c')
-rw-r--r--isofs/lookup.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/isofs/lookup.c b/isofs/lookup.c
index e6d2caf4..d8325a9d 100644
--- a/isofs/lookup.c
+++ b/isofs/lookup.c
@@ -179,7 +179,7 @@ dirscanblock (void *blkaddr, const char *name, size_t namelen,
if (reclen < sizeof (struct dirrect) + entry_namelen)
break;
- /* Check to see if the name maches the directory entry. */
+ /* Check to see if the name matches the directory entry. */
if (isonamematch (entry->name, entry_namelen, name, namelen))
matchnormal = 1;
else
@@ -353,7 +353,24 @@ diskfs_get_directs (struct node *dp,
/* Fill in entry */
- userp->d_fileno = (ino_t) ((void *) ep - (void *) disk_image);
+ if (rr.valid & VALID_SL || isonum_733 (ep->size) == 0)
+ userp->d_fileno = (ino_t) ((void *) ep - (void *) disk_image);
+ else
+ {
+ off_t file_start;
+
+ err = calculate_file_start (ep, &file_start, &rr);
+ if (err)
+ {
+ diskfs_end_catch_exception ();
+ if (ouralloc)
+ munmap (*data, allocsize);
+ return err;
+ }
+
+ userp->d_fileno = file_start;
+ }
+
userp->d_type = DT_UNKNOWN;
userp->d_reclen = reclen;
userp->d_namlen = namlen;