Changeset 5cde90f in mainline for uspace/srv/bd/file_bd/file_bd.c


Ignore:
Timestamp:
2010-02-19T17:16:46Z (14 years ago)
Author:
Pavel Rimsky <pavel@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
617652f
Parents:
b86d436 (diff), f41aa81 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Synchronizing with head (which has just been synchronized with this branch).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/bd/file_bd/file_bd.c

    rb86d436 r5cde90f  
    4848#include <devmap.h>
    4949#include <sys/types.h>
     50#include <sys/typefmt.h>
    5051#include <errno.h>
    5152#include <bool.h>
     
    5657
    5758static const size_t block_size = 512;
    58 static bn_t num_blocks;
     59static aoff64_t num_blocks;
    5960static FILE *img;
    6061
     
    207208        int rc;
    208209
     210        /* Check whether access is within device address bounds. */
     211        if (ba + cnt > num_blocks) {
     212                printf(NAME ": Accessed blocks %" PRIuOFF64 "-%" PRIuOFF64 ", while "
     213                    "max block number is %" PRIuOFF64 ".\n", ba, ba + cnt - 1,
     214                    num_blocks - 1);
     215                return ELIMIT;
     216        }
     217
    209218        fibril_mutex_lock(&dev_lock);
    210219
     
    237246        int rc;
    238247
     248        /* Check whether access is within device address bounds. */
     249        if (ba + cnt > num_blocks) {
     250                printf(NAME ": Accessed blocks %" PRIuOFF64 "-%" PRIuOFF64 ", while "
     251                    "max block number is %" PRIuOFF64 ".\n", ba, ba + cnt - 1,
     252                    num_blocks - 1);
     253                return ELIMIT;
     254        }
     255
    239256        fibril_mutex_lock(&dev_lock);
    240257
Note: See TracChangeset for help on using the changeset viewer.