Now that we guarantee journals to be allocated contiguously, and the
block allocation has been separated out, we can speed up the journal
data writing process by simply generating the blocks and writing them
sequentially without consulting the resource group bitmaps each time a
new block is
Keep a pointer from a resource group to the resource group set it
belongs to for convenience and also to make lgfs2_rgrp_write a more
sensible interface.
Signed-off-by: Andrew Price anpr...@redhat.com
---
gfs2/libgfs2/libgfs2.h | 5 +++--
gfs2/libgfs2/rgrp.c| 4 +++-
gfs2/mkfs/main_grow.c |
Correct a loop which expects an unsigned int to become negative.
Signed-off-by: Andrew Price anpr...@redhat.com
---
gfs2/libgfs2/rgrp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gfs2/libgfs2/rgrp.c b/gfs2/libgfs2/rgrp.c
index e929846..56b73ae 100644
---
lgfs2_rindex_entry_new previously failed if the rgrp layout plan was
empty even if the caller specified an rgrp length.
Also tidy up a couple of function comments.
Signed-off-by: Andrew Price anpr...@redhat.com
---
gfs2/libgfs2/rgrp.c | 10 +++---
1 file changed, 7 insertions(+), 3
Port gfs2_rbm_find and some functions which it depends on from the gfs2
kernel code. This will set the base for allocation of single-extent
files. The functions have been simplified where possible as libgfs2
doesn't have a concept of reservations for the time being.
Signed-off-by: Andrew Price
Previously journals were created indirectly via build_jindex and the
jindex inode (and therefore the master inode) was created before the
journals. Now that we're allocating the journals in whole resource
groups at the start of the mkfs process we need a way to create the
jindex after the journals
Other parts of libgfs2 will need to know the struct behind lgfs2_rgrps_t
in future patches so move it into rgrp.h. Also make its sdp field
non-const as the struct it points to will be modified.
Signed-off-by: Andrew Price anpr...@redhat.com
---
gfs2/libgfs2/libgfs2.h | 2 +-
gfs2/libgfs2/rgrp.c
Previously, lgfs2_rgrp_write had been used only for writing new resource
groups where the bitmaps were all zero. Fix it to write the bitmap
buffers already present in the resource group structure directly.
Signed-off-by: Andrew Price anpr...@redhat.com
---
gfs2/libgfs2/rgrp.c | 32
This allows us to use the *_print functions to print const types, which
works better with values returned from functions such as
lgfs2_rgrp_index()
Signed-off-by: Andrew Price anpr...@redhat.com
---
gfs2/libgfs2/libgfs2.h | 26 +-
gfs2/libgfs2/ondisk.c | 26
As a set of resource groups is tied to a particular file system (block
size, device length...) it makes sense to keep a reference to the file
system in the lgfs2_rgrps_t type. This allows us to avoid duplication of
the bsize and device length fields, reduces parameter counts and
provides a
Before we can allocate files without writing buffers back to disk
immediately we need to hold the bitmap blocks for one rgrp in memory.
Add a lgfs2_rgrp_bitbuf_alloc() function which allocates the memory for
a resource group's bitmap blocks in one chunk, and also a matching _free
function.
Now that all of the journal extent allocation and writing building
blocks are in place in libgfs2, we can make use of them in mkfs.gfs2 to
write the journals sequentially and in-order with the resource group
blocks. This patch is a little messy because the changes had to be
introduced at the same
Add struct lgfs2_rbm, which is similar to struct gfs2_rbm in the kernel,
in order to support the coming work on extent allocation in libgfs2.
This structure and its supporting functions are added to a new private
header file rather than libgfs2.h until we have reason to export it.
Signed-off-by:
Keeping an array of buffers alongside the array of bitmaps meant some
extra management and bookkeeping for arrays of buffer pointers. Move the
buffer pointers into the bitmap structures.
The only downside to this is that reading resource groups gets a little
more complicated and an intermediate
The rbm search functions added by the previous commit added a certain
amount of complexity. These unit tests go a long way to making sure
they're doing what they're meant to do, and also demonstrate how the new
rgrp functions work without any i/o required.
The unit test sources have also been
In order to preallocate journals as single extents we need functions
which allow bitmap allocation separate from buffer allocation and
writing. This adds two functions, lgfs2_file_alloc and
lgfs2_alloc_extent, which solve this problem, making use of the new
lgfs2_rbm functions.
Signed-off-by:
Align the result of this function such that it matches the alignment
done by other functions which calculate a resource group size. This
avoids a situation where the resource group size is smaller than the
contents meant to fill it (e.g. journal file extents).
Signed-off-by: Andrew Price
Until now the journal creation functions built up the height of the
journal metadata using incremental allocation and the build_height
function which grows a file naively. Two things are about to change:
1. We will guarantee that a journal will occupy a single extent.
2. Journals will be written
Previously init_dinode() always allocated the bh with bget() which meant
less control over memory allocation higher up. This patch changes the
signature of init_dinode to accept a bh pointer and only allocates a new
bh if it is NULL. Also adds error checking to init_dinode()'s callers.
- Original Message -
One thing to note is that, with these patches, the root and master inodes are
no longer the first objects in the first resource group. The master inode is
written in the first free block after the journals and then the other metafs
structures are placed. The root
20 matches
Mail list logo