Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=d5b8d681a69... Commit: d5b8d681a696c777a3d5b385383242b0d4dc4190 Parent: 7da3d6f74c69e710de718013b88898f5b69eb4b9 Author: Andrew Price anprice@redhat.com AuthorDate: Thu Apr 3 06:10:37 2014 -0500 Committer: Andrew Price anprice@redhat.com CommitterDate: Thu Apr 3 06:13:22 2014 -0500
libgfs2: Const-ify the 'ri' argument to gfs2_rindex_out
This function shouldn't modify its ri argument and the const helps when we want to pass it the return value of one of the newly-const lgfs2_rgrp_{index,rgrp} functions (the rgrp arg to gfs2_rgrp_out is already const so no change needed).
Signed-off-by: Andrew Price anprice@redhat.com --- gfs2/libgfs2/libgfs2.h | 2 +- gfs2/libgfs2/ondisk.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h index 455f01d..3353f5f 100644 --- a/gfs2/libgfs2/libgfs2.h +++ b/gfs2/libgfs2/libgfs2.h @@ -802,7 +802,7 @@ extern void gfs2_meta_header_out_bh(const struct gfs2_meta_header *mh, extern void gfs2_sb_in(struct gfs2_sb *sb, struct gfs2_buffer_head *bh); extern void gfs2_sb_out(const struct gfs2_sb *sb, char *buf); extern void gfs2_rindex_in(struct gfs2_rindex *ri, char *buf); -extern void gfs2_rindex_out(struct gfs2_rindex *ri, char *buf); +extern void gfs2_rindex_out(const struct gfs2_rindex *ri, char *buf); extern void gfs2_rgrp_in(struct gfs2_rgrp *rg, struct gfs2_buffer_head *bh); extern void gfs2_rgrp_out(const struct gfs2_rgrp *rg, char *buf); extern void gfs2_rgrp_out_bh(const struct gfs2_rgrp *rg, struct gfs2_buffer_head *bh); diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c index 3fbc63f..1f81b5f 100644 --- a/gfs2/libgfs2/ondisk.c +++ b/gfs2/libgfs2/ondisk.c @@ -213,13 +213,13 @@ void gfs2_rindex_in(struct gfs2_rindex *ri, char *buf) CPIN_08(ri, str, ri_reserved, 64); }
-void gfs2_rindex_out(struct gfs2_rindex *ri, char *buf) +void gfs2_rindex_out(const struct gfs2_rindex *ri, char *buf) { struct gfs2_rindex *str = (struct gfs2_rindex *)buf;
CPOUT_64(ri, str, ri_addr); CPOUT_32(ri, str, ri_length); - ri->__pad = 0; + str->__pad = 0;
CPOUT_64(ri, str, ri_data0); CPOUT_32(ri, str, ri_data);
cluster-commits@lists.fedorahosted.org