block_cache: Change signature of *_etc() functions

* This allows file systems to retrieve the actual error code on a
  failure, and report it to the user.
* All affected file systems have been adjusted to the API change.
  This is a binary incompatible change.

Change-Id: Id73392aaf9c6cb7d643ff9adcb8bf80f3037874c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2913
Reviewed-by: Axel Dörfler <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
Axel Dörfler
2020-06-20 18:10:03 +00:00
committed by waddlesplash
parent cc7b6b5870
commit 93845aec95
18 changed files with 425 additions and 349 deletions
+5 -5
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2004-2008, Haiku Inc. All Rights Reserved.
* Copyright 2004-2020, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _FS_CACHE_H
@@ -66,14 +66,14 @@ extern void block_cache_discard(void *cache, off_t blockNumber,
size_t numBlocks);
extern status_t block_cache_make_writable(void *cache, off_t blockNumber,
int32 transaction);
extern void *block_cache_get_writable_etc(void *cache, off_t blockNumber,
off_t base, off_t length, int32 transaction);
extern status_t block_cache_get_writable_etc(void *cache, off_t blockNumber,
off_t base, off_t length, int32 transaction, void** _block);
extern void *block_cache_get_writable(void *cache, off_t blockNumber,
int32 transaction);
extern void *block_cache_get_empty(void *cache, off_t blockNumber,
int32 transaction);
extern const void *block_cache_get_etc(void *cache, off_t blockNumber,
off_t base, off_t length);
extern status_t block_cache_get_etc(void *cache, off_t blockNumber,
off_t base, off_t length, const void** _block);
extern const void *block_cache_get(void *cache, off_t blockNumber);
extern status_t block_cache_set_dirty(void *cache, off_t blockNumber,
bool isDirty, int32 transaction);
+6 -5
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2004-2008, Haiku Inc. All Rights Reserved.
* Copyright 2004-2020, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _FSSH_FS_CACHE_H
@@ -76,16 +76,17 @@ extern void fssh_block_cache_discard(void *_cache,
fssh_off_t blockNumber, fssh_size_t numBlocks);
extern fssh_status_t fssh_block_cache_make_writable(void *_cache,
fssh_off_t blockNumber, int32_t transaction);
extern void * fssh_block_cache_get_writable_etc(void *_cache,
extern fssh_status_t fssh_block_cache_get_writable_etc(void *_cache,
fssh_off_t blockNumber, fssh_off_t base,
fssh_off_t length, int32_t transaction);
fssh_off_t length, int32_t transaction,
void **_block);
extern void * fssh_block_cache_get_writable(void *_cache,
fssh_off_t blockNumber, int32_t transaction);
extern void * fssh_block_cache_get_empty(void *_cache,
fssh_off_t blockNumber, int32_t transaction);
extern const void * fssh_block_cache_get_etc(void *_cache,
extern fssh_status_t fssh_block_cache_get_etc(void *_cache,
fssh_off_t blockNumber, fssh_off_t base,
fssh_off_t length);
fssh_off_t length, const void **_block);
extern const void * fssh_block_cache_get(void *_cache,
fssh_off_t blockNumber);
extern fssh_status_t fssh_block_cache_set_dirty(void *_cache,