aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/ocfs2.h
diff options
context:
space:
mode:
authorTiger Yang <tiger.yang@oracle.com>2010-01-25 01:11:06 -0500
committerJoel Becker <joel.becker@oracle.com>2010-02-26 18:41:07 -0500
commitb89c54282db0c8634a2d2dc200f196d571750ce5 (patch)
treefbb34a01b3f0b2f4af6aae9ede9f3f21ef2a378d /fs/ocfs2/ocfs2.h
parenta5f28ae4df291d81d9d23066f88c55ca45e388d3 (diff)
ocfs2: add extent block stealing for ocfs2 v5
This patch add extent block (metadata) stealing mechanism for extent allocation. This mechanism is same as the inode stealing. if no room in slot specific extent_alloc, we will try to allocate extent block from the next slot. Signed-off-by: Tiger Yang <tiger.yang@oracle.com> Acked-by: Tao Ma <tao.ma@oracle.com> Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/ocfs2.h')
-rw-r--r--fs/ocfs2/ocfs2.h29
1 files changed, 2 insertions, 27 deletions
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h
index 740f448041e2..8857dd724f90 100644
--- a/fs/ocfs2/ocfs2.h
+++ b/fs/ocfs2/ocfs2.h
@@ -305,7 +305,9 @@ struct ocfs2_super
305 u32 s_next_generation; 305 u32 s_next_generation;
306 unsigned long osb_flags; 306 unsigned long osb_flags;
307 s16 s_inode_steal_slot; 307 s16 s_inode_steal_slot;
308 s16 s_meta_steal_slot;
308 atomic_t s_num_inodes_stolen; 309 atomic_t s_num_inodes_stolen;
310 atomic_t s_num_meta_stolen;
309 311
310 unsigned long s_mount_opt; 312 unsigned long s_mount_opt;
311 unsigned int s_atime_quantum; 313 unsigned int s_atime_quantum;
@@ -760,33 +762,6 @@ static inline unsigned int ocfs2_megabytes_to_clusters(struct super_block *sb,
760 return megs << (20 - OCFS2_SB(sb)->s_clustersize_bits); 762 return megs << (20 - OCFS2_SB(sb)->s_clustersize_bits);
761} 763}
762 764
763static inline void ocfs2_init_inode_steal_slot(struct ocfs2_super *osb)
764{
765 spin_lock(&osb->osb_lock);
766 osb->s_inode_steal_slot = OCFS2_INVALID_SLOT;
767 spin_unlock(&osb->osb_lock);
768 atomic_set(&osb->s_num_inodes_stolen, 0);
769}
770
771static inline void ocfs2_set_inode_steal_slot(struct ocfs2_super *osb,
772 s16 slot)
773{
774 spin_lock(&osb->osb_lock);
775 osb->s_inode_steal_slot = slot;
776 spin_unlock(&osb->osb_lock);
777}
778
779static inline s16 ocfs2_get_inode_steal_slot(struct ocfs2_super *osb)
780{
781 s16 slot;
782
783 spin_lock(&osb->osb_lock);
784 slot = osb->s_inode_steal_slot;
785 spin_unlock(&osb->osb_lock);
786
787 return slot;
788}
789
790#define ocfs2_set_bit ext2_set_bit 765#define ocfs2_set_bit ext2_set_bit
791#define ocfs2_clear_bit ext2_clear_bit 766#define ocfs2_clear_bit ext2_clear_bit
792#define ocfs2_test_bit ext2_test_bit 767#define ocfs2_test_bit ext2_test_bit