char *p;
int symlink_count = 6;
-#if 1
+#if 0
printf("filename: %s\n", name);
#endif
if (!(file = alloc_file()))
- goto err;
+ goto err_no_close;
file->fs = this_fs;
/* if we have ->searchdir method, call it */
free_inode(inode);
continue;
}
+
+ /*
+ * For the relative path searching used in FAT and ISO fs.
+ */
+ if ((this_fs->fs_ops->fs_flags & FS_THISIND) && (this_inode != parent)){
+ if (this_inode)
+ free_inode(this_inode);
+ this_inode = parent;
+ }
if (parent != this_inode)
free_inode(parent);
return;
err:
+ _close_file(file);
+err_no_close:
regs->esi.w[0] = 0;
regs->eax.l = 0;
regs->eflags.l |= EFLAGS_ZF;
if (fs.fs_ops->iget_current)
this_inode = fs.fs_ops->iget_current();
+
+ print_cache(fs.fs_dev);
}
return vfat_find_entry(dname, parent);
}
-static char current_dir_name[32];
-static struct inode *vfat_iget_current(void)
-{
- com32sys_t regs;
- /*
- * Use ConfigName again.
- */
- memset(®s, 0, sizeof regs);
- regs.edi.w[0] = OFFS_WRT(ConfigName, 0);
- strcpy((void *)regs.edi.w[0], current_dir_name);
- call16(core_open, ®s, ®s);
-
- return handle_to_file(regs.esi.w[0])->inode;
-}
-
/*
* The open dir function, just call the searchdir function directly.
* I don't think we need call the mangle_name function first
return 1; /* no config file */
}
- /* Build the Current inode */
- strcpy(current_dir_name, syslinux_cfg[i]);
- current_dir_name[strlen(syslinux_cfg[i]) - strlen(config_name)] = '\0';
- this_inode = vfat_iget_current();
-
- memset(®s, 0, sizeof regs);
- regs.edi.w[0] = OFFS_WRT(ConfigName, 0);
- for (; i < 3; i++) {
- strcpy(ConfigName, syslinux_cfg[i]);
- call16(core_open, ®s, ®s);
-
- /* if zf flag set, then failed; try another */
- if (! (regs.eflags.l & EFLAGS_ZF))
- break;
- }
-
strcpy(ConfigName, config_name);
return 0;
}
const struct fs_ops vfat_fs_ops = {
.fs_name = "vfat",
- .fs_flags = FS_USEMEM,
+ .fs_flags = FS_USEMEM | FS_THISIND,
.fs_init = vfat_fs_init,
.searchdir = NULL,
.getfssec = vfat_getfssec,
.opendir = vfat_opendir,
.readdir = NULL,
.iget_root = vfat_iget_root,
- .iget_current = vfat_iget_current,
+ .iget_current = NULL,
.iget = vfat_iget,
};
struct dirent; /* Directory entry structure */
struct file;
enum fs_flags {
- FS_NODEV = 1 << 0,
- FS_USEMEM = 1 << 1, /* If we need a malloc routine, set it */
+ FS_NODEV = 1 << 0,
+ FS_USEMEM = 1 << 1, /* If we need a malloc routine, set it */
+
+ /*
+ * Update the this_inode pointer at each part of path searching. This
+ * flag is just used for FAT and ISO fs for now.
+ */
+ FS_THISIND = 1 << 2,
};
struct fs_ops {