@@ -198,8 +198,8 @@ static int lzo_compress_pages(struct compress_ctx *cc)
198
198
ret = lzo1x_1_compress (cc -> rbuf , cc -> rlen , cc -> cbuf -> cdata ,
199
199
& cc -> clen , cc -> private );
200
200
if (ret != LZO_E_OK ) {
201
- printk_ratelimited ( "%sF2FS-fs (%s): lzo compress failed, ret:%d\n" ,
202
- KERN_ERR , F2FS_I_SB ( cc -> inode ) -> sb -> s_id , ret );
201
+ f2fs_err_ratelimited ( F2FS_I_SB ( cc -> inode ) ,
202
+ "lzo compress failed, ret:%d" , ret );
203
203
return - EIO ;
204
204
}
205
205
return 0 ;
@@ -212,17 +212,15 @@ static int lzo_decompress_pages(struct decompress_io_ctx *dic)
212
212
ret = lzo1x_decompress_safe (dic -> cbuf -> cdata , dic -> clen ,
213
213
dic -> rbuf , & dic -> rlen );
214
214
if (ret != LZO_E_OK ) {
215
- printk_ratelimited ( "%sF2FS-fs (%s): lzo decompress failed, ret:%d\n" ,
216
- KERN_ERR , F2FS_I_SB ( dic -> inode ) -> sb -> s_id , ret );
215
+ f2fs_err_ratelimited ( F2FS_I_SB ( dic -> inode ) ,
216
+ "lzo decompress failed, ret:%d" , ret );
217
217
return - EIO ;
218
218
}
219
219
220
220
if (dic -> rlen != PAGE_SIZE << dic -> log_cluster_size ) {
221
- printk_ratelimited ("%sF2FS-fs (%s): lzo invalid rlen:%zu, "
222
- "expected:%lu\n" , KERN_ERR ,
223
- F2FS_I_SB (dic -> inode )-> sb -> s_id ,
224
- dic -> rlen ,
225
- PAGE_SIZE << dic -> log_cluster_size );
221
+ f2fs_err_ratelimited (F2FS_I_SB (dic -> inode ),
222
+ "lzo invalid rlen:%zu, expected:%lu" ,
223
+ dic -> rlen , PAGE_SIZE << dic -> log_cluster_size );
226
224
return - EIO ;
227
225
}
228
226
return 0 ;
@@ -294,16 +292,15 @@ static int lz4_decompress_pages(struct decompress_io_ctx *dic)
294
292
ret = LZ4_decompress_safe (dic -> cbuf -> cdata , dic -> rbuf ,
295
293
dic -> clen , dic -> rlen );
296
294
if (ret < 0 ) {
297
- printk_ratelimited ( "%sF2FS-fs (%s): lz4 decompress failed, ret:%d\n" ,
298
- KERN_ERR , F2FS_I_SB ( dic -> inode ) -> sb -> s_id , ret );
295
+ f2fs_err_ratelimited ( F2FS_I_SB ( dic -> inode ) ,
296
+ "lz4 decompress failed, ret:%d" , ret );
299
297
return - EIO ;
300
298
}
301
299
302
300
if (ret != PAGE_SIZE << dic -> log_cluster_size ) {
303
- printk_ratelimited ("%sF2FS-fs (%s): lz4 invalid ret:%d, "
304
- "expected:%lu\n" , KERN_ERR ,
305
- F2FS_I_SB (dic -> inode )-> sb -> s_id , ret ,
306
- PAGE_SIZE << dic -> log_cluster_size );
301
+ f2fs_err_ratelimited (F2FS_I_SB (dic -> inode ),
302
+ "lz4 invalid ret:%d, expected:%lu" ,
303
+ ret , PAGE_SIZE << dic -> log_cluster_size );
307
304
return - EIO ;
308
305
}
309
306
return 0 ;
@@ -350,9 +347,8 @@ static int zstd_init_compress_ctx(struct compress_ctx *cc)
350
347
351
348
stream = zstd_init_cstream (& params , 0 , workspace , workspace_size );
352
349
if (!stream ) {
353
- printk_ratelimited ("%sF2FS-fs (%s): %s zstd_init_cstream failed\n" ,
354
- KERN_ERR , F2FS_I_SB (cc -> inode )-> sb -> s_id ,
355
- __func__ );
350
+ f2fs_err_ratelimited (F2FS_I_SB (cc -> inode ),
351
+ "%s zstd_init_cstream failed" , __func__ );
356
352
kvfree (workspace );
357
353
return - EIO ;
358
354
}
@@ -390,16 +386,16 @@ static int zstd_compress_pages(struct compress_ctx *cc)
390
386
391
387
ret = zstd_compress_stream (stream , & outbuf , & inbuf );
392
388
if (zstd_is_error (ret )) {
393
- printk_ratelimited ( "%sF2FS-fs (%s): %s zstd_compress_stream failed, ret: %d\n" ,
394
- KERN_ERR , F2FS_I_SB ( cc -> inode ) -> sb -> s_id ,
389
+ f2fs_err_ratelimited ( F2FS_I_SB ( cc -> inode ) ,
390
+ "%s zstd_compress_stream failed, ret: %d" ,
395
391
__func__ , zstd_get_error_code (ret ));
396
392
return - EIO ;
397
393
}
398
394
399
395
ret = zstd_end_stream (stream , & outbuf );
400
396
if (zstd_is_error (ret )) {
401
- printk_ratelimited ( "%sF2FS-fs (%s): %s zstd_end_stream returned %d\n" ,
402
- KERN_ERR , F2FS_I_SB ( cc -> inode ) -> sb -> s_id ,
397
+ f2fs_err_ratelimited ( F2FS_I_SB ( cc -> inode ) ,
398
+ "%s zstd_end_stream returned %d" ,
403
399
__func__ , zstd_get_error_code (ret ));
404
400
return - EIO ;
405
401
}
@@ -432,9 +428,8 @@ static int zstd_init_decompress_ctx(struct decompress_io_ctx *dic)
432
428
433
429
stream = zstd_init_dstream (max_window_size , workspace , workspace_size );
434
430
if (!stream ) {
435
- printk_ratelimited ("%sF2FS-fs (%s): %s zstd_init_dstream failed\n" ,
436
- KERN_ERR , F2FS_I_SB (dic -> inode )-> sb -> s_id ,
437
- __func__ );
431
+ f2fs_err_ratelimited (F2FS_I_SB (dic -> inode ),
432
+ "%s zstd_init_dstream failed" , __func__ );
438
433
kvfree (workspace );
439
434
return - EIO ;
440
435
}
@@ -469,16 +464,15 @@ static int zstd_decompress_pages(struct decompress_io_ctx *dic)
469
464
470
465
ret = zstd_decompress_stream (stream , & outbuf , & inbuf );
471
466
if (zstd_is_error (ret )) {
472
- printk_ratelimited ( "%sF2FS-fs (%s): %s zstd_decompress_stream failed, ret: %d\n" ,
473
- KERN_ERR , F2FS_I_SB ( dic -> inode ) -> sb -> s_id ,
467
+ f2fs_err_ratelimited ( F2FS_I_SB ( dic -> inode ) ,
468
+ "%s zstd_decompress_stream failed, ret: %d" ,
474
469
__func__ , zstd_get_error_code (ret ));
475
470
return - EIO ;
476
471
}
477
472
478
473
if (dic -> rlen != outbuf .pos ) {
479
- printk_ratelimited ("%sF2FS-fs (%s): %s ZSTD invalid rlen:%zu, "
480
- "expected:%lu\n" , KERN_ERR ,
481
- F2FS_I_SB (dic -> inode )-> sb -> s_id ,
474
+ f2fs_err_ratelimited (F2FS_I_SB (dic -> inode ),
475
+ "%s ZSTD invalid rlen:%zu, expected:%lu" ,
482
476
__func__ , dic -> rlen ,
483
477
PAGE_SIZE << dic -> log_cluster_size );
484
478
return - EIO ;
0 commit comments