+2011-08-16 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * grub-core/fs/jfs.c (grub_jfs_read_file): New parameter ino.
+ All users updated.
+ (grub_jfs_lookup_symlink): Use correct starting inode.
+
2011-08-16 Vladimir Serbinenko <phcoder@gmail.com>
* util/grub-setup.c (main): Add missing gcry initialisation.
/* Find the file with the pathname PATH on the filesystem described by
DATA. */
static grub_err_t
-grub_jfs_find_file (struct grub_jfs_data *data, const char *path)
+grub_jfs_find_file (struct grub_jfs_data *data, const char *path,
+ grub_uint32_t start_ino)
{
char fpath[grub_strlen (path)];
char *name = fpath;
grub_strncpy (fpath, path, grub_strlen (path) + 1);
- if (grub_jfs_read_inode (data, GRUB_JFS_AGGR_INODE, &data->currinode))
+ if (grub_jfs_read_inode (data, start_ino, &data->currinode))
return grub_errno;
/* Skip the first slashes. */
if (symlink[0] == '/')
ino = 2;
- /* Now load in the old inode. */
- if (grub_jfs_read_inode (data, ino, &data->currinode))
- return grub_errno;
-
- grub_jfs_find_file (data, symlink);
+ grub_jfs_find_file (data, symlink, ino);
if (grub_errno)
grub_error (grub_errno, "cannot follow symlink `%s'", symlink);
if (!data)
goto fail;
- if (grub_jfs_find_file (data, path))
+ if (grub_jfs_find_file (data, path, GRUB_JFS_AGGR_INODE))
goto fail;
diro = grub_jfs_opendir (data, &data->currinode);
if (!data)
goto fail;
- grub_jfs_find_file (data, name);
+ grub_jfs_find_file (data, name, GRUB_JFS_AGGR_INODE);
if (grub_errno)
goto fail;