aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/dev/pciide.c
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-02-24 17:31:10 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2015-02-24 17:31:10 +0100
commitd89c862fb2f569275300d6a64caaa0b287367558 (patch)
treee3572ee543f9f5189289e466fdf67a911504be20 /src/kernel/dev/pciide.c
parent150dd5f860a5f22a8c3bcc1bf3a1f2e36dcf6fd8 (diff)
downloadkogata-d89c862fb2f569275300d6a64caaa0b287367558.tar.gz
kogata-d89c862fb2f569275300d6a64caaa0b287367558.zip
Fix a bug (dispose in pciide should not exist)
Diffstat (limited to 'src/kernel/dev/pciide.c')
-rw-r--r--src/kernel/dev/pciide.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/kernel/dev/pciide.c b/src/kernel/dev/pciide.c
index 5d79470..ad7375b 100644
--- a/src/kernel/dev/pciide.c
+++ b/src/kernel/dev/pciide.c
@@ -642,7 +642,6 @@ typedef struct {
static bool ide_vfs_open(fs_node_ptr n, int mode, fs_handle_t *s);
static bool ide_vfs_stat(fs_node_ptr n, stat_t *st);
-static void ide_vfs_dispose(fs_node_ptr n);
static size_t ide_vfs_read(fs_handle_ptr f, size_t offset, size_t len, char* buf);
static size_t ide_vfs_write(fs_handle_ptr f, size_t offset, size_t len, const char* buf);
@@ -656,7 +655,7 @@ static fs_node_ops_t ide_vfs_node_ops = {
.delete = 0,
.move = 0,
.create = 0,
- .dispose = ide_vfs_dispose
+ .dispose = 0
};
static fs_handle_ops_t ide_vfs_handle_ops = {
@@ -721,10 +720,6 @@ bool ide_vfs_stat(fs_node_ptr n, stat_t *st) {
return true;
}
-void ide_vfs_dispose(fs_node_ptr n) {
- free(n);
-}
-
size_t ide_vfs_read(fs_handle_ptr f, size_t offset, size_t len, char* buf) {
ide_vfs_dev_t *d = (ide_vfs_dev_t*)f;
@@ -752,12 +747,15 @@ uint8_t err = ide_write_sectors(d->c, d->device,
int ide_vfs_ioctl(fs_handle_ptr f, int command, void* data) {
ide_vfs_dev_t *d = (ide_vfs_dev_t*)f;
+ int ret = 0;
+
if (command == IOCTL_BLOCKDEV_GET_BLOCK_SIZE)
- return d->block_size;
+ ret = d->block_size;
if (command == IOCTL_BLOCKDEV_GET_BLOCK_COUNT)
- return d->c->devices[d->device].size;
+ ret = d->c->devices[d->device].size;
- return 0;
+ dbg_printf("ioctl (0x%p) %d -> %d\n", f, command, ret);
+ return ret;
}
void ide_vfs_close(fs_handle_ptr f) {