aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/alloc.h
diff options
context:
space:
mode:
authorTao Ma <tao.ma@oracle.com>2008-11-11 19:26:58 -0500
committerMark Fasheh <mfasheh@suse.com>2009-01-05 11:34:18 -0500
commit2891d290aa6eee0821f7e4ad0b1c4ae4d964b0f1 (patch)
tree2f06b8d3afcf1986d0f041319a8ec08395acdf83 /fs/ocfs2/alloc.h
parent976331d8789d4d84a11b45b87c520ade83715343 (diff)
ocfs2: Add clusters free in dealloc_ctxt.
Now in ocfs2 xattr set, the whole process are divided into many small parts and they are wrapped into diffrent transactions and it make the set doesn't look like a real transaction. So we want to integrate it into a real one. In some cases we will allocate some clusters and free some in just one transaction. e.g, one xattr is larger than inline size, so it and its value root is stored within the inode while the value is outside in a cluster. Then we try to update it with a smaller value(larger than the size of root but smaller than inline size), we may need to free the outside cluster while allocate a new bucket(one cluster) since now the inode may be full. The old solution will lock the global_bitmap(if the local alloc failed in stress test) and then the truncate log. This will cause a ABBA lock with truncate log flush. This patch add the clusters free in dealloc_ctxt, so that we can record the free clusters during the transaction and then free it after we release the global_bitmap in xattr set. Signed-off-by: Tao Ma <tao.ma@oracle.com> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/alloc.h')
-rw-r--r--fs/ocfs2/alloc.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/ocfs2/alloc.h b/fs/ocfs2/alloc.h
index 70257c84cfbe..c301cf225f0b 100644
--- a/fs/ocfs2/alloc.h
+++ b/fs/ocfs2/alloc.h
@@ -167,11 +167,15 @@ int __ocfs2_flush_truncate_log(struct ocfs2_super *osb);
167 */ 167 */
168struct ocfs2_cached_dealloc_ctxt { 168struct ocfs2_cached_dealloc_ctxt {
169 struct ocfs2_per_slot_free_list *c_first_suballocator; 169 struct ocfs2_per_slot_free_list *c_first_suballocator;
170 struct ocfs2_cached_block_free *c_global_allocator;
170}; 171};
171static inline void ocfs2_init_dealloc_ctxt(struct ocfs2_cached_dealloc_ctxt *c) 172static inline void ocfs2_init_dealloc_ctxt(struct ocfs2_cached_dealloc_ctxt *c)
172{ 173{
173 c->c_first_suballocator = NULL; 174 c->c_first_suballocator = NULL;
175 c->c_global_allocator = NULL;
174} 176}
177int ocfs2_cache_cluster_dealloc(struct ocfs2_cached_dealloc_ctxt *ctxt,
178 u64 blkno, unsigned int bit);
175int ocfs2_run_deallocs(struct ocfs2_super *osb, 179int ocfs2_run_deallocs(struct ocfs2_super *osb,
176 struct ocfs2_cached_dealloc_ctxt *ctxt); 180 struct ocfs2_cached_dealloc_ctxt *ctxt);
177 181