diff options
author | Jiro SEKIBA <jir@unicus.jp> | 2010-01-30 04:06:35 -0500 |
---|---|---|
committer | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2010-02-12 22:26:02 -0500 |
commit | e902ec9906e844f4613fa6190c6fa65f162dc86e (patch) | |
tree | ee0ea829ae04a30fb01c119f050a3967304e55ba /fs/nilfs2/segment.c | |
parent | 724e6d3fe8003c3f60bf404bf22e4e331327c596 (diff) |
nilfs2: issue discard request after cleaning segments
This adds a function to send discard requests for given array of
segment numbers, and calls the function when garbage collection
succeeded.
Signed-off-by: Jiro SEKIBA <jir@unicus.jp>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2/segment.c')
-rw-r--r-- | fs/nilfs2/segment.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index 105b508b47a8..9280b0f10792 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c | |||
@@ -2560,6 +2560,16 @@ int nilfs_clean_segments(struct super_block *sb, struct nilfs_argv *argv, | |||
2560 | set_current_state(TASK_INTERRUPTIBLE); | 2560 | set_current_state(TASK_INTERRUPTIBLE); |
2561 | schedule_timeout(sci->sc_interval); | 2561 | schedule_timeout(sci->sc_interval); |
2562 | } | 2562 | } |
2563 | if (nilfs_test_opt(sbi, DISCARD)) { | ||
2564 | int ret = nilfs_discard_segments(nilfs, sci->sc_freesegs, | ||
2565 | sci->sc_nfreesegs); | ||
2566 | if (ret) { | ||
2567 | printk(KERN_WARNING | ||
2568 | "NILFS warning: error %d on discard request, " | ||
2569 | "turning discards off for the device\n", ret); | ||
2570 | nilfs_clear_opt(sbi, DISCARD); | ||
2571 | } | ||
2572 | } | ||
2563 | 2573 | ||
2564 | out_unlock: | 2574 | out_unlock: |
2565 | sci->sc_freesegs = NULL; | 2575 | sci->sc_freesegs = NULL; |