diff options
author | Anton Nefedov | 2017-12-08 13:10:33 +0100 |
---|---|---|
committer | John Snow | 2018-01-19 22:04:55 +0100 |
commit | d8b070fed2e94b3747a74a28709d0300404c0d05 (patch) | |
tree | d8dfe3c399f82aa8b80345a685a33081b4263f64 /hw/ide/core.c | |
parent | ide: pass IDEState to trim AIO callback (diff) | |
download | qemu-d8b070fed2e94b3747a74a28709d0300404c0d05.tar.gz qemu-d8b070fed2e94b3747a74a28709d0300404c0d05.tar.xz qemu-d8b070fed2e94b3747a74a28709d0300404c0d05.zip |
ide: move ide_sect_range_ok() up
to use it without a forward declaration in the commit to follow
Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com>
Message-id: 1512735034-35327-3-git-send-email-anton.nefedov@virtuozzo.com
Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'hw/ide/core.c')
-rw-r--r-- | hw/ide/core.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/hw/ide/core.c b/hw/ide/core.c index 875f7b442d..27226bfd51 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -380,6 +380,18 @@ static void ide_set_signature(IDEState *s) } } +static bool ide_sect_range_ok(IDEState *s, + uint64_t sector, uint64_t nb_sectors) +{ + uint64_t total_sectors; + + blk_get_geometry(s->blk, &total_sectors); + if (sector > total_sectors || nb_sectors > total_sectors - sector) { + return false; + } + return true; +} + typedef struct TrimAIOCB { BlockAIOCB common; IDEState *s; @@ -603,18 +615,6 @@ static void ide_rw_error(IDEState *s) { ide_set_irq(s->bus); } -static bool ide_sect_range_ok(IDEState *s, - uint64_t sector, uint64_t nb_sectors) -{ - uint64_t total_sectors; - - blk_get_geometry(s->blk, &total_sectors); - if (sector > total_sectors || nb_sectors > total_sectors - sector) { - return false; - } - return true; -} - static void ide_buffered_readv_cb(void *opaque, int ret) { IDEBufferedRequest *req = opaque; |