From e8a2b5433361eeb9afce2468b9381af8b2db913a Mon Sep 17 00:00:00 2001 From: Tomohiro Kusumi Date: Wed, 12 Apr 2017 23:24:04 +0300 Subject: [PATCH] sbin/hammer: Make some readonly pointer args const --- sbin/hammer/hammer_util.h | 6 +++--- sbin/hammer/ondisk.c | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sbin/hammer/hammer_util.h b/sbin/hammer/hammer_util.h index 671c887a24..8607d0e2f5 100644 --- a/sbin/hammer/hammer_util.h +++ b/sbin/hammer/hammer_util.h @@ -121,8 +121,8 @@ extern const char *zone_labels[]; volume_info_t init_volume(const char *filename, int oflags, int32_t vol_no); volume_info_t load_volume(const char *filename, int oflags, int verify); -int is_regfile(volume_info_t volume); -void assert_volume_offset(volume_info_t volume); +int is_regfile(const volume_info_t volume); +void assert_volume_offset(const volume_info_t volume); volume_info_t get_volume(int32_t vol_no); volume_info_t get_root_volume(void); void rel_buffer(buffer_info_t buffer); @@ -135,7 +135,7 @@ void *alloc_meta_element(hammer_off_t *offp, int32_t data_len, void format_blockmap(volume_info_t root_vol, int zone, hammer_off_t offset); void format_freemap(volume_info_t root_vol); int64_t initialize_freemap(volume_info_t volume); -int64_t count_freemap(volume_info_t volume); +int64_t count_freemap(const volume_info_t volume); void format_undomap(volume_info_t root_vol, int64_t *undo_buffer_size); void print_blockmap(const volume_info_t volume); void flush_all_volumes(void); diff --git a/sbin/hammer/ondisk.c b/sbin/hammer/ondisk.c index 28f59afb62..0754ff93a1 100644 --- a/sbin/hammer/ondisk.c +++ b/sbin/hammer/ondisk.c @@ -109,7 +109,7 @@ __alloc_volume(const char *volname, int oflags) } static void -__add_volume(volume_info_t volume) +__add_volume(const volume_info_t volume) { volume_info_t scan; struct stat st1, st2; @@ -142,7 +142,7 @@ __add_volume(volume_info_t volume) } static void -__verify_volume(volume_info_t volume) +__verify_volume(const volume_info_t volume) { hammer_volume_ondisk_t ondisk = volume->ondisk; @@ -263,13 +263,13 @@ check_volume(volume_info_t volume) } int -is_regfile(volume_info_t volume) +is_regfile(const volume_info_t volume) { return(strcmp(volume->type, "REGFILE") ? 0 : 1); } void -assert_volume_offset(volume_info_t volume) +assert_volume_offset(const volume_info_t volume) { assert(hammer_is_zone_raw_buffer(volume->vol_free_off)); assert(hammer_is_zone_raw_buffer(volume->vol_free_end)); @@ -389,7 +389,7 @@ get_buffer(hammer_off_t buf_offset, int isnew) } static void -get_buffer_readahead(buffer_info_t base) +get_buffer_readahead(const buffer_info_t base) { buffer_info_t buffer; volume_info_t volume; @@ -675,7 +675,7 @@ initialize_freemap(volume_info_t volume) * without formatting. */ int64_t -count_freemap(volume_info_t volume) +count_freemap(const volume_info_t volume) { hammer_off_t phys_offset; hammer_off_t vol_free_off; -- 2.11.4.GIT