git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Second Extended Filesystem (ext2) and other improvements (#33)
[lunaix-os.git]
/
lunaix-os
/
kernel
/
fs
/
iso9660
/
mount.c
diff --git
a/lunaix-os/kernel/fs/iso9660/mount.c
b/lunaix-os/kernel/fs/iso9660/mount.c
index 25150e5efe990aa73807f0f885c7bda9bc8d822c..aeb6e3be106701c4240945d45c76d3ac7ca39d62 100644
(file)
--- a/
lunaix-os/kernel/fs/iso9660/mount.c
+++ b/
lunaix-os/kernel/fs/iso9660/mount.c
@@
-1,23
+1,29
@@
#include <lunaix/block.h>
#include <lunaix/block.h>
-#include <lunaix/fs.h>
-#include <lunaix/fs/iso9660.h>
+#include <lunaix/fs/api.h>
#include <lunaix/mm/valloc.h>
#include <lunaix/mm/valloc.h>
+#include <lunaix/mm/cake.h>
#include <lunaix/spike.h>
#include <lunaix/spike.h>
-#include
<lunaix/mm/cake.h>
+#include
"iso9660.h"
struct cake_pile* drec_cache_pile;
extern void
iso9660_init_inode(struct v_superblock* vsb, struct v_inode* inode);
struct cake_pile* drec_cache_pile;
extern void
iso9660_init_inode(struct v_superblock* vsb, struct v_inode* inode);
-
u32
_t
-iso9660_rd_capacity(struct v_superblock* vsb)
+
static size
_t
+
__
iso9660_rd_capacity(struct v_superblock* vsb)
{
struct iso_superblock* isovsb = (struct iso_superblock*)vsb->data;
return isovsb->volume_size;
}
{
struct iso_superblock* isovsb = (struct iso_superblock*)vsb->data;
return isovsb->volume_size;
}
+static void
+__vsb_release(struct v_superblock* vsb)
+{
+ vfree(vsb->data);
+}
+
int
iso9660_mount(struct v_superblock* vsb, struct v_dnode* mount_point)
{
int
iso9660_mount(struct v_superblock* vsb, struct v_dnode* mount_point)
{
@@
-54,7
+60,8
@@
iso9660_mount(struct v_superblock* vsb, struct v_dnode* mount_point)
vsb->data = isovsb;
vsb->ops.init_inode = iso9660_init_inode;
vsb->data = isovsb;
vsb->ops.init_inode = iso9660_init_inode;
- vsb->ops.read_capacity = iso9660_rd_capacity;
+ vsb->ops.read_capacity = __iso9660_rd_capacity;
+ vsb->ops.release = __vsb_release;
vsb->blksize = ISO9660_BLKSZ;
struct v_inode* rootino = vfs_i_alloc(vsb);
vsb->blksize = ISO9660_BLKSZ;
struct v_inode* rootino = vfs_i_alloc(vsb);
@@
-90,25
+97,24
@@
done:
return errno;
}
return errno;
}
+
+
int
iso9660_unmount(struct v_superblock* vsb)
{
int
iso9660_unmount(struct v_superblock* vsb)
{
- vfree(vsb->data);
-
return 0;
}
void
iso9660_init()
{
return 0;
}
void
iso9660_init()
{
+ struct filesystem* fs;
+ fs = fsapi_fs_declare("iso9660", FSTYPE_ROFS);
+
+ fsapi_fs_set_mntops(fs, iso9660_mount, iso9660_unmount);
+ fsapi_fs_finalise(fs);
+
drec_cache_pile =
cake_new_pile("iso_drec", sizeof(struct iso_drecache), 1, 0);
drec_cache_pile =
cake_new_pile("iso_drec", sizeof(struct iso_drecache), 1, 0);
-
- struct filesystem* fs = fsm_new_fs("iso9660", -1);
- fs->types |= FSTYPE_ROFS;
- fs->mount = iso9660_mount;
- fs->unmount = iso9660_unmount;
-
- fsm_register(fs);
}
EXPORT_FILE_SYSTEM(iso9660, iso9660_init);
\ No newline at end of file
}
EXPORT_FILE_SYSTEM(iso9660, iso9660_init);
\ No newline at end of file