[Cluster-devel] [PATCH 17/19] libgfs2: Add a speedier journal data block writing function

2014-09-02 Thread Andrew Price
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

[Cluster-devel] [PATCH 09/19] libgfs2: Add back-pointer to rgrps in lgfs2_rgrp_t

2014-09-02 Thread Andrew Price
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 |

[Cluster-devel] [PATCH 03/19] libgfs2: Fix an impossible loop condition in gfs2_rgrp_read

2014-09-02 Thread Andrew Price
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 ---

[Cluster-devel] [PATCH 08/19] libgfs2: Ignore an empty rgrp plan if a length is specified

2014-09-02 Thread Andrew Price
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

[Cluster-devel] [PATCH 06/19] libgfs2: Add functions for finding free extents

2014-09-02 Thread Andrew Price
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

[Cluster-devel] [PATCH 18/19] libgfs2: Create jindex directory separately from journals

2014-09-02 Thread 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

[Cluster-devel] [PATCH 05/19] libgfs2: Move struct _lgfs2_rgrps into rgrp.h

2014-09-02 Thread Andrew Price
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

[Cluster-devel] [PATCH 16/19] libgfs2: Handle non-zero bitmaps in lgfs2_rgrp_write

2014-09-02 Thread Andrew Price
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

[Cluster-devel] [PATCH 10/19] libgfs2: Const-ify the parameters of print functions

2014-09-02 Thread Andrew Price
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

[Cluster-devel] [PATCH 01/19] libgfs2: Keep a pointer to the sbd in lgfs2_rgrps_t

2014-09-02 Thread Andrew Price
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

[Cluster-devel] [PATCH 13/19] libgfs2: Add support for allocating entire rgrp headers

2014-09-02 Thread Andrew Price
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.

[Cluster-devel] [PATCH 19/19] mkfs.gfs2: Improve journal creation performance

2014-09-02 Thread Andrew Price
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

[Cluster-devel] [PATCH 04/19] libgfs2: Introduce struct lgfs2_rbm

2014-09-02 Thread Andrew Price
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:

[Cluster-devel] [PATCH 02/19] libgfs2: Move bitmap buffers inside struct gfs2_bitmap

2014-09-02 Thread Andrew Price
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

[Cluster-devel] [PATCH 07/19] tests: Add unit tests for the new extent search functions

2014-09-02 Thread Andrew Price
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

[Cluster-devel] [PATCH 12/19] libgfs2: Add extent allocation functions

2014-09-02 Thread Andrew Price
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:

[Cluster-devel] [PATCH 15/19] libgfs2: Fix alignment in lgfs2_rgsize_for_data

2014-09-02 Thread Andrew Price
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

[Cluster-devel] [PATCH 14/19] libgfs2: Write file metadata sequentially

2014-09-02 Thread 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

[Cluster-devel] [PATCH 11/19] libgfs2: Allow init_dinode to accept a preallocated bh

2014-09-02 Thread Andrew Price
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.

Re: [Cluster-devel] [PATCH 00/19] gfs2-utils: Introduce extent allocation and speed up journal creation

2014-09-02 Thread Bob Peterson
- 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