[Cluster-devel] [PATCH 10/27] GFS2: change function gfs2_direct_IO to use a normal gfs2_glock_dq

2012-09-26 Thread Steven Whitehouse
From: Bob Peterson This patch changes function gfs2_direct_IO so that it uses a normal call to gfs2_glock_dq rather than a call to a multiple-dq of one item. Signed-off-by: Bob Peterson Signed-off-by: Steven Whitehouse diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index 00eaa83..01c4975 100644

[Cluster-devel] [PATCH 01/27] GFS2: Merge two nearly identical xattr functions

2012-09-26 Thread Steven Whitehouse
There were two functions in the xattr code which were nearly identical, the only difference being that one was copy data into the unstuffed xattrs and the other was copying data out from it. This patch merges the two functions such that the code which deal with iteration over the unstuffed xattrs

[Cluster-devel] [PATCH 14/27] GFS2: Eliminate redundant calls to may_grant

2012-09-26 Thread Steven Whitehouse
From: Bob Peterson Function add_to_queue was checking may_grant for the passed-in holder for every iteration of its gh2 loop. Now it only checks it once at the beginning to see if a try lock is futile. Signed-off-by: Bob Peterson Signed-off-by: Steven Whitehouse diff --git a/fs/gfs2/glock.c b

[Cluster-devel] [PATCH 13/27] GFS2: Combine functions gfs2_glock_dq_wait and wait_on_demote

2012-09-26 Thread Steven Whitehouse
From: Bob Peterson Function gfs2_glock_dq_wait called two-line function wait_on_demote, so they were combined. Signed-off-by: Bob Peterson Signed-off-by: Steven Whitehouse diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 5c87909..fca6a87 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c

[Cluster-devel] [PATCH 06/27] GFS2: Update rgblk_free() to use rbm

