File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -4005,6 +4005,15 @@ static int f2fs_ioc_set_compress_option(struct file *filp, unsigned long arg)
4005
4005
F2FS_I (inode )-> i_compress_algorithm = option .algorithm ;
4006
4006
F2FS_I (inode )-> i_log_cluster_size = option .log_cluster_size ;
4007
4007
F2FS_I (inode )-> i_cluster_size = BIT (option .log_cluster_size );
4008
+ /* Set default level */
4009
+ if (F2FS_I (inode )-> i_compress_algorithm == COMPRESS_ZSTD )
4010
+ F2FS_I (inode )-> i_compress_level = F2FS_ZSTD_DEFAULT_CLEVEL ;
4011
+ else
4012
+ F2FS_I (inode )-> i_compress_level = 0 ;
4013
+ /* Adjust mount option level */
4014
+ if (option .algorithm == F2FS_OPTION (sbi ).compress_algorithm &&
4015
+ F2FS_OPTION (sbi ).compress_level )
4016
+ F2FS_I (inode )-> i_compress_level = F2FS_OPTION (sbi ).compress_level ;
4008
4017
f2fs_mark_inode_dirty_sync (inode , true);
4009
4018
4010
4019
if (!f2fs_is_compress_backend_ready (inode ))
You can’t perform that action at this time.
0 commit comments