summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/fs.c33
-rw-r--r--fs/yaffs2/ydirectenv.h2
-rw-r--r--fs/zfs/zfs.c51
3 files changed, 24 insertions, 62 deletions
diff --git a/fs/fs.c b/fs/fs.c
index 23ffa25f0d..ff360afd4b 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -21,6 +21,8 @@
#include <fat.h>
#include <fs.h>
+DECLARE_GLOBAL_DATA_PTR;
+
static block_dev_desc_t *fs_dev_desc;
static disk_partition_t fs_partition;
static int fs_type = FS_TYPE_ANY;
@@ -141,7 +143,7 @@ static inline void fs_close_ext(void)
#define fs_read_ext fs_read_unsupported
#endif
-static const struct {
+static struct {
int fstype;
int (*probe)(void);
} fstypes[] = {
@@ -158,6 +160,15 @@ static const struct {
int fs_set_blk_dev(const char *ifname, const char *dev_part_str, int fstype)
{
int part, i;
+#ifdef CONFIG_NEEDS_MANUAL_RELOC
+ static int relocated;
+
+ if (!relocated) {
+ for (i = 0; i < ARRAY_SIZE(fstypes); i++)
+ fstypes[i].probe += gd->reloc_off;
+ relocated = 1;
+ }
+#endif
part = get_device_and_partition(ifname, dev_part_str, &fs_dev_desc,
&fs_partition, 1);
@@ -236,8 +247,8 @@ int fs_read(const char *filename, ulong addr, int offset, int len)
return ret;
}
-int do_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
- int fstype)
+int do_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
+ int fstype, int cmdline_base)
{
unsigned long addr;
const char *addr_str;
@@ -247,14 +258,16 @@ int do_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
int len_read;
char buf[12];
- if (argc < 5)
+ if (argc < 2)
+ return CMD_RET_USAGE;
+ if (argc > 7)
return CMD_RET_USAGE;
- if (fs_set_blk_dev(argv[1], argv[2], fstype))
+ if (fs_set_blk_dev(argv[1], (argc >= 3) ? argv[2] : NULL, fstype))
return 1;
if (argc >= 4) {
- addr = simple_strtoul(argv[3], NULL, 0);
+ addr = simple_strtoul(argv[3], NULL, cmdline_base);
} else {
addr_str = getenv("loadaddr");
if (addr_str != NULL)
@@ -272,11 +285,11 @@ int do_fsload(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
}
}
if (argc >= 6)
- bytes = simple_strtoul(argv[5], NULL, 0);
+ bytes = simple_strtoul(argv[5], NULL, cmdline_base);
else
bytes = 0;
if (argc >= 7)
- pos = simple_strtoul(argv[6], NULL, 0);
+ pos = simple_strtoul(argv[6], NULL, cmdline_base);
else
pos = 0;
@@ -297,11 +310,13 @@ int do_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
{
if (argc < 2)
return CMD_RET_USAGE;
+ if (argc > 4)
+ return CMD_RET_USAGE;
if (fs_set_blk_dev(argv[1], (argc >= 3) ? argv[2] : NULL, fstype))
return 1;
- if (fs_ls(argc == 4 ? argv[3] : "/"))
+ if (fs_ls(argc >= 4 ? argv[3] : "/"))
return 1;
return 0;
diff --git a/fs/yaffs2/ydirectenv.h b/fs/yaffs2/ydirectenv.h
index c912b09a40..c2ffbfd56d 100644
--- a/fs/yaffs2/ydirectenv.h
+++ b/fs/yaffs2/ydirectenv.h
@@ -56,8 +56,6 @@ void yaffs_qsort(void *aa, size_t n, size_t es,
#ifdef NO_inline
#define inline
-#else
-#define inline __inline__
#endif
#define cond_resched() do {} while (0)
diff --git a/fs/zfs/zfs.c b/fs/zfs/zfs.c
index 360f723c84..2db45b1928 100644
--- a/fs/zfs/zfs.c
+++ b/fs/zfs/zfs.c
@@ -2002,49 +2002,6 @@ zfs_fetch_nvlist(device_t dev, char **nvlist)
return err;
}
-static int
-zfs_label(device_t device, char **label)
-{
- char *nvlist;
- int err;
- struct zfs_data *data;
-
- data = zfs_mount(device);
- if (!data)
- return ZFS_ERR_BAD_FS;
-
- err = int_zfs_fetch_nvlist(data, &nvlist);
- if (err) {
- zfs_unmount(data);
- return err;
- }
-
- *label = zfs_nvlist_lookup_string(nvlist, ZPOOL_CONFIG_POOL_NAME);
- free(nvlist);
- zfs_unmount(data);
- return ZFS_ERR_NONE;
-}
-
-static int
-zfs_uuid(device_t device, char **uuid)
-{
- struct zfs_data *data;
-
- data = zfs_mount(device);
- if (!data)
- return ZFS_ERR_BAD_FS;
-
- *uuid = malloc(17); /* %016llx + nil */
- if (!*uuid)
- return ZFS_ERR_OUT_OF_MEMORY;
-
- /* *uuid = xasprintf ("%016llx", (long long unsigned) data->pool_guid);*/
- snprintf(*uuid, 17, "%016llx", (long long unsigned) data->pool_guid);
- zfs_unmount(data);
-
- return ZFS_ERR_NONE;
-}
-
/*
* zfs_open() locates a file in the rootpool by following the
* MOS and places the dnode of the file in the memory address DNODE.
@@ -2325,14 +2282,6 @@ zfs_ls(device_t device, const char *path,
struct zfs_data *data;
int err;
int isfs;
-#if 0
- char *label = NULL;
-
- zfs_label(device, &label);
- if (label)
- printf("ZPOOL label '%s'\n",
- label);
-#endif
data = zfs_mount(device);
if (!data)