On Sat, Jun 28, 2014 at 10:52 AM, Martin Sucha <[email protected]> wrote:
>
> I don't think it is necessary to check the device size in libblock - in
> case someone attempts to read beyond the end of the device, the block
> device server should already respond with an error code. To prevent
> running the retry loop for permanent failures (such as reading beyond
> the end of a device that does not support resizing [think LVM volume or
> file-based bd]) I'd rather return a different error code to let
> libblock know that it does not need to retry.
Ok.
Jakub? MartinD? Any different opinion about this point?
>
> Otherwise the patch looks good to me except cstyle - the double
> underscores in __block_get_nblocks - I think __ prefix should be used
> only for compiler symbols and the function is static anyway, so it is
> not necessary.
This is just because there is already a function with the same name,
but I needed it to accept different parameters, so I modified the code
in the following way:
int block_get_nblocks(service_id_t service_id, aoff64_t *nblocks)
{
devcon_t *devcon = devcon_search(service_id);
assert(devcon);
return __block_get_nblocks(devcon->bd, nblocks);
}
/** Get number of blocks on device **/
static int __block_get_nblocks(bd_t *bd, aoff64_t *nblocks)
{
return bd_get_num_blocks(bd, nblocks);
}
Cheers,
--
--------------------
Maurizio Lombardi
_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/listinfo/helenos-devel