This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
commit 464c6b73a94b1296f5218da3869b69e0f4832ae6
Author: Andrew Price <anprice(a)redhat.com>
Date: Mon Apr 10 17:11:01 2017 +0100
libgfs2: Switch gfs2_log_header_out to use a char buffer
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/fsck/fs_recovery.c | 2 +-
gfs2/libgfs2/libgfs2.h | 4 ++--
gfs2/libgfs2/ondisk.c | 12 ++++++++----
gfs2/libgfs2/structures.c | 4 ++--
gfs2/mkfs/main_jadd.c | 4 +---
5 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c
index 17b2a3a..e50a248 100644
--- a/gfs2/fsck/fs_recovery.c
+++ b/gfs2/fsck/fs_recovery.c
@@ -445,7 +445,7 @@ static int check_journal_seq_no(struct gfs2_inode *ip, int fix)
log_warn( _("Renumbering it as 0x%llx\n"), lh.lh_sequence);
block_map(ip, blk, &new, &dblock, &extlen, FALSE);
bh = bread(ip->i_sbd, dblock);
- gfs2_log_header_out(&lh, bh);
+ gfs2_log_header_out_bh(&lh, bh);
brelse(bh);
}
if (seq_errors && fix) {
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 778238f..2e29d33 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -743,8 +743,8 @@ extern void gfs2_leaf_out(struct gfs2_leaf *lf, struct
gfs2_buffer_head *bh);
extern void gfs2_ea_header_in(struct gfs2_ea_header *ea, char *buf);
extern void gfs2_log_header_in(struct gfs2_log_header *lh,
struct gfs2_buffer_head *bh);
-extern void gfs2_log_header_out(struct gfs2_log_header *lh,
- struct gfs2_buffer_head *bh);
+extern void gfs2_log_header_out(struct gfs2_log_header *lh, char *buf);
+extern void gfs2_log_header_out_bh(struct gfs2_log_header *lh, struct gfs2_buffer_head
*bh);
extern void gfs2_log_descriptor_in(struct gfs2_log_descriptor *ld,
struct gfs2_buffer_head *bh);
extern void gfs2_log_descriptor_out(struct gfs2_log_descriptor *ld,
diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index 3d82509..acedd3e 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -531,17 +531,21 @@ void gfs2_log_header_in(struct gfs2_log_header *lh,
CPIN_32(lh, str, lh_hash);
}
-void gfs2_log_header_out(struct gfs2_log_header *lh,
- struct gfs2_buffer_head *bh)
+void gfs2_log_header_out(struct gfs2_log_header *lh, char *buf)
{
- struct gfs2_log_header *str = (struct gfs2_log_header *)bh->b_data;
+ struct gfs2_log_header *str = (struct gfs2_log_header *)buf;
- gfs2_meta_header_out_bh(&lh->lh_header, bh);
+ gfs2_meta_header_out(&lh->lh_header, buf);
CPOUT_64(lh, str, lh_sequence);
CPOUT_32(lh, str, lh_flags);
CPOUT_32(lh, str, lh_tail);
CPOUT_32(lh, str, lh_blkno);
CPOUT_32(lh, str, lh_hash);
+}
+
+void gfs2_log_header_out_bh(struct gfs2_log_header *lh, struct gfs2_buffer_head *bh)
+{
+ gfs2_log_header_out(lh, bh->iov.iov_base);
bmodified(bh);
}
diff --git a/gfs2/libgfs2/structures.c b/gfs2/libgfs2/structures.c
index e8247bf..2d97dab 100644
--- a/gfs2/libgfs2/structures.c
+++ b/gfs2/libgfs2/structures.c
@@ -132,7 +132,7 @@ int lgfs2_write_journal_data(struct gfs2_inode *ip)
do {
lh.lh_sequence = seq;
lh.lh_blkno = bh->b_blocknr - jext0;
- gfs2_log_header_out(&lh, bh);
+ gfs2_log_header_out_bh(&lh, bh);
hash = gfs2_disk_hash(bh->b_data, sizeof(struct gfs2_log_header));
((struct gfs2_log_header *)bh->b_data)->lh_hash = cpu_to_be32(hash);
@@ -184,7 +184,7 @@ int write_journal(struct gfs2_inode *jnl, unsigned bsize, unsigned int
blocks)
memset(bh->b_data, 0, bsize);
lh.lh_sequence = seq;
lh.lh_blkno = x;
- gfs2_log_header_out(&lh, bh);
+ gfs2_log_header_out_bh(&lh, bh);
hash = gfs2_disk_hash(bh->b_data, sizeof(struct gfs2_log_header));
((struct gfs2_log_header *)bh->b_data)->lh_hash = cpu_to_be32(hash);
diff --git a/gfs2/mkfs/main_jadd.c b/gfs2/mkfs/main_jadd.c
index de5d9c5..3681b90 100644
--- a/gfs2/mkfs/main_jadd.c
+++ b/gfs2/mkfs/main_jadd.c
@@ -454,12 +454,10 @@ static void add_j(struct gfs2_sbd *sdp, struct jadd_opts *opts)
for (x=0; x<blocks; x++) {
uint32_t hash;
- struct gfs2_buffer_head dummy_bh;
- dummy_bh.b_data = buf;
lh.lh_sequence = seq;
lh.lh_blkno = x;
- gfs2_log_header_out(&lh, &dummy_bh);
+ gfs2_log_header_out(&lh, buf);
hash = gfs2_disk_hash(buf, sizeof(struct gfs2_log_header));
((struct gfs2_log_header *)buf)->lh_hash = cpu_to_be32(hash);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.