aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2012-06-12 11:24:04 +0100
committerMatt Fleming <matt.fleming@intel.com>2012-06-20 14:51:09 +0100
commit3e7446afe578dcad987076fdd340740d2c2f53d2 (patch)
tree9720cd1d7e62e97e2ee6ac291a8a7740873927b2
parent97a087ea7814db5134e4d5cd40930fa4bd20f2e0 (diff)
downloadsyslinux-3e7446afe578dcad987076fdd340740d2c2f53d2.tar.gz
syslinux-3e7446afe578dcad987076fdd340740d2c2f53d2.tar.xz
syslinux-3e7446afe578dcad987076fdd340740d2c2f53d2.zip
fs: Add .copy_super to struct fs_ops
commit c0d18deeee2 ("elflink: Fix boot sector booting") makes reference to vfat_copy_superblock() which is only implemented for SYSLINUX, resulting in an undefined symbol when booting ISOLINUX or PXELINUX. Move the superblock copy operation to struct fs_ops so that we don't need to add a stub implementation of vfat_copy_superblock() to ISOLINUX and PXELINUX. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
-rw-r--r--com32/elflink/ldlinux/chainboot.c2
-rw-r--r--core/fs/fat/fat.c3
-rw-r--r--core/include/fs.h5
3 files changed, 5 insertions, 5 deletions
diff --git a/com32/elflink/ldlinux/chainboot.c b/com32/elflink/ldlinux/chainboot.c
index 33589e0c..c1efadfe 100644
--- a/com32/elflink/ldlinux/chainboot.c
+++ b/com32/elflink/ldlinux/chainboot.c
@@ -97,7 +97,7 @@ void chainboot_file(const char *file, enum kernel_type type)
* superblock.
*/
if (sdi->c.filesystem == SYSLINUX_FS_SYSLINUX &&
- type == KT_BSS && vfat_copy_superblock(buf))
+ type == KT_BSS && this_fs->fs_ops->copy_super(buf))
goto bail;
if (sdi->c.filesystem == SYSLINUX_FS_PXELINUX) {
diff --git a/core/fs/fat/fat.c b/core/fs/fat/fat.c
index 2c8dc315..127a24df 100644
--- a/core/fs/fat/fat.c
+++ b/core/fs/fat/fat.c
@@ -779,7 +779,7 @@ static int vfat_fs_init(struct fs_info *fs)
return fs->block_shift;
}
-int vfat_copy_superblock(void *buf)
+static int vfat_copy_superblock(void *buf)
{
struct fat_bpb fat;
struct disk *disk;
@@ -821,4 +821,5 @@ const struct fs_ops vfat_fs_ops = {
.iget_root = vfat_iget_root,
.iget = vfat_iget,
.next_extent = fat_next_extent,
+ .copy_super = vfat_copy_superblock,
};
diff --git a/core/include/fs.h b/core/include/fs.h
index ded8c154..08ac7385 100644
--- a/core/include/fs.h
+++ b/core/include/fs.h
@@ -72,6 +72,8 @@ struct fs_ops {
int (*readdir)(struct file *, struct dirent *);
int (*next_extent)(struct inode *, uint32_t);
+
+ int (*copy_super)(void *buf);
};
/*
@@ -234,7 +236,4 @@ uint32_t generic_getfssec(struct file *file, char *buf,
/* nonextextent.c */
int no_next_extent(struct inode *, uint32_t);
-/* fat.c */
-int vfat_copy_superblock(void *buf);
-
#endif /* FS_H */