2012-09-26 Thread Steven Whitehouse
Replace open coded version with a call to gfs2_rbm_from_block() Signed-off-by: Steven Whitehouse diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index 0c1be38..06476b3 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c @@ -1890,46 +1890,30 @@ static u64 gfs2_alloc_extent(const struct gfs2_rbm *rbm,

[Cluster-devel] GFS2: Pre-pull patch posting (merge window)

2012-09-26 Thread Steven Whitehouse
Hi, We've collected up a goodly number of patches in the -nmw tree now and we can hold off any further changes until the following merge window, so here is the current tree content. The major feature this time is the "rbm" conversion in the resource group code. The new struct gfs2_rbm specifies t

[Cluster-devel] [PATCH 15/27] GFS2: Eliminate unnecessary check for state > 3 in bitfit

2012-09-26 Thread Steven Whitehouse
From: Bob Peterson Function gfs2_bitfit was checking for state > 3, but that's impossible since it is only called from rgblk_search, which receives only GFS2_BLKST_ constants. Signed-off-by: Bob Peterson Signed-off-by: Steven Whitehouse diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index c2671

[Cluster-devel] [PATCH 11/27] GFS2: inline __gfs2_glock_schedule_for_reclaim

2012-09-26 Thread Steven Whitehouse
From: Bob Peterson Since function gfs2_glock_schedule_for_reclaim is only two significant lines, we can eliminate it, simplifying the code and making it more readable. Signed-off-by: Bob Peterson Signed-off-by: Steven Whitehouse diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 1ed81f4..67

[Cluster-devel] [PATCH 18/27] GFS2: Fix ->show_options() for statfs slow

2012-09-26 Thread Steven Whitehouse
The ->show_options() function for GFS2 was not correctly displaying the value when statfs slow in in use. Signed-off-by: Steven Whitehouse Reported-by: Milos Jakubicek diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index 3cbac68..79cac70 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -13

[Cluster-devel] [PATCH 12/27] GFS2: Combine functions gfs2_glock_wait and wait_on_holder

2012-09-26 Thread Steven Whitehouse
From: Bob Peterson Function gfs2_glock_wait only called function wait_on_holder and returned its return code, so they were combined for readability. Signed-off-by: Bob Peterson Signed-off-by: Steven Whitehouse diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 67f3e42..5c87909 100644 --- a/

[Cluster-devel] [PATCH 02/27] GFS2: Remove rs_requested field from reservations

2012-09-26 Thread Steven Whitehouse
The rs_requested field is left over from the original allocation code, however this should have been a parameter passed to the various functions from gfs2_inplace_reserve() and not a member of the reservation structure as the value is not required after the initial allocation. This also helps simp

[Cluster-devel] [PATCH 05/27] GFS2: Update gfs2_get_block_type() to use rbm

2012-09-26 Thread Steven Whitehouse
Use the new gfs2_rbm_from_block() function to replace an open coded version of the same code. Signed-off-by: Steven Whitehouse diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index bd3b926..0c1be38 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c @@ -1824,27 +1824,14 @@ void gfs2_inplace_release(st

[Cluster-devel] [PATCH 03/27] GFS2: Add structure to contain rgrp, bitmap, offset tuple

2012-09-26 Thread Steven Whitehouse
This patch introduces a new structure, gfs2_rbm, which is a tuple of a resource group, a bitmap within the resource group and an offset within that bitmap. This is designed to make manipulating these sets of variables easier. There is also a new helper function which converts this representation ba

[Cluster-devel] [PATCH 09/27] GFS2: rbm code cleanup

2012-09-26 Thread Steven Whitehouse
From: Bob Peterson This patch fixes a few small rbm related things. First, it fixes a corner case where the rbm needs to switch bitmaps and wasn't adjusting its buffer pointer. Second, there's a white space issue fixed. Third, the logic in function gfs2_rbm_from_block was optimized a bit. Lastly,

[Cluster-devel] [PATCH 19/27] GFS2: Fall back to ignoring reservations, if there are no other blocks left

2012-09-26 Thread Steven Whitehouse
When we get to the stage of allocating blocks, we know that the resource group in question must contain enough free blocks, otherwise gfs2_inplace_reserve() would have failed. So if we are left with only free blocks which are reserved, then we must use those. This can happen if another node has sne

[Cluster-devel] [PATCH 04/27] GFS2: Replace rgblk_search with gfs2_rbm_find

2012-09-26 Thread Steven Whitehouse
This is part of a series of patches which are introducing the gfs2_rbm structure throughout the block allocation code. The main aim of this part is to create a search function which can deal directly with struct gfs2_rbm. In this case it specifies the initial position at which to start the search a

[Cluster-devel] [PATCH 20/27] GFS2: Improve block reservation tracing

2012-09-26 Thread Steven Whitehouse
This patch improves the tracing of block reservations by removing some corner cases and also providing more useful detail in the traces. A new field is added to the reservation structure to contain the inode number. This is used since in certain contexts it is not possible to access the inode itse

[Cluster-devel] [PATCH 08/27] GFS2: Fix case where reservation finished at end of rgrp

2012-09-26 Thread Steven Whitehouse
One corner case which the original patch failed to take into account was when there is a reservation which ended such that the following block was one beyond the end of the rgrp in question. This extra test fixes that case. Signed-off-by: Steven Whitehouse Reported-by: Bob Peterson Tested-by: Bo

[Cluster-devel] [PATCH 17/27] GFS2: Use rbm for gfs2_setbit()

2012-09-26 Thread Steven Whitehouse
Use the rbm structure for gfs2_setbit() in order to simplify the arguments to the function. We have to add a bool to control whether the clone bitmap should be updated (if it exists) but otherwise it is a more or less direct substitution. Signed-off-by: Steven Whitehouse diff --git a/fs/gfs2/rgr

[Cluster-devel] [PATCH 07/27] GFS2: Use RB_CLEAR_NODE() rather than rb_init_node()

2012-09-26 Thread Steven Whitehouse
From: Michel Lespinasse gfs2 calls RB_EMPTY_NODE() to check if nodes are not on an rbtree. The corresponding initialization function is RB_CLEAR_NODE(). rb_init_node() was never clearly defined and is going away. Signed-off-by: Michel Lespinasse Signed-off-by: Steven Whitehouse diff --git a/f

[Cluster-devel] [PATCH 25/27] GFS2: Fix infinite loop in rbm_find

2012-09-26 Thread Steven Whitehouse
From: Bob Peterson This patch fixes an infinite loop in gfs2_rbm_find that was introduced by the previous patch. The problem occurred when the length was less than 3 but the rbm block was byte-aligned, causing it to improperly return a extent length of zero, which caused it to spin. Signed-off-b

[Cluster-devel] [PATCH 26/27] GFS2: fix s_writers.counter imbalance in gfs2_ail_empty_gl

2012-09-26 Thread Steven Whitehouse
From: Eric Sandeen gfs2_ail_empty_gl() contains an "inline version" of gfs2_trans_begin(), so it needs an explicit sb_start_intwrite() as well, to balance the sb_end_intwrite() which will be called by gfs2_trans_end(). With this, xfstest 068 passes on lock_nolock local gfs2. Without it, we reach

[Cluster-devel] [PATCH 27/27] GFS2: Write out dirty inode metadata in delayed deletes

2012-09-26 Thread Steven Whitehouse
From: Benjamin Marzinski If a dirty GFS2 inode was being deleted but was in use by another node, its metadata was not getting written out before GFS2 checked for dirty buffers in gfs2_ail_flush(). GFS2 was relying on inode_go_sync() to write out the metadata when the other node tried to free the

[Cluster-devel] [PATCH 16/27] GFS2: Use rbm for gfs2_testbit()

2012-09-26 Thread Steven Whitehouse
Change the arguments to gfs2_testbit() so that it now just takes an rbm specifying the position of the two bit entry to return. Signed-off-by: Steven Whitehouse diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index 47d2346..3a288ce 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c @@ -117,30 +117,21

[Cluster-devel] [PATCH 24/27] GFS2: Consolidate free block searching functions

2012-09-26 Thread Steven Whitehouse
With the recently added block reservation code, an additional function was added to search for free blocks. This had a restriction of only being able to search for aligned extents of free blocks. As a result the allocation patterns when reserving blocks were suboptimal when the existing allocation

[Cluster-devel] [PATCH 22/27] GFS2: Stop block extents at the end of bitmaps

2012-09-26 Thread Steven Whitehouse
From: Bob Peterson This patch stops multiple block allocations if a nonzero return code is received from gfs2_rbm_from_block. Without this patch, if enough pressure is put on the file system, you get a kernel warning quickly followed by: BUG: unable to handle kernel NULL pointer dereference at (n

[Cluster-devel] [PATCH 21/27] GFS2: Fix unclaimed_blocks() wrapping bug and clean up

2012-09-26 Thread Steven Whitehouse
When rgd->rd_free_clone is less than rgd->rd_reserved, the unclaimed_blocks() calculation would wrap and produce incorrect results. This patch checks for this condition when this function is called from gfs2_mblk_search() In addition, the use of this particular function in other places in the code

[Cluster-devel] [PATCH 23/27] GFS2: Get rid of I_MUTEX_QUOTA usage

2012-09-26 Thread Steven Whitehouse
From: Jan Kara GFS2 uses i_mutex on its system quota inode to synchronize writes to quota file. Since this is an internal inode to GFS2 (not part of directory hiearchy or visible by user) we are safe to define locking rules for it. So let's just get it its own locking class to make it clear. Sig

[Cluster-devel] GFS2 cache?

2012-09-26 Thread Heiko Nardmann
Hi together! One probably simple question: has GFS2 a separate (internal) cache, e.g. for inode/dentry? Thanks in advance! Kind regards, Heiko