提交 dd8b0c20 编写于 作者: J Joe Thornber 提交者: Mike Snitzer

dm cache metadata: return bool from __superblock_all_zeroes

Signed-off-by: NJoe Thornber <ejt@redhat.com>
Signed-off-by: NMike Snitzer <snitzer@redhat.com>
上级 0184b44e
...@@ -198,7 +198,7 @@ static int superblock_lock(struct dm_cache_metadata *cmd, ...@@ -198,7 +198,7 @@ static int superblock_lock(struct dm_cache_metadata *cmd,
/*----------------------------------------------------------------*/ /*----------------------------------------------------------------*/
static int __superblock_all_zeroes(struct dm_block_manager *bm, int *result) static int __superblock_all_zeroes(struct dm_block_manager *bm, bool *result)
{ {
int r; int r;
unsigned i; unsigned i;
...@@ -214,10 +214,10 @@ static int __superblock_all_zeroes(struct dm_block_manager *bm, int *result) ...@@ -214,10 +214,10 @@ static int __superblock_all_zeroes(struct dm_block_manager *bm, int *result)
return r; return r;
data_le = dm_block_data(b); data_le = dm_block_data(b);
*result = 1; *result = true;
for (i = 0; i < sb_block_size; i++) { for (i = 0; i < sb_block_size; i++) {
if (data_le[i] != zero) { if (data_le[i] != zero) {
*result = 0; *result = false;
break; break;
} }
} }
...@@ -411,7 +411,8 @@ static int __open_metadata(struct dm_cache_metadata *cmd) ...@@ -411,7 +411,8 @@ static int __open_metadata(struct dm_cache_metadata *cmd)
static int __open_or_format_metadata(struct dm_cache_metadata *cmd, static int __open_or_format_metadata(struct dm_cache_metadata *cmd,
bool format_device) bool format_device)
{ {
int r, unformatted; int r;
bool unformatted = false;
r = __superblock_all_zeroes(cmd->bm, &unformatted); r = __superblock_all_zeroes(cmd->bm, &unformatted);
if (r) if (r)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册