This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch andyp-removeexit
in repository gfs2-utils.
commit c30414ee8f54a484e86cc6305f6b56a13c7fa17b
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Tue Jan 10 15:37:27 2023 +0000
Remove lgfs2_breadm()
Nothing uses this function as, when a multi-block extent needs to be
read, it's cleaner to avoid using buffer_head structures altogether.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/buf.c | 33 ---------------------------------
gfs2/libgfs2/libgfs2.h | 2 --
2 files changed, 35 deletions(-)
diff --git a/gfs2/libgfs2/buf.c b/gfs2/libgfs2/buf.c
index cb5a3ea4..4de41e35 100644
--- a/gfs2/libgfs2/buf.c
+++ b/gfs2/libgfs2/buf.c
@@ -38,39 +38,6 @@ struct lgfs2_buffer_head *lgfs2_bget(struct lgfs2_sbd *sdp, uint64_t
num)
return bh;
}
-int __lgfs2_breadm(struct lgfs2_sbd *sdp, struct lgfs2_buffer_head **bhs, size_t n,
- uint64_t block, int line, const char *caller)
-{
- size_t v = (n < IOV_MAX) ? n : IOV_MAX;
- struct iovec *iov = alloca(v * sizeof(struct iovec));
- struct iovec *iovbase = iov;
- size_t i = 0;
-
- while (i < n) {
- int j;
- ssize_t ret;
- ssize_t size = 0;
-
- for (j = 0; (i + j < n) && (j < IOV_MAX); j++) {
- bhs[i + j] = lgfs2_bget(sdp, block + i + j);
- if (bhs[i + j] == NULL)
- return -1;
- iov[j] = bhs[i + j]->iov;
- size += bhs[i + j]->iov.iov_len;
- }
-
- ret = preadv(sdp->device_fd, iovbase, j, (block + i) * sdp->sd_bsize);
- if (ret != size) {
- fprintf(stderr, "bad read: %s from %s:%d: block %"PRIu64" "
- "count: %d size: %zd ret: %zd\n", strerror(errno),
- caller, line, block, j, size, ret);
- exit(-1);
- }
- i += j;
- }
- return 0;
-}
-
struct lgfs2_buffer_head *__lgfs2_bread(struct lgfs2_sbd *sdp, uint64_t num, int line,
const char *caller)
{
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 5530ab2b..07a9bf1b 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -459,7 +459,6 @@ extern int lgfs2_field_assign(char *blk, const struct lgfs2_metafield
*field, co
extern struct lgfs2_buffer_head *lgfs2_bget(struct lgfs2_sbd *sdp, uint64_t num);
extern struct lgfs2_buffer_head *__lgfs2_bread(struct lgfs2_sbd *sdp, uint64_t num,
int line, const char *caller);
-extern int __lgfs2_breadm(struct lgfs2_sbd *sdp, struct lgfs2_buffer_head **bhs, size_t
n, uint64_t block, int line, const char *caller);
extern int lgfs2_bwrite(struct lgfs2_buffer_head *bh);
extern int lgfs2_brelse(struct lgfs2_buffer_head *bh);
extern uint32_t lgfs2_get_block_type(const char *buf);
@@ -467,7 +466,6 @@ extern uint32_t lgfs2_get_block_type(const char *buf);
#define lgfs2_bmodified(bh) do { bh->b_modified = 1; } while(0)
#define lgfs2_bread(bl, num) __lgfs2_bread(bl, num, __LINE__, __FUNCTION__)
-#define lgfs2_breadm(bl, bhs, n, block) __lgfs2_breadm(bl, bhs, n, block, __LINE__,
__FUNCTION__)
/* device_geometry.c */
extern int lgfs2_get_dev_info(int fd, struct lgfs2_dev_info *i);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.