aboutsummaryrefslogtreecommitdiffstats
path: root/core/fs/fat
diff options
context:
space:
mode:
authorLiu Aleaxander <Aleaxander@gmail.com>2009-12-10 15:30:21 +0800
committerLiu Aleaxander <Aleaxander@gmail.com>2009-12-10 15:30:21 +0800
commit0fe9610dfed967268960248674a799e1f1322b47 (patch)
treeaa1a7c703d181f1a34ba828e13111b70bcb9711c /core/fs/fat
parent6747b1ba13fbb6266d7d7fe8f710e8475810610c (diff)
downloadsyslinux-0fe9610dfed967268960248674a799e1f1322b47.tar.gz
syslinux-0fe9610dfed967268960248674a799e1f1322b47.tar.xz
syslinux-0fe9610dfed967268960248674a799e1f1322b47.zip
LDLINUX:vfat: Improve the fat fs relative path searching
Added a new flag, FS_THISIND, used in the fat and iso fs relative path searching. It means tries to get the last directory of the config file path in the 'this_inode' variable to do a relative searching while loading the kernel images in after. And also fixed a bug in fs.c which wouldn't close the file structure when doing path searching failed! And as a result, we could just run a few com32 programs. Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
Diffstat (limited to 'core/fs/fat')
-rw-r--r--core/fs/fat/fat.c35
1 files changed, 2 insertions, 33 deletions
diff --git a/core/fs/fat/fat.c b/core/fs/fat/fat.c
index cc9b48b3..b272da7d 100644
--- a/core/fs/fat/fat.c
+++ b/core/fs/fat/fat.c
@@ -524,21 +524,6 @@ static struct inode *vfat_iget(char *dname, struct inode *parent)
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(&regs, 0, sizeof regs);
- regs.edi.w[0] = OFFS_WRT(ConfigName, 0);
- strcpy((void *)regs.edi.w[0], current_dir_name);
- call16(core_open, &regs, &regs);
-
- 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
@@ -583,22 +568,6 @@ static int vfat_load_config(void)
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(&regs, 0, sizeof regs);
- regs.edi.w[0] = OFFS_WRT(ConfigName, 0);
- for (; i < 3; i++) {
- strcpy(ConfigName, syslinux_cfg[i]);
- call16(core_open, &regs, &regs);
-
- /* if zf flag set, then failed; try another */
- if (! (regs.eflags.l & EFLAGS_ZF))
- break;
- }
-
strcpy(ConfigName, config_name);
return 0;
}
@@ -655,7 +624,7 @@ static int vfat_fs_init(struct fs_info *fs)
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,
@@ -666,6 +635,6 @@ const struct fs_ops vfat_fs_ops = {
.opendir = vfat_opendir,
.readdir = NULL,
.iget_root = vfat_iget_root,
- .iget_current = vfat_iget_current,
+ .iget_current = NULL,
.iget = vfat_iget,
};