diff options
Diffstat (limited to 'fs/fat/fatent.c')
-rw-r--r-- | fs/fat/fatent.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/fs/fat/fatent.c b/fs/fat/fatent.c index a81037721a6f..81184d3b75a3 100644 --- a/fs/fat/fatent.c +++ b/fs/fat/fatent.c | |||
@@ -566,16 +566,21 @@ int fat_free_clusters(struct inode *inode, int cluster) | |||
566 | goto error; | 566 | goto error; |
567 | } | 567 | } |
568 | 568 | ||
569 | /* | 569 | if (sbi->options.discard) { |
570 | * Issue discard for the sectors we no longer care about, | 570 | /* |
571 | * batching contiguous clusters into one request | 571 | * Issue discard for the sectors we no longer |
572 | */ | 572 | * care about, batching contiguous clusters |
573 | if (cluster != fatent.entry + 1) { | 573 | * into one request |
574 | int nr_clus = fatent.entry - first_cl + 1; | 574 | */ |
575 | 575 | if (cluster != fatent.entry + 1) { | |
576 | sb_issue_discard(sb, fat_clus_to_blknr(sbi, first_cl), | 576 | int nr_clus = fatent.entry - first_cl + 1; |
577 | nr_clus * sbi->sec_per_clus); | 577 | |
578 | first_cl = cluster; | 578 | sb_issue_discard(sb, |
579 | fat_clus_to_blknr(sbi, first_cl), | ||
580 | nr_clus * sbi->sec_per_clus); | ||
581 | |||
582 | first_cl = cluster; | ||
583 | } | ||
579 | } | 584 | } |
580 | 585 | ||
581 | ops->ent_put(&fatent, FAT_ENT_FREE); | 586 | ops->ent_put(&fatent, FAT_ENT_FREE); |