linux/fs/gfs2
Bob Peterson 7c9ca62113 GFS2: Use rbtree for resource groups and clean up bitmap buffer ref count scheme
Here is an update of Bob's original rbtree patch which, in addition, also
resolves the rather strange ref counting that was being done relating to
the bitmap blocks.

Originally we had a dual system for journaling resource groups. The metadata
blocks were journaled and also the rgrp itself was added to a list. The reason
for adding the rgrp to the list in the journal was so that the "repolish
clones" code could be run to update the free space, and potentially send any
discard requests when the log was flushed. This was done by comparing the
"cloned" bitmap with what had been written back on disk during the transaction
commit.

Due to this, there was a requirement to hang on to the rgrps' bitmap buffers
until the journal had been flushed. For that reason, there was a rather
complicated set up in the ->go_lock ->go_unlock functions for rgrps involving
both a mutex and a spinlock (the ->sd_rindex_spin) to maintain a reference
count on the buffers.

However, the journal maintains a reference count on the buffers anyway, since
they are being journaled as metadata buffers. So by moving the code which deals
with the post-journal accounting for bitmap blocks to the metadata journaling
code, we can entirely dispense with the rather strange buffer ref counting
scheme and also the requirement to journal the rgrps.

The net result of all this is that the ->sd_rindex_spin is left to do exactly
one job, and that is to look after the rbtree or rgrps.

This patch is designed to be a stepping stone towards using RCU for the rbtree
of resource groups, however the reduction in the number of uses of the
->sd_rindex_spin is likely to have benefits for multi-threaded workloads,
anyway.

The patch retains ->go_lock and ->go_unlock for rgrps, however these maybe also
be removed in future in favour of calling the functions directly where required
in the code. That will allow locking of resource groups without needing to
actually read them in - something that could be useful in speeding up statfs.

In the mean time though it is valid to dereference ->bi_bh only when the rgrp
is locked. This is basically the same rule as before, modulo the references not
being valid until the following journal flush.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Cc: Benjamin Marzinski <bmarzins@redhat.com>
2011-10-21 12:39:31 +01:00
..
Kconfig
Makefile GFS2: Rename ops_inode.c to inode.c 2011-05-10 13:12:49 +01:00
acl.c GFS2: Use ->dirty_inode() 2011-10-21 12:39:26 +01:00
acl.h fs: take the ACL checks to common code 2011-07-25 14:30:23 -04:00
aops.c GFS2: Use ->dirty_inode() 2011-10-21 12:39:26 +01:00
bmap.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 2011-07-22 19:02:39 -07:00
bmap.h
dentry.c gfs2: fix d_revalidate oopsen on NFS exports 2011-03-10 03:44:48 -05:00
dir.c GFS2: Use ->dirty_inode() 2011-10-21 12:39:26 +01:00
dir.h GFS2: Cache dir hash table in a contiguous buffer 2011-07-15 09:31:48 +01:00
export.c GFS2: Make writeback more responsive to system conditions 2011-04-20 09:01:37 +01:00
file.c GFS2: Fix lseek after SEEK_DATA, SEEK_HOLE have been added 2011-10-21 12:39:29 +01:00
gfs2.h
glock.c GFS2: Automatically adjust glock min hold time 2011-07-15 09:32:11 +01:00
glock.h GFS2: Automatically adjust glock min hold time 2011-07-15 09:32:11 +01:00
glops.c GFS2: Use rbtree for resource groups and clean up bitmap buffer ref count scheme 2011-10-21 12:39:31 +01:00
glops.h GFS2: Clean up fsync() 2011-04-20 09:00:41 +01:00
incore.h GFS2: Use rbtree for resource groups and clean up bitmap buffer ref count scheme 2011-10-21 12:39:31 +01:00
inode.c GFS2: Clean up gfs2_create 2011-10-21 12:39:28 +01:00
inode.h GFS2: Use ->dirty_inode() 2011-10-21 12:39:26 +01:00
lock_dlm.c GFS2: Fix glock deallocation race 2011-03-09 10:58:04 +00:00
log.c block: separate priority boosting from REQ_META 2011-08-23 14:50:29 +02:00
log.h GFS2: Make writeback more responsive to system conditions 2011-04-20 09:01:37 +01:00
lops.c GFS2: Use rbtree for resource groups and clean up bitmap buffer ref count scheme 2011-10-21 12:39:31 +01:00
lops.h
main.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
meta_io.c block: separate priority boosting from REQ_META 2011-08-23 14:50:29 +02:00
meta_io.h GFS2: Remove unused macro 2011-04-20 09:00:24 +01:00
ops_fstype.c GFS2: Use rbtree for resource groups and clean up bitmap buffer ref count scheme 2011-10-21 12:39:31 +01:00
quota.c GFS2: Use ->dirty_inode() 2011-10-21 12:39:26 +01:00
quota.h vmscan: change shrinker API by passing shrink_control struct 2011-05-25 08:39:26 -07:00
recovery.c
recovery.h
rgrp.c GFS2: Use rbtree for resource groups and clean up bitmap buffer ref count scheme 2011-10-21 12:39:31 +01:00
rgrp.h GFS2: Use rbtree for resource groups and clean up bitmap buffer ref count scheme 2011-10-21 12:39:31 +01:00
super.c GFS2: Use ->dirty_inode() 2011-10-21 12:39:26 +01:00
super.h
sys.c GFS2: Fix race during filesystem mount 2011-07-12 09:15:46 +01:00
sys.h
trace_gfs2.h GFS2: Add an AIL writeback tracepoint 2011-04-20 09:01:58 +01:00
trans.c GFS2: Use rbtree for resource groups and clean up bitmap buffer ref count scheme 2011-10-21 12:39:31 +01:00
trans.h GFS2: Use rbtree for resource groups and clean up bitmap buffer ref count scheme 2011-10-21 12:39:31 +01:00
util.c
util.h
xattr.c GFS2: Use ->dirty_inode() 2011-10-21 12:39:26 +01:00
xattr.h