]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/ext4/mballoc.h
ext4: teach mballoc preallocation code about bigalloc clusters
[mirror_ubuntu-bionic-kernel.git] / fs / ext4 / mballoc.h
index 9d4a636b546c529ac993b18e1fe6abb3e99ab9f5..1641f4b57439190fd22311e037a96bafdc877988 100644 (file)
@@ -139,9 +139,9 @@ enum {
 
 struct ext4_free_extent {
        ext4_lblk_t fe_logical;
-       ext4_grpblk_t fe_start;
+       ext4_grpblk_t fe_start; /* In cluster units */
        ext4_group_t fe_group;
-       ext4_grpblk_t fe_len;
+       ext4_grpblk_t fe_len;   /* In cluster units */
 };
 
 /*
@@ -216,6 +216,7 @@ struct ext4_buddy {
 static inline ext4_fsblk_t ext4_grp_offs_to_block(struct super_block *sb,
                                        struct ext4_free_extent *fex)
 {
-       return ext4_group_first_block_no(sb, fex->fe_group) + fex->fe_start;
+       return ext4_group_first_block_no(sb, fex->fe_group) +
+               (fex->fe_start << EXT4_SB(sb)->s_cluster_bits);
 }
 #endif