summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2006-10-11 01:21:18 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-11 11:14:18 -0700
commit72b64b594081ef0a0717f6aad77e891c72ed4afa (patch)
tree50fdb2b2743a95066ee83f58bed9c44daf707506 /fs
parent8fadc14323684c547f74cf2f4d13517c6c264731 (diff)
downloadop-kernel-dev-72b64b594081ef0a0717f6aad77e891c72ed4afa.zip
op-kernel-dev-72b64b594081ef0a0717f6aad77e891c72ed4afa.tar.gz
[PATCH] ext4 uninline ext4_get_group_no_and_offset()
Way too big to inline. Cc: <linux-ext4@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/balloc.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
index 3e85886..402475a 100644
--- a/fs/ext4/balloc.c
+++ b/fs/ext4/balloc.c
@@ -25,6 +25,24 @@
*/
/*
+ * Calculate the block group number and offset, given a block number
+ */
+void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr,
+ unsigned long *blockgrpp, ext4_grpblk_t *offsetp)
+{
+ struct ext4_super_block *es = EXT4_SB(sb)->s_es;
+ ext4_grpblk_t offset;
+
+ blocknr = blocknr - le32_to_cpu(es->s_first_data_block);
+ offset = sector_div(blocknr, EXT4_BLOCKS_PER_GROUP(sb));
+ if (offsetp)
+ *offsetp = offset;
+ if (blockgrpp)
+ *blockgrpp = blocknr;
+
+}
+
+/*
* The free blocks are managed by bitmaps. A file system contains several
* blocks groups. Each group contains 1 bitmap block for blocks, 1 bitmap
* block for inodes, N blocks for the inode table and data blocks.
OpenPOWER on IntegriCloud