aboutsummaryrefslogtreecommitdiffstats
path: root/core/include/fs.h
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-08-11 17:25:43 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-08-11 17:25:43 -0700
commitf2fa4525e58ba414220c9f62587b7e7aff35347f (patch)
treee883014005982230b602b6cb9f948765fd5d7515 /core/include/fs.h
parent0202356bab69a17bf9620432da4339348c0833b7 (diff)
downloadsyslinux-f2fa4525e58ba414220c9f62587b7e7aff35347f.tar.gz
syslinux-f2fa4525e58ba414220c9f62587b7e7aff35347f.tar.xz
syslinux-f2fa4525e58ba414220c9f62587b7e7aff35347f.zip
core: VFS cleanups: add a persistent generic struct file
Major cleanups to the VFS layer: - add a persistent generic "struct file" - pass "struct file *" to getfssec - add a close_file method - use VFS-assigned indicies instead of pointers as file handles. This allows the file structures to be allocated from high memory. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'core/include/fs.h')
-rw-r--r--core/include/fs.h27
1 files changed, 21 insertions, 6 deletions
diff --git a/core/include/fs.h b/core/include/fs.h
index ca4e281a..21e1349d 100644
--- a/core/include/fs.h
+++ b/core/include/fs.h
@@ -7,26 +7,41 @@
#include "core.h"
#include "disk.h"
+/*
+ * Maximum number of open files. This is *currently* constrained by the
+ * fact that PXE needs to be able to fit all its packet buffers into a
+ * 64K segment; this should be fixed by moving the packet buffers to high
+ * memory.
+ */
+#define MAX_OPEN_LG2 5
+#define MAX_OPEN (1 << MAX_OPEN_LG2)
+
struct fs_info {
- char *fs_name;
- struct fs_ops *fs_ops;
+ const struct fs_ops *fs_ops;
struct device *fs_dev;
};
+struct open_file_t; /* Filesystem private structure */
+
struct file {
- void* open_file; /* points to the fs-specific open_file_t */
- struct fs_info *fs;
+ struct open_file_t *open_file; /* Filesystem private data */
+ struct fs_info *fs;
uint32_t file_len;
};
+enum fs_flags {
+ FS_NODEV = 1,
+};
struct fs_ops {
/* in fact, we use fs_ops structure to find the right fs */
- char *fs_name;
+ const char *fs_name;
+ enum fs_flags fs_flags;
int (*fs_init)(struct fs_info *);
void (*searchdir)(char *, struct file *);
- uint32_t (*getfssec)(struct fs_info *, char *, void * , int, int *);
+ uint32_t (*getfssec)(struct file *, char *, int, bool *);
+ void (*close_file)(struct file *);
void (*mangle_name)(char *, char *);
int (*unmangle_name)(char *, char *);
void (*load_config)(com32sys_t *);