This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
commit 63cbd8b643ae063d6b62c87ead7b46ee60868c0d
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Wed May 20 03:25:18 2020 +0100
libgfs2: Move get_file_buf() into structures.c
It's only called from there. Open code inode_is_stuffed() as it's simple
enough.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/fs_ops.c | 27 ---------------------------
gfs2/libgfs2/libgfs2.h | 2 --
gfs2/libgfs2/structures.c | 24 ++++++++++++++++++++++++
3 files changed, 24 insertions(+), 29 deletions(-)
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index b5363c0..ee512f6 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -744,33 +744,6 @@ int __gfs2_writei(struct gfs2_inode *ip, void *buf,
return copied;
}
-struct gfs2_buffer_head *get_file_buf(struct gfs2_inode *ip, uint64_t lbn,
- int prealloc)
-{
- struct gfs2_sbd *sdp = ip->i_sbd;
- uint64_t dbn;
- int new = TRUE;
-
- if (inode_is_stuffed(ip))
- unstuff_dinode(ip);
-
- block_map(ip, lbn, &new, &dbn, NULL, prealloc);
- if (!dbn) {
- fprintf(stderr, "get_file_buf\n");
- exit(1);
- }
-
- if (!prealloc && new &&
- ip->i_di.di_size < (lbn + 1) << sdp->sd_sb.sb_bsize_shift) {
- bmodified(ip->i_bh);
- ip->i_di.di_size = (lbn + 1) << sdp->sd_sb.sb_bsize_shift;
- }
- if (dbn == ip->i_di.di_num.no_addr)
- return ip->i_bh;
- else
- return bread(sdp, dbn);
-}
-
int gfs2_dirent_first(struct gfs2_inode *dip, struct gfs2_buffer_head *bh,
struct gfs2_dirent **dent)
{
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index a34e77a..aa500df 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -432,8 +432,6 @@ extern int gfs2_readi(struct gfs2_inode *ip, void *buf, uint64_t
offset,
__gfs2_writei(ip, buf, offset, size, 1)
extern int __gfs2_writei(struct gfs2_inode *ip, void *buf, uint64_t offset,
unsigned int size, int resize);
-extern struct gfs2_buffer_head *get_file_buf(struct gfs2_inode *ip,
- uint64_t lbn, int prealloc);
extern int init_dinode(struct gfs2_sbd *sdp, struct gfs2_buffer_head **bhp, struct
gfs2_inum *inum,
unsigned int mode, uint32_t flags, struct gfs2_inum *parent);
extern struct gfs2_inode *createi(struct gfs2_inode *dip, const char *filename,
diff --git a/gfs2/libgfs2/structures.c b/gfs2/libgfs2/structures.c
index 0aca7cd..1e275bc 100644
--- a/gfs2/libgfs2/structures.c
+++ b/gfs2/libgfs2/structures.c
@@ -194,6 +194,30 @@ int lgfs2_write_journal_data(struct gfs2_inode *ip)
return 0;
}
+static struct gfs2_buffer_head *get_file_buf(struct gfs2_inode *ip, uint64_t lbn, int
prealloc)
+{
+ struct gfs2_sbd *sdp = ip->i_sbd;
+ uint64_t dbn;
+ int new = TRUE;
+
+ if (ip->i_di.di_height == 0)
+ unstuff_dinode(ip);
+
+ block_map(ip, lbn, &new, &dbn, NULL, prealloc);
+ if (!dbn)
+ return NULL;
+
+ if (!prealloc && new &&
+ ip->i_di.di_size < (lbn + 1) << sdp->sd_sb.sb_bsize_shift) {
+ bmodified(ip->i_bh);
+ ip->i_di.di_size = (lbn + 1) << sdp->sd_sb.sb_bsize_shift;
+ }
+ if (dbn == ip->i_di.di_num.no_addr)
+ return ip->i_bh;
+ else
+ return bread(sdp, dbn);
+}
+
int write_journal(struct gfs2_inode *jnl, unsigned bsize, unsigned int blocks)
{
struct gfs2_log_header lh;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.