Line
Link Here
|
0 |
-- a/include/fs.h |
0 |
++ b/include/fs.h |
Lines 26-32
Link Here
|
26 |
#include "partition.h" |
26 |
#include "partition.h" |
27 |
#include "file.h" |
27 |
#include "file.h" |
28 |
|
28 |
|
29 |
int fserrorno; |
29 |
extern int fserrorno; |
30 |
struct boot_fspec_t; |
30 |
struct boot_fspec_t; |
31 |
|
31 |
|
32 |
struct fs_t { |
32 |
struct fs_t { |
33 |
-- a/second/fs.c |
33 |
++ b/second/fs.c |
Lines 57-62
static const struct fs_t *block_filesystems[] = {
Link Here
|
57 |
const struct fs_t *fs_of = &of_filesystem; /* needed by ISO9660 */ |
57 |
const struct fs_t *fs_of = &of_filesystem; /* needed by ISO9660 */ |
58 |
const struct fs_t *fs_of_netboot = &of_net_filesystem; /* needed by file.c */ |
58 |
const struct fs_t *fs_of_netboot = &of_net_filesystem; /* needed by file.c */ |
59 |
|
59 |
|
|
|
60 |
int fserrorno; |
61 |
|
60 |
const struct fs_t * |
62 |
const struct fs_t * |
61 |
fs_open(struct boot_file_t *file, |
63 |
fs_open(struct boot_file_t *file, |
62 |
struct partition_t *part, struct boot_fspec_t *fspec) |
64 |
struct partition_t *part, struct boot_fspec_t *fspec) |
63 |
-- a/second/fs_xfs.c |
65 |
++ b/second/fs_xfs.c |
Lines 56-62
struct fs_t xfs_filesystem = {
Link Here
|
56 |
struct boot_file_t *xfs_file; |
56 |
struct boot_file_t *xfs_file; |
57 |
static char FSYS_BUF[32768]; |
57 |
static char FSYS_BUF[32768]; |
58 |
uint64_t partition_offset; |
58 |
uint64_t partition_offset; |
59 |
int errnum; |
59 |
int xfserrnum; |
60 |
|
60 |
|
61 |
static int |
61 |
static int |
62 |
xfs_open(struct boot_file_t *file, |
62 |
xfs_open(struct boot_file_t *file, |
Lines 109-119
xfs_open(struct boot_file_t *file,
Link Here
|
109 |
strcpy(buffer, fspec->file); /* xfs_dir modifies argument */ |
109 |
strcpy(buffer, fspec->file); /* xfs_dir modifies argument */ |
110 |
if(!xfs_dir(buffer)) |
110 |
if(!xfs_dir(buffer)) |
111 |
{ |
111 |
{ |
112 |
DEBUG_F("xfs_dir() failed. errnum = %d\n", errnum); |
112 |
DEBUG_F("xfs_dir() failed. xfserrnum = %d\n", xfserrnum); |
113 |
prom_close( file->of_device ); |
113 |
prom_close( file->of_device ); |
114 |
DEBUG_LEAVE_F(errnum); |
114 |
DEBUG_LEAVE_F(xfserrnum); |
115 |
DEBUG_SLEEP; |
115 |
DEBUG_SLEEP; |
116 |
return errnum; |
116 |
return xfserrnum; |
117 |
} |
117 |
} |
118 |
|
118 |
|
119 |
DEBUG_F("Successfully opened %s\n", fspec->file); |
119 |
DEBUG_F("Successfully opened %s\n", fspec->file); |
Lines 715-721
xfs_dir (char *dirname)
Link Here
|
715 |
DEBUG_F("di_mode: %o\n", di_mode); |
715 |
DEBUG_F("di_mode: %o\n", di_mode); |
716 |
if ((di_mode & IFMT) == IFLNK) { |
716 |
if ((di_mode & IFMT) == IFLNK) { |
717 |
if (++link_count > MAX_LINK_COUNT) { |
717 |
if (++link_count > MAX_LINK_COUNT) { |
718 |
errnum = FILE_ERR_SYMLINK_LOOP; |
718 |
xfserrnum = FILE_ERR_SYMLINK_LOOP; |
719 |
DEBUG_LEAVE(FILE_ERR_SYMLINK_LOOP); |
719 |
DEBUG_LEAVE(FILE_ERR_SYMLINK_LOOP); |
720 |
return 0; |
720 |
return 0; |
721 |
} |
721 |
} |
Lines 724-730
xfs_dir (char *dirname)
Link Here
|
724 |
xfs_file->len = di_size; |
724 |
xfs_file->len = di_size; |
725 |
n = xfs_read_data (linkbuf, xfs_file->len); |
725 |
n = xfs_read_data (linkbuf, xfs_file->len); |
726 |
} else { |
726 |
} else { |
727 |
errnum = FILE_ERR_LENGTH; |
727 |
xfserrnum = FILE_ERR_LENGTH; |
728 |
DEBUG_LEAVE(FILE_ERR_LENGTH); |
728 |
DEBUG_LEAVE(FILE_ERR_LENGTH); |
729 |
return 0; |
729 |
return 0; |
730 |
} |
730 |
} |
Lines 739-745
xfs_dir (char *dirname)
Link Here
|
739 |
DEBUG_F("*dirname: %s\n", dirname); |
739 |
DEBUG_F("*dirname: %s\n", dirname); |
740 |
if (!*dirname || isspace (*dirname)) { |
740 |
if (!*dirname || isspace (*dirname)) { |
741 |
if ((di_mode & IFMT) != IFREG) { |
741 |
if ((di_mode & IFMT) != IFREG) { |
742 |
errnum = FILE_ERR_BAD_TYPE; |
742 |
xfserrnum = FILE_ERR_BAD_TYPE; |
743 |
DEBUG_LEAVE(FILE_ERR_BAD_TYPE); |
743 |
DEBUG_LEAVE(FILE_ERR_BAD_TYPE); |
744 |
return 0; |
744 |
return 0; |
745 |
} |
745 |
} |
Lines 750-756
xfs_dir (char *dirname)
Link Here
|
750 |
} |
750 |
} |
751 |
|
751 |
|
752 |
if ((di_mode & IFMT) != IFDIR) { |
752 |
if ((di_mode & IFMT) != IFDIR) { |
753 |
errnum = FILE_ERR_NOTDIR; |
753 |
xfserrnum = FILE_ERR_NOTDIR; |
754 |
DEBUG_LEAVE(FILE_ERR_NOTDIR); |
754 |
DEBUG_LEAVE(FILE_ERR_NOTDIR); |
755 |
return 0; |
755 |
return 0; |
756 |
} |
756 |
} |
Lines 772-778
xfs_dir (char *dirname)
Link Here
|
772 |
} |
772 |
} |
773 |
name = next_dentry (&new_ino); |
773 |
name = next_dentry (&new_ino); |
774 |
if (name == NULL) { |
774 |
if (name == NULL) { |
775 |
errnum = FILE_ERR_NOTFOUND; |
775 |
xfserrnum = FILE_ERR_NOTFOUND; |
776 |
DEBUG_LEAVE(FILE_ERR_NOTFOUND); |
776 |
DEBUG_LEAVE(FILE_ERR_NOTFOUND); |
777 |
*rest = ch; |
777 |
*rest = ch; |
778 |
return 0; |
778 |
return 0; |