dm persistent data: eliminate unnecessary return values
dm_bm_unlock and dm_tm_unlock return an integer value but the returned value is always 0. The calling code sometimes checks the return value and sometimes doesn't. Eliminate these unnecessary return values and also the checks for them. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
This commit is contained in:

committed by
Mike Snitzer

parent
dbba42d8a9
commit
4c7da06f5a
@@ -343,7 +343,9 @@ static int superblock_all_zeroes(struct dm_block_manager *bm, bool *result)
|
||||
}
|
||||
}
|
||||
|
||||
return dm_bm_unlock(b);
|
||||
dm_bm_unlock(b);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------*/
|
||||
@@ -582,7 +584,9 @@ static int open_metadata(struct era_metadata *md)
|
||||
md->metadata_snap = le64_to_cpu(disk->metadata_snap);
|
||||
md->archived_writesets = true;
|
||||
|
||||
return dm_bm_unlock(sblock);
|
||||
dm_bm_unlock(sblock);
|
||||
|
||||
return 0;
|
||||
|
||||
bad:
|
||||
dm_bm_unlock(sblock);
|
||||
@@ -1046,12 +1050,7 @@ static int metadata_take_snap(struct era_metadata *md)
|
||||
|
||||
md->metadata_snap = dm_block_location(clone);
|
||||
|
||||
r = dm_tm_unlock(md->tm, clone);
|
||||
if (r) {
|
||||
DMERR("%s: couldn't unlock clone", __func__);
|
||||
md->metadata_snap = SUPERBLOCK_LOCATION;
|
||||
return r;
|
||||
}
|
||||
dm_tm_unlock(md->tm, clone);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user