[syslinux:elflink] fs: Add .copy_super to struct fs_ops

syslinux-bot for Matt Fleming matt.fleming at intel.com
Tue Jun 26 09:54:07 PDT 2012


Commit-ID:  3e7446afe578dcad987076fdd340740d2c2f53d2
Gitweb:     http://www.syslinux.org/commit/3e7446afe578dcad987076fdd340740d2c2f53d2
Author:     Matt Fleming <matt.fleming at intel.com>
AuthorDate: Tue, 12 Jun 2012 11:24:04 +0100
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Wed, 20 Jun 2012 14:51:09 +0100

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 at intel.com>

---
 com32/elflink/ldlinux/chainboot.c |    2 +-
 core/fs/fat/fat.c                 |    3 ++-
 core/include/fs.h                 |    5 ++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/com32/elflink/ldlinux/chainboot.c b/com32/elflink/ldlinux/chainboot.c
index 33589e0..c1efadf 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 2c8dc31..127a24d 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 ded8c15..08ac738 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 */


More information about the Syslinux-commits mailing list