ocfs2: allocation reservations

This patch improves Ocfs2 allocation policy by allowing an inode to
reserve a portion of the local alloc bitmap for itself. The reserved
portion (allocation window) is advisory in that other allocation
windows might steal it if the local alloc bitmap becomes
full. Otherwise, the reservations are honored and guaranteed to be
free. When the local alloc window is moved to a different portion of
the bitmap, existing reservations are discarded.

Reservation windows are represented internally by a red-black
tree. Within that tree, each node represents the reservation window of
one inode. An LRU of active reservations is also maintained. When new
data is written, we allocate it from the inodes window. When all bits
in a window are exhausted, we allocate a new one as close to the
previous one as possible. Should we not find free space, an existing
reservation is pulled off the LRU and cannibalized.

Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Šī revīzija ir iekļauta:
Mark Fasheh
2009-12-07 13:10:48 -08:00
revīziju iesūtīja Joel Becker
vecāks ec20cec7a3
revīzija d02f00cc05
10 mainīti faili ar 1094 papildinājumiem un 11 dzēšanām

Parādīt failu

@@ -47,6 +47,7 @@
/* For struct ocfs2_blockcheck_stats */
#include "blockcheck.h"
#include "reservations.h"
/* Caching of metadata buffers */
@@ -349,6 +350,10 @@ struct ocfs2_super
u64 la_last_gd;
struct ocfs2_reservation_map osb_la_resmap;
unsigned int osb_resv_level;
/* Next three fields are for local node slot recovery during
* mount. */
int dirty;