gfs2-utils: RHEL7 - libgfs2: Const-ify the 'ri' argument to gfs2_rindex_out
Andrew Price
andyp at fedoraproject.org
Mon Sep 8 17:33:29 UTC 2014
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=2e09a76e3cf522b4fd85f8008af522670c072720
Commit: 2e09a76e3cf522b4fd85f8008af522670c072720
Parent: 80a42f9698504cc82c137950f8cac6bf19373a0c
Author: Andrew Price <anprice at redhat.com>
AuthorDate: Thu Apr 3 06:10:37 2014 -0500
Committer: Andrew Price <anprice at redhat.com>
CommitterDate: Thu Jul 24 17:15:39 2014 +0100
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 at 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);
More information about the cluster-commits
mailing list