From: Andrew Price <anprice@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 10/19] libgfs2: Const-ify the parameters of print functions
Date: Tue, 2 Sep 2014 13:07:27 +0100 [thread overview]
Message-ID: <1409659656-23051-11-git-send-email-anprice@redhat.com> (raw)
In-Reply-To: <1409659656-23051-1-git-send-email-anprice@redhat.com>
This allows us to use the *_print functions to print const types, which
works better with values returned from functions such as
lgfs2_rgrp_index()
Signed-off-by: Andrew Price <anprice@redhat.com>
---
gfs2/libgfs2/libgfs2.h | 26 +++++++++++++-------------
gfs2/libgfs2/ondisk.c | 26 +++++++++++++-------------
2 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index fca90b0..ed1030c 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -799,19 +799,19 @@ extern void gfs2_quota_change_out(struct gfs2_quota_change *qc,
/* Printing functions */
-extern void gfs2_inum_print(struct gfs2_inum *no);
-extern void gfs2_meta_header_print(struct gfs2_meta_header *mh);
-extern void gfs2_sb_print(struct gfs2_sb *sb);
-extern void gfs2_rindex_print(struct gfs2_rindex *ri);
-extern void gfs2_rgrp_print(struct gfs2_rgrp *rg);
-extern void gfs2_quota_print(struct gfs2_quota *qu);
-extern void gfs2_dinode_print(struct gfs2_dinode *di);
-extern void gfs2_leaf_print(struct gfs2_leaf *lf);
-extern void gfs2_ea_header_print(struct gfs2_ea_header *ea, char *name);
-extern void gfs2_log_header_print(struct gfs2_log_header *lh);
-extern void gfs2_log_descriptor_print(struct gfs2_log_descriptor *ld);
-extern void gfs2_statfs_change_print(struct gfs2_statfs_change *sc);
-extern void gfs2_quota_change_print(struct gfs2_quota_change *qc);
+extern void gfs2_inum_print(const struct gfs2_inum *no);
+extern void gfs2_meta_header_print(const struct gfs2_meta_header *mh);
+extern void gfs2_sb_print(const struct gfs2_sb *sb);
+extern void gfs2_rindex_print(const struct gfs2_rindex *ri);
+extern void gfs2_rgrp_print(const struct gfs2_rgrp *rg);
+extern void gfs2_quota_print(const struct gfs2_quota *qu);
+extern void gfs2_dinode_print(const struct gfs2_dinode *di);
+extern void gfs2_leaf_print(const struct gfs2_leaf *lf);
+extern void gfs2_ea_header_print(const struct gfs2_ea_header *ea, char *name);
+extern void gfs2_log_header_print(const struct gfs2_log_header *lh);
+extern void gfs2_log_descriptor_print(const struct gfs2_log_descriptor *ld);
+extern void gfs2_statfs_change_print(const struct gfs2_statfs_change *sc);
+extern void gfs2_quota_change_print(const struct gfs2_quota_change *qc);
/* Language functions */
diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index 1f81b5f..4744337 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -56,7 +56,7 @@ void gfs2_inum_out(const struct gfs2_inum *no, char *buf)
CPOUT_64(no, str, no_addr);
}
-void gfs2_inum_print(struct gfs2_inum *no)
+void gfs2_inum_print(const struct gfs2_inum *no)
{
pv(no, no_formal_ino, "%llu", "0x%llx");
pv(no, no_addr, "%llu", "0x%llx");
@@ -90,7 +90,7 @@ void gfs2_meta_header_out_bh(const struct gfs2_meta_header *mh,
bmodified(bh);
}
-void gfs2_meta_header_print(struct gfs2_meta_header *mh)
+void gfs2_meta_header_print(const struct gfs2_meta_header *mh)
{
pv(mh, mh_magic, "0x%08X", NULL);
pv(mh, mh_type, "%u", "0x%x");
@@ -177,7 +177,7 @@ void gfs2_print_uuid(const unsigned char *uuid)
}
#endif
-void gfs2_sb_print(struct gfs2_sb *sb)
+void gfs2_sb_print(const struct gfs2_sb *sb)
{
gfs2_meta_header_print(&sb->sb_header);
@@ -229,7 +229,7 @@ void gfs2_rindex_out(const struct gfs2_rindex *ri, char *buf)
CPOUT_08(ri, str, ri_reserved, 64);
}
-void gfs2_rindex_print(struct gfs2_rindex *ri)
+void gfs2_rindex_print(const struct gfs2_rindex *ri)
{
pv(ri, ri_addr, "%llu", "0x%llx");
pv(ri, ri_length, "%u", "0x%x");
@@ -270,7 +270,7 @@ void gfs2_rgrp_out_bh(const struct gfs2_rgrp *rg, struct gfs2_buffer_head *bh)
bmodified(bh);
}
-void gfs2_rgrp_print(struct gfs2_rgrp *rg)
+void gfs2_rgrp_print(const struct gfs2_rgrp *rg)
{
gfs2_meta_header_print(&rg->rg_header);
pv(rg, rg_flags, "%u", "0x%x");
@@ -298,7 +298,7 @@ void gfs2_quota_out(struct gfs2_quota *qu, char *buf)
memset(qu->qu_reserved, 0, sizeof(qu->qu_reserved));
}
-void gfs2_quota_print(struct gfs2_quota *qu)
+void gfs2_quota_print(const struct gfs2_quota *qu)
{
pv(qu, qu_limit, "%llu", "0x%llx");
pv(qu, qu_warn, "%llu", "0x%llx");
@@ -376,7 +376,7 @@ void gfs2_dinode_out(struct gfs2_dinode *di, struct gfs2_buffer_head *bh)
bmodified(bh);
}
-void gfs2_dinode_print(struct gfs2_dinode *di)
+void gfs2_dinode_print(const struct gfs2_dinode *di)
{
gfs2_meta_header_print(&di->di_header);
gfs2_inum_print(&di->di_num);
@@ -470,7 +470,7 @@ void gfs2_leaf_out(struct gfs2_leaf *lf, struct gfs2_buffer_head *bh)
bmodified(bh);
}
-void gfs2_leaf_print(struct gfs2_leaf *lf)
+void gfs2_leaf_print(const struct gfs2_leaf *lf)
{
gfs2_meta_header_print(&lf->lf_header);
pv(lf, lf_depth, "%u", "0x%x");
@@ -497,7 +497,7 @@ void gfs2_ea_header_in(struct gfs2_ea_header *ea, char *buf)
ea->ea_num_ptrs = str->ea_num_ptrs;
}
-void gfs2_ea_header_print(struct gfs2_ea_header *ea, char *name)
+void gfs2_ea_header_print(const struct gfs2_ea_header *ea, char *name)
{
char buf[GFS2_EA_MAX_NAME_LEN + 1];
@@ -540,7 +540,7 @@ void gfs2_log_header_out(struct gfs2_log_header *lh,
bmodified(bh);
}
-void gfs2_log_header_print(struct gfs2_log_header *lh)
+void gfs2_log_header_print(const struct gfs2_log_header *lh)
{
gfs2_meta_header_print(&lh->lh_header);
pv(lh, lh_sequence, "%llu", "0x%llx");
@@ -579,7 +579,7 @@ void gfs2_log_descriptor_out(struct gfs2_log_descriptor *ld,
bmodified(bh);
}
-void gfs2_log_descriptor_print(struct gfs2_log_descriptor *ld)
+void gfs2_log_descriptor_print(const struct gfs2_log_descriptor *ld)
{
gfs2_meta_header_print(&ld->ld_header);
pv(ld, ld_type, "%u", "0x%x");
@@ -606,7 +606,7 @@ void gfs2_statfs_change_out(struct gfs2_statfs_change *sc, char *buf)
CPOUT_64(sc, str, sc_dinodes);
}
-void gfs2_statfs_change_print(struct gfs2_statfs_change *sc)
+void gfs2_statfs_change_print(const struct gfs2_statfs_change *sc)
{
pv(sc, sc_total, "%lld", "0x%llx");
pv(sc, sc_free, "%lld", "0x%llx");
@@ -636,7 +636,7 @@ void gfs2_quota_change_out(struct gfs2_quota_change *qc,
bmodified(bh);
}
-void gfs2_quota_change_print(struct gfs2_quota_change *qc)
+void gfs2_quota_change_print(const struct gfs2_quota_change *qc)
{
pv(qc, qc_change, "%lld", "0x%llx");
pv(qc, qc_flags, "0x%.8X", NULL);
--
1.9.3
next prev parent reply other threads:[~2014-09-02 12:07 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-02 12:07 [Cluster-devel] [PATCH 00/19] gfs2-utils: Introduce extent allocation and speed up journal creation Andrew Price
2014-09-02 12:07 ` [Cluster-devel] [PATCH 01/19] libgfs2: Keep a pointer to the sbd in lgfs2_rgrps_t Andrew Price
2014-09-02 12:07 ` [Cluster-devel] [PATCH 02/19] libgfs2: Move bitmap buffers inside struct gfs2_bitmap Andrew Price
2014-09-02 12:07 ` [Cluster-devel] [PATCH 03/19] libgfs2: Fix an impossible loop condition in gfs2_rgrp_read Andrew Price
2014-09-02 12:07 ` [Cluster-devel] [PATCH 04/19] libgfs2: Introduce struct lgfs2_rbm Andrew Price
2014-09-02 12:07 ` [Cluster-devel] [PATCH 05/19] libgfs2: Move struct _lgfs2_rgrps into rgrp.h Andrew Price
2014-09-02 12:07 ` [Cluster-devel] [PATCH 06/19] libgfs2: Add functions for finding free extents Andrew Price
2014-09-03 10:17 ` Steven Whitehouse
2014-09-03 12:13 ` Andrew Price
2014-09-03 12:24 ` Steven Whitehouse
2014-09-02 12:07 ` [Cluster-devel] [PATCH 07/19] tests: Add unit tests for the new extent search functions Andrew Price
2014-09-02 12:07 ` [Cluster-devel] [PATCH 08/19] libgfs2: Ignore an empty rgrp plan if a length is specified Andrew Price
2014-09-02 12:07 ` [Cluster-devel] [PATCH 09/19] libgfs2: Add back-pointer to rgrps in lgfs2_rgrp_t Andrew Price
2014-09-02 12:07 ` Andrew Price [this message]
2014-09-02 12:07 ` [Cluster-devel] [PATCH 11/19] libgfs2: Allow init_dinode to accept a preallocated bh Andrew Price
2014-09-02 12:07 ` [Cluster-devel] [PATCH 12/19] libgfs2: Add extent allocation functions Andrew Price
2014-09-02 12:07 ` [Cluster-devel] [PATCH 13/19] libgfs2: Add support for allocating entire rgrp headers Andrew Price
2014-09-02 12:07 ` [Cluster-devel] [PATCH 14/19] libgfs2: Write file metadata sequentially Andrew Price
2014-09-02 12:07 ` [Cluster-devel] [PATCH 15/19] libgfs2: Fix alignment in lgfs2_rgsize_for_data Andrew Price
2014-09-02 12:07 ` [Cluster-devel] [PATCH 16/19] libgfs2: Handle non-zero bitmaps in lgfs2_rgrp_write Andrew Price
2014-09-02 12:07 ` [Cluster-devel] [PATCH 17/19] libgfs2: Add a speedier journal data block writing function Andrew Price
2014-09-02 12:07 ` [Cluster-devel] [PATCH 18/19] libgfs2: Create jindex directory separately from journals Andrew Price
2014-09-02 12:07 ` [Cluster-devel] [PATCH 19/19] mkfs.gfs2: Improve journal creation performance Andrew Price
2014-09-02 14:06 ` [Cluster-devel] [PATCH 00/19] gfs2-utils: Introduce extent allocation and speed up journal creation Bob Peterson
2014-09-03 10:20 ` Steven Whitehouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1409659656-23051-11-git-send-email-anprice@redhat.com \
--to=anprice@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).