compress.c (1d1df41c5a33359a00e919d54eaebfb789711fdc) | compress.c (e4544b63a7ee49e7fbebf35ece0a6acd3b9617ae) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * f2fs compress support 4 * 5 * Copyright (c) 2019 Chao Yu <chao@kernel.org> 6 */ 7 8#include <linux/fs.h> --- 1253 unchanged lines hidden (view full) --- 1262 } 1263 1264 if (IS_NOQUOTA(inode)) { 1265 /* 1266 * We need to wait for node_write to avoid block allocation during 1267 * checkpoint. This can only happen to quota writes which can cause 1268 * the below discard race condition. 1269 */ | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * f2fs compress support 4 * 5 * Copyright (c) 2019 Chao Yu <chao@kernel.org> 6 */ 7 8#include <linux/fs.h> --- 1253 unchanged lines hidden (view full) --- 1262 } 1263 1264 if (IS_NOQUOTA(inode)) { 1265 /* 1266 * We need to wait for node_write to avoid block allocation during 1267 * checkpoint. This can only happen to quota writes which can cause 1268 * the below discard race condition. 1269 */ |
1270 down_read(&sbi->node_write); | 1270 f2fs_down_read(&sbi->node_write); |
1271 } else if (!f2fs_trylock_op(sbi)) { 1272 goto out_free; 1273 } 1274 1275 set_new_dnode(&dn, cc->inode, NULL, NULL, 0); 1276 1277 err = f2fs_get_dnode_of_data(&dn, start_idx, LOOKUP_NODE); 1278 if (err) --- 100 unchanged lines hidden (view full) --- 1379 add_compr_block_stat(inode, cc->valid_nr_cpages); 1380 1381 set_inode_flag(cc->inode, FI_APPEND_WRITE); 1382 if (cc->cluster_idx == 0) 1383 set_inode_flag(inode, FI_FIRST_BLOCK_WRITTEN); 1384 1385 f2fs_put_dnode(&dn); 1386 if (IS_NOQUOTA(inode)) | 1271 } else if (!f2fs_trylock_op(sbi)) { 1272 goto out_free; 1273 } 1274 1275 set_new_dnode(&dn, cc->inode, NULL, NULL, 0); 1276 1277 err = f2fs_get_dnode_of_data(&dn, start_idx, LOOKUP_NODE); 1278 if (err) --- 100 unchanged lines hidden (view full) --- 1379 add_compr_block_stat(inode, cc->valid_nr_cpages); 1380 1381 set_inode_flag(cc->inode, FI_APPEND_WRITE); 1382 if (cc->cluster_idx == 0) 1383 set_inode_flag(inode, FI_FIRST_BLOCK_WRITTEN); 1384 1385 f2fs_put_dnode(&dn); 1386 if (IS_NOQUOTA(inode)) |
1387 up_read(&sbi->node_write); | 1387 f2fs_up_read(&sbi->node_write); |
1388 else 1389 f2fs_unlock_op(sbi); 1390 1391 spin_lock(&fi->i_size_lock); 1392 if (fi->last_disk_size < psize) 1393 fi->last_disk_size = psize; 1394 spin_unlock(&fi->i_size_lock); 1395 --- 9 unchanged lines hidden (view full) --- 1405 for (--i; i >= 0; i--) 1406 fscrypt_finalize_bounce_page(&cc->cpages[i]); 1407out_put_cic: 1408 kmem_cache_free(cic_entry_slab, cic); 1409out_put_dnode: 1410 f2fs_put_dnode(&dn); 1411out_unlock_op: 1412 if (IS_NOQUOTA(inode)) | 1388 else 1389 f2fs_unlock_op(sbi); 1390 1391 spin_lock(&fi->i_size_lock); 1392 if (fi->last_disk_size < psize) 1393 fi->last_disk_size = psize; 1394 spin_unlock(&fi->i_size_lock); 1395 --- 9 unchanged lines hidden (view full) --- 1405 for (--i; i >= 0; i--) 1406 fscrypt_finalize_bounce_page(&cc->cpages[i]); 1407out_put_cic: 1408 kmem_cache_free(cic_entry_slab, cic); 1409out_put_dnode: 1410 f2fs_put_dnode(&dn); 1411out_unlock_op: 1412 if (IS_NOQUOTA(inode)) |
1413 up_read(&sbi->node_write); | 1413 f2fs_up_read(&sbi->node_write); |
1414 else 1415 f2fs_unlock_op(sbi); 1416out_free: 1417 for (i = 0; i < cc->valid_nr_cpages; i++) { 1418 f2fs_compress_free_page(cc->cpages[i]); 1419 cc->cpages[i] = NULL; 1420 } 1421 page_array_free(cc->inode, cc->cpages, cc->nr_cpages); --- 559 unchanged lines hidden --- | 1414 else 1415 f2fs_unlock_op(sbi); 1416out_free: 1417 for (i = 0; i < cc->valid_nr_cpages; i++) { 1418 f2fs_compress_free_page(cc->cpages[i]); 1419 cc->cpages[i] = NULL; 1420 } 1421 page_array_free(cc->inode, cc->cpages, cc->nr_cpages); --- 559 unchanged lines hidden --- |