mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:44:45 +01:00
f2fs: make FAULT_DISCARD obsolete
__blkdev_issue_discard() in __submit_discard_cmd() will never fail, so let's make FAULT_DISCARD fault injection obsolete. Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
ce2739e482
commit
1dd3b437d4
4 changed files with 6 additions and 18 deletions
|
|
@ -732,7 +732,7 @@ Description: Support configuring fault injection type, should be
|
|||
FAULT_TRUNCATE 0x00000400
|
||||
FAULT_READ_IO 0x00000800
|
||||
FAULT_CHECKPOINT 0x00001000
|
||||
FAULT_DISCARD 0x00002000
|
||||
FAULT_DISCARD 0x00002000 (obsolete)
|
||||
FAULT_WRITE_IO 0x00004000
|
||||
FAULT_SLAB_ALLOC 0x00008000
|
||||
FAULT_DQUOT_INIT 0x00010000
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ fault_type=%d Support configuring fault injection type, should be
|
|||
FAULT_TRUNCATE 0x00000400
|
||||
FAULT_READ_IO 0x00000800
|
||||
FAULT_CHECKPOINT 0x00001000
|
||||
FAULT_DISCARD 0x00002000
|
||||
FAULT_DISCARD 0x00002000 (obsolete)
|
||||
FAULT_WRITE_IO 0x00004000
|
||||
FAULT_SLAB_ALLOC 0x00008000
|
||||
FAULT_DQUOT_INIT 0x00010000
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ enum {
|
|||
FAULT_TRUNCATE,
|
||||
FAULT_READ_IO,
|
||||
FAULT_CHECKPOINT,
|
||||
FAULT_DISCARD,
|
||||
FAULT_DISCARD, /* it's obsolete due to __blkdev_issue_discard() will never fail */
|
||||
FAULT_WRITE_IO,
|
||||
FAULT_SLAB_ALLOC,
|
||||
FAULT_DQUOT_INIT,
|
||||
|
|
|
|||
|
|
@ -1287,7 +1287,6 @@ static int __submit_discard_cmd(struct f2fs_sb_info *sbi,
|
|||
&(dcc->fstrim_list) : &(dcc->wait_list);
|
||||
blk_opf_t flag = dpolicy->sync ? REQ_SYNC : 0;
|
||||
block_t lstart, start, len, total_len;
|
||||
int err = 0;
|
||||
|
||||
if (dc->state != D_PREP)
|
||||
return 0;
|
||||
|
|
@ -1328,7 +1327,7 @@ static int __submit_discard_cmd(struct f2fs_sb_info *sbi,
|
|||
|
||||
dc->di.len = 0;
|
||||
|
||||
while (total_len && *issued < dpolicy->max_requests && !err) {
|
||||
while (total_len && *issued < dpolicy->max_requests) {
|
||||
struct bio *bio = NULL;
|
||||
unsigned long flags;
|
||||
bool last = true;
|
||||
|
|
@ -1344,17 +1343,6 @@ static int __submit_discard_cmd(struct f2fs_sb_info *sbi,
|
|||
|
||||
dc->di.len += len;
|
||||
|
||||
err = 0;
|
||||
if (time_to_inject(sbi, FAULT_DISCARD)) {
|
||||
err = -EIO;
|
||||
spin_lock_irqsave(&dc->lock, flags);
|
||||
if (dc->state == D_PARTIAL)
|
||||
dc->state = D_SUBMIT;
|
||||
spin_unlock_irqrestore(&dc->lock, flags);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
__blkdev_issue_discard(bdev, SECTOR_FROM_BLOCK(start),
|
||||
SECTOR_FROM_BLOCK(len), GFP_NOFS, &bio);
|
||||
f2fs_bug_on(sbi, !bio);
|
||||
|
|
@ -1393,11 +1381,11 @@ static int __submit_discard_cmd(struct f2fs_sb_info *sbi,
|
|||
len = total_len;
|
||||
}
|
||||
|
||||
if (!err && len) {
|
||||
if (len) {
|
||||
dcc->undiscard_blks -= len;
|
||||
__update_discard_tree_range(sbi, bdev, lstart, start, len);
|
||||
}
|
||||
return err;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __insert_discard_cmd(struct f2fs_sb_info *sbi,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue