X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fio%2Fkblock.h;h=f3542947c308c1453a4e44527a8a5ebcb93d3bde;hb=1997bcac9db9a289afa5ca6d4fea4b75aef329d6;hp=8bfe384fb3b6cc076e715f217bb99db362f2366a;hpb=1c11ac0ab0636d07db3899b02c5d89e2d0b020bc;p=bertos.git diff --git a/bertos/io/kblock.h b/bertos/io/kblock.h index 8bfe384f..f3542947 100644 --- a/bertos/io/kblock.h +++ b/bertos/io/kblock.h @@ -69,6 +69,9 @@ * } * \endcode * + * \note The KBlock interface is optimized for block reads. If you need a + * file-like access, you can use \ref kfile_block. + * * \author Francesco Sacchi * * $WIZ$ module_name = "kblock" @@ -192,13 +195,9 @@ typedef struct KBlock * \param start The index of the start block for the limiting window in logical addressing units. * \param count The number of blocks to be used. * + * \return 0 if all is OK, EOF on errors. */ -INLINE void kblock_trim(struct KBlock *b, block_idx_t start, block_idx_t count) -{ - ASSERT(start + count <= b->blk_cnt); - b->priv.blk_start += start; - b->blk_cnt = count; -} +int kblock_trim(struct KBlock *b, block_idx_t start, block_idx_t count); #define KB_ASSERT_METHOD(b, method) \