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/super.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/super.c')
-rw-r--r-- | fs/nilfs2/super.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index 8173faee31e6..3f88401a375b 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c | |||
@@ -481,6 +481,8 @@ static int nilfs_show_options(struct seq_file *seq, struct vfsmount *vfs) | |||
481 | seq_printf(seq, ",order=strict"); | 481 | seq_printf(seq, ",order=strict"); |
482 | if (nilfs_test_opt(sbi, NORECOVERY)) | 482 | if (nilfs_test_opt(sbi, NORECOVERY)) |
483 | seq_printf(seq, ",norecovery"); | 483 | seq_printf(seq, ",norecovery"); |
484 | if (nilfs_test_opt(sbi, DISCARD)) | ||
485 | seq_printf(seq, ",discard"); | ||
484 | 486 | ||
485 | return 0; | 487 | return 0; |
486 | } | 488 | } |
@@ -550,7 +552,7 @@ static const struct export_operations nilfs_export_ops = { | |||
550 | enum { | 552 | enum { |
551 | Opt_err_cont, Opt_err_panic, Opt_err_ro, | 553 | Opt_err_cont, Opt_err_panic, Opt_err_ro, |
552 | Opt_nobarrier, Opt_snapshot, Opt_order, Opt_norecovery, | 554 | Opt_nobarrier, Opt_snapshot, Opt_order, Opt_norecovery, |
553 | Opt_err, | 555 | Opt_discard, Opt_err, |
554 | }; | 556 | }; |
555 | 557 | ||
556 | static match_table_t tokens = { | 558 | static match_table_t tokens = { |
@@ -561,6 +563,7 @@ static match_table_t tokens = { | |||
561 | {Opt_snapshot, "cp=%u"}, | 563 | {Opt_snapshot, "cp=%u"}, |
562 | {Opt_order, "order=%s"}, | 564 | {Opt_order, "order=%s"}, |
563 | {Opt_norecovery, "norecovery"}, | 565 | {Opt_norecovery, "norecovery"}, |
566 | {Opt_discard, "discard"}, | ||
564 | {Opt_err, NULL} | 567 | {Opt_err, NULL} |
565 | }; | 568 | }; |
566 | 569 | ||
@@ -614,6 +617,9 @@ static int parse_options(char *options, struct super_block *sb) | |||
614 | case Opt_norecovery: | 617 | case Opt_norecovery: |
615 | nilfs_set_opt(sbi, NORECOVERY); | 618 | nilfs_set_opt(sbi, NORECOVERY); |
616 | break; | 619 | break; |
620 | case Opt_discard: | ||
621 | nilfs_set_opt(sbi, DISCARD); | ||
622 | break; | ||
617 | default: | 623 | default: |
618 | printk(KERN_ERR | 624 | printk(KERN_ERR |
619 | "NILFS: Unrecognized mount option \"%s\"\n", p); | 625 | "NILFS: Unrecognized mount option \"%s\"\n", p); |