aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/ocfs2_fs.h
diff options
context:
space:
mode:
authorJoel Becker <joel.becker@oracle.com>2010-04-13 02:26:32 -0400
committerTao Ma <tao.ma@oracle.com>2010-04-13 02:26:32 -0400
commit798db35f4649eac2778381c390ed7d12de9ec767 (patch)
tree988c30bd86d4913c2f9187bb8504135ec0b80f62 /fs/ocfs2/ocfs2_fs.h
parent4cbe4249d6586d5d88ef271e07302407a14c8443 (diff)
ocfs2: Allocate discontiguous block groups.
If we cannot get a contiguous region for a block group, allocate a discontiguous one when the filesystem supports it. Signed-off-by: Joel Becker <joel.becker@oracle.com> Signed-off-by: Tao Ma <tao.ma@oracle.com>
Diffstat (limited to 'fs/ocfs2/ocfs2_fs.h')
-rw-r--r--fs/ocfs2/ocfs2_fs.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/ocfs2/ocfs2_fs.h b/fs/ocfs2/ocfs2_fs.h
index 448aa8d11a97..888ba4ec42c6 100644
--- a/fs/ocfs2/ocfs2_fs.h
+++ b/fs/ocfs2/ocfs2_fs.h
@@ -1278,6 +1278,16 @@ static inline u16 ocfs2_extent_recs_per_eb(struct super_block *sb)
1278 return size / sizeof(struct ocfs2_extent_rec); 1278 return size / sizeof(struct ocfs2_extent_rec);
1279} 1279}
1280 1280
1281static inline u16 ocfs2_extent_recs_per_gd(struct super_block *sb)
1282{
1283 int size;
1284
1285 size = sb->s_blocksize -
1286 offsetof(struct ocfs2_group_desc, bg_list.l_recs);
1287
1288 return size / sizeof(struct ocfs2_extent_rec);
1289}
1290
1281static inline int ocfs2_dx_entries_per_leaf(struct super_block *sb) 1291static inline int ocfs2_dx_entries_per_leaf(struct super_block *sb)
1282{ 1292{
1283 int size; 1293 int size;
@@ -1430,6 +1440,16 @@ static inline int ocfs2_extent_recs_per_eb(int blocksize)
1430 return size / sizeof(struct ocfs2_extent_rec); 1440 return size / sizeof(struct ocfs2_extent_rec);
1431} 1441}
1432 1442
1443static inline int ocfs2_extent_recs_per_gd(int blocksize)
1444{
1445 int size;
1446
1447 size = blocksize -
1448 offsetof(struct ocfs2_group_desc, bg_list.l_recs);
1449
1450 return size / sizeof(struct ocfs2_extent_rec);
1451}
1452
1433static inline int ocfs2_local_alloc_size(int blocksize) 1453static inline int ocfs2_local_alloc_size(int blocksize)
1434{ 1454{
1435 int size; 1455 int size;