diff options
author | Gao Xiang <gaoxiang25@huawei.com> | 2018-09-18 22:27:26 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-18 16:35:03 +0200 |
commit | 6bec52047f56d44d26d076a408a1bf60b58c91fa (patch) | |
tree | e784e6cf476065f8aac62035ad8a75ef9468b8d5 /drivers | |
parent | 1e05ff36e6921ca61bdbf779f81a602863569ee3 (diff) | |
download | linux-stable-6bec52047f56d44d26d076a408a1bf60b58c91fa.tar.gz linux-stable-6bec52047f56d44d26d076a408a1bf60b58c91fa.tar.bz2 linux-stable-6bec52047f56d44d26d076a408a1bf60b58c91fa.zip |
staging: erofs: avoid magic constants when initializing clusterbits
Currently erofs only supports clustersize == blocksize.
and clustersize == 2^n * blocksize will be supported in the future.
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/erofs/super.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c index 1ed846f38957..802202ca7213 100644 --- a/drivers/staging/erofs/super.c +++ b/drivers/staging/erofs/super.c @@ -116,9 +116,10 @@ static int superblock_read(struct super_block *sb) #endif sbi->islotbits = ffs(sizeof(struct erofs_inode_v1)) - 1; #ifdef CONFIG_EROFS_FS_ZIP - sbi->clusterbits = 12; + /* TODO: clusterbits should be related to inode */ + sbi->clusterbits = blkszbits; - if (1 << (sbi->clusterbits - 12) > Z_EROFS_CLUSTER_MAX_PAGES) + if (1 << (sbi->clusterbits - PAGE_SHIFT) > Z_EROFS_CLUSTER_MAX_PAGES) errln("clusterbits %u is not supported on this kernel", sbi->clusterbits); #endif |