Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=8c1297bf8cb... Commit: 8c1297bf8cbb8f34bb2b635dd92d4cf5c3357363 Parent: 98af5fe66d6a82dbf8aa4ca41d987ba005299c1e Author: Andrew Price anprice@redhat.com AuthorDate: Tue Jun 4 11:24:37 2013 +0100 Committer: Andrew Price anprice@redhat.com CommitterDate: Tue Jun 4 11:56:19 2013 +0100
libgfs2: Remove dinode_alloc
Switch the remaining users of dinode_alloc() to lgfs2_dinode_alloc and remove it.
Signed-off-by: Andrew Price anprice@redhat.com --- gfs2/libgfs2/fs_ops.c | 6 ------ gfs2/libgfs2/libgfs2.h | 1 - gfs2/libgfs2/structures.c | 10 ++++++++-- 3 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c index 36cd789..4a84687 100644 --- a/gfs2/libgfs2/fs_ops.c +++ b/gfs2/libgfs2/fs_ops.c @@ -237,12 +237,6 @@ uint64_t meta_alloc(struct gfs2_inode *ip) return x; }
-uint64_t dinode_alloc(struct gfs2_sbd *sdp) -{ - sdp->dinodes_alloced++; - return blk_alloc_i(sdp, DINODE); -} - /** * Allocate a dinode block in a bitmap. In order to plan ahead we look for a * resource group with blksreq free blocks but only allocate the one dinode block. diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h index 0d2f87f..8502abf 100644 --- a/gfs2/libgfs2/libgfs2.h +++ b/gfs2/libgfs2/libgfs2.h @@ -435,7 +435,6 @@ extern struct gfs2_inode *is_system_inode(struct gfs2_sbd *sdp, extern void inode_put(struct gfs2_inode **ip); extern uint64_t data_alloc(struct gfs2_inode *ip); extern uint64_t meta_alloc(struct gfs2_inode *ip); -extern uint64_t dinode_alloc(struct gfs2_sbd *sdp); extern int lgfs2_dinode_alloc(struct gfs2_sbd *sdp, const uint64_t blksreq, uint64_t *blkno); extern int gfs2_readi(struct gfs2_inode *ip, void *buf, uint64_t offset, unsigned int size); diff --git a/gfs2/libgfs2/structures.c b/gfs2/libgfs2/structures.c index 46fd8df..2a8c6f7 100644 --- a/gfs2/libgfs2/structures.c +++ b/gfs2/libgfs2/structures.c @@ -19,8 +19,11 @@ int build_master(struct gfs2_sbd *sdp) struct gfs2_inum inum; uint64_t bn; struct gfs2_buffer_head *bh; + int err = lgfs2_dinode_alloc(sdp, 1, &bn); + + if (err != 0) + return -1;
- bn = dinode_alloc(sdp); inum.no_formal_ino = sdp->md.next_inum++; inum.no_addr = bn;
@@ -425,8 +428,11 @@ int build_root(struct gfs2_sbd *sdp) struct gfs2_inum inum; uint64_t bn; struct gfs2_buffer_head *bh; + int err = lgfs2_dinode_alloc(sdp, 1, &bn); + + if (err != 0) + return -1;
- bn = dinode_alloc(sdp); inum.no_formal_ino = sdp->md.next_inum++; inum.no_addr = bn;