This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
commit a51ecda4156895705fe0d071218b2ca7188e718e
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Sat May 23 23:09:43 2020 +0100
savemeta: Remove gfs2_buffer_head from save_block()
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/edit/savemeta.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 47c998c..8afa8e6 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -572,19 +572,28 @@ static int save_buf(struct metafd *mfd, const char *buf, uint64_t
addr, uint64_t
static int save_block(int fd, struct metafd *mfd, uint64_t blk, uint64_t owner, int
*blktype)
{
- struct gfs2_buffer_head *savebh;
+ char *buf;
int err;
+ buf = calloc(1, sbd.bsize);
+ if (buf == NULL) {
+ fprintf(stderr, "Failed to read block 0x%"PRIx64" (in
0x%"PRIx64"): %s\n",
+ blk, owner, strerror(errno));
+ return 1;
+ }
if (gfs2_check_range(&sbd, blk) && blk != LGFS2_SB_ADDR(&sbd)) {
fprintf(stderr, "Warning: bad pointer 0x%"PRIx64" ignored in block
0x%"PRIx64"\n",
blk, owner);
return 0;
}
- savebh = bread(&sbd, blk);
- if (savebh == NULL)
+ if (pread(sbd.device_fd, buf, sbd.bsize, sbd.bsize * blk) != sbd.bsize) {
+ fprintf(stderr, "Failed to read block 0x%"PRIx64" (in
0x%"PRIx64"): %s\n",
+ blk, owner, strerror(errno));
+ free(buf);
return 1;
- err = save_buf(mfd, savebh->b_data, blk, owner, blktype);
- brelse(savebh);
+ }
+ err = save_buf(mfd, buf, blk, owner, blktype);
+ free(buf);
return err;
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.