From d89c862fb2f569275300d6a64caaa0b287367558 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 24 Feb 2015 17:31:10 +0100 Subject: Fix a bug (dispose in pciide should not exist) --- src/kernel/dev/pciide.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/kernel/dev') 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) { -- cgit v1.2.3