From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Price Date: Thu, 3 Apr 2014 16:12:43 +0100 Subject: [Cluster-devel] [PATCH 10/14] libgfs2: Const-ify the 'ri' argument to gfs2_rindex_out In-Reply-To: <1396537967-12399-1-git-send-email-anprice@redhat.com> References: <1396537967-12399-1-git-send-email-anprice@redhat.com> Message-ID: <1396537967-12399-11-git-send-email-anprice@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 --- 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); -- 1.8.5.3