diff options
Diffstat (limited to 'fs/ocfs2/ocfs2.h')
-rw-r--r-- | fs/ocfs2/ocfs2.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h index fa3c6d3f0bd2..e1844d5736c4 100644 --- a/fs/ocfs2/ocfs2.h +++ b/fs/ocfs2/ocfs2.h | |||
@@ -582,6 +582,16 @@ static inline u64 ocfs2_clusters_to_bytes(struct super_block *sb, | |||
582 | return (u64)clusters << OCFS2_SB(sb)->s_clustersize_bits; | 582 | return (u64)clusters << OCFS2_SB(sb)->s_clustersize_bits; |
583 | } | 583 | } |
584 | 584 | ||
585 | static inline u64 ocfs2_block_to_cluster_start(struct super_block *sb, | ||
586 | u64 blocks) | ||
587 | { | ||
588 | int bits = OCFS2_SB(sb)->s_clustersize_bits - sb->s_blocksize_bits; | ||
589 | unsigned int clusters; | ||
590 | |||
591 | clusters = ocfs2_blocks_to_clusters(sb, blocks); | ||
592 | return (u64)clusters << bits; | ||
593 | } | ||
594 | |||
585 | static inline u64 ocfs2_align_bytes_to_clusters(struct super_block *sb, | 595 | static inline u64 ocfs2_align_bytes_to_clusters(struct super_block *sb, |
586 | u64 bytes) | 596 | u64 bytes) |
587 | { | 597 | { |