[Ocfs2-tools-devel] [PATCH 2/2] o2image: change ocfs2_image_free_bitmap() return value to void

piaojun piaojun at huawei.com
Tue Apr 3 03:59:52 PDT 2018


ocfs2_image_free_bitmap() has no return value, so wo should change its
return value to void.

Signed-off-by: Jun Piao <piaojun at huawei.com>
---
 include/ocfs2/image.h | 2 +-
 libocfs2/image.c      | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/ocfs2/image.h b/include/ocfs2/image.h
index 637f392..1acc191 100644
--- a/include/ocfs2/image.h
+++ b/include/ocfs2/image.h
@@ -100,7 +100,7 @@ struct ocfs2_image_state {
 };

 errcode_t ocfs2_image_load_bitmap(ocfs2_filesys *ofs);
-errcode_t ocfs2_image_free_bitmap(ocfs2_filesys *ofs);
+void ocfs2_image_free_bitmap(ocfs2_filesys *ofs);
 errcode_t ocfs2_image_alloc_bitmap(ocfs2_filesys *ofs);
 void ocfs2_image_mark_bitmap(ocfs2_filesys *ofs, uint64_t blkno);
 int ocfs2_image_test_bit(ocfs2_filesys *ofs, uint64_t blkno);
diff --git a/libocfs2/image.c b/libocfs2/image.c
index 726d385..872bdb3 100644
--- a/libocfs2/image.c
+++ b/libocfs2/image.c
@@ -61,13 +61,13 @@ void ocfs2_image_swap_header(struct ocfs2_image_hdr *hdr)
 	hdr->hdr_superblkcnt	= bswap_64(hdr->hdr_superblkcnt);
 }

-errcode_t ocfs2_image_free_bitmap(ocfs2_filesys *ofs)
+void ocfs2_image_free_bitmap(ocfs2_filesys *ofs)
 {
 	struct ocfs2_image_state *ost = ofs->ost;
 	int i;

 	if (!ost->ost_bmparr)
-		return 0;
+		return;

 	for (i=0; i<ost->ost_bmpblks; i++)
 		if (ost->ost_bmparr[i].arr_self)
@@ -75,7 +75,7 @@ errcode_t ocfs2_image_free_bitmap(ocfs2_filesys *ofs)

 	if (ost->ost_bmparr)
 		ocfs2_free(&ost->ost_bmparr);
-	return 0;
+	return;
 }



More information about the Ocfs2-tools-devel mailing list