diff options
Diffstat (limited to 'fs/reiserfs/bitmap.c')
-rw-r--r-- | fs/reiserfs/bitmap.c | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/fs/reiserfs/bitmap.c b/fs/reiserfs/bitmap.c index d1aca1df4f9..a945cd26522 100644 --- a/fs/reiserfs/bitmap.c +++ b/fs/reiserfs/bitmap.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/reiserfs_fs_sb.h> | 13 | #include <linux/reiserfs_fs_sb.h> |
14 | #include <linux/reiserfs_fs_i.h> | 14 | #include <linux/reiserfs_fs_i.h> |
15 | #include <linux/quotaops.h> | 15 | #include <linux/quotaops.h> |
16 | #include <linux/seq_file.h> | ||
16 | 17 | ||
17 | #define PREALLOCATION_SIZE 9 | 18 | #define PREALLOCATION_SIZE 9 |
18 | 19 | ||
@@ -634,6 +635,96 @@ int reiserfs_parse_alloc_options(struct super_block *s, char *options) | |||
634 | return 0; | 635 | return 0; |
635 | } | 636 | } |
636 | 637 | ||
638 | static void print_sep(struct seq_file *seq, int *first) | ||
639 | { | ||
640 | if (!*first) | ||
641 | seq_puts(seq, ":"); | ||
642 | else | ||
643 | *first = 0; | ||
644 | } | ||
645 | |||
646 | void show_alloc_options(struct seq_file *seq, struct super_block *s) | ||
647 | { | ||
648 | int first = 1; | ||
649 | |||
650 | if (SB_ALLOC_OPTS(s) == ((1 << _ALLOC_skip_busy) | | ||
651 | (1 << _ALLOC_dirid_groups) | (1 << _ALLOC_packing_groups))) | ||
652 | return; | ||
653 | |||
654 | seq_puts(seq, ",alloc="); | ||
655 | |||
656 | if (TEST_OPTION(concentrating_formatted_nodes, s)) { | ||
657 | print_sep(seq, &first); | ||
658 | if (REISERFS_SB(s)->s_alloc_options.border != 10) { | ||
659 | seq_printf(seq, "concentrating_formatted_nodes=%d", | ||
660 | 100 / REISERFS_SB(s)->s_alloc_options.border); | ||
661 | } else | ||
662 | seq_puts(seq, "concentrating_formatted_nodes"); | ||
663 | } | ||
664 | if (TEST_OPTION(displacing_large_files, s)) { | ||
665 | print_sep(seq, &first); | ||
666 | if (REISERFS_SB(s)->s_alloc_options.large_file_size != 16) { | ||
667 | seq_printf(seq, "displacing_large_files=%lu", | ||
668 | REISERFS_SB(s)->s_alloc_options.large_file_size); | ||
669 | } else | ||
670 | seq_puts(seq, "displacing_large_files"); | ||
671 | } | ||
672 | if (TEST_OPTION(displacing_new_packing_localities, s)) { | ||
673 | print_sep(seq, &first); | ||
674 | seq_puts(seq, "displacing_new_packing_localities"); | ||
675 | } | ||
676 | if (TEST_OPTION(old_hashed_relocation, s)) { | ||
677 | print_sep(seq, &first); | ||
678 | seq_puts(seq, "old_hashed_relocation"); | ||
679 | } | ||
680 | if (TEST_OPTION(new_hashed_relocation, s)) { | ||
681 | print_sep(seq, &first); | ||
682 | seq_puts(seq, "new_hashed_relocation"); | ||
683 | } | ||
684 | if (TEST_OPTION(dirid_groups, s)) { | ||
685 | print_sep(seq, &first); | ||
686 | seq_puts(seq, "dirid_groups"); | ||
687 | } | ||
688 | if (TEST_OPTION(oid_groups, s)) { | ||
689 | print_sep(seq, &first); | ||
690 | seq_puts(seq, "oid_groups"); | ||
691 | } | ||
692 | if (TEST_OPTION(packing_groups, s)) { | ||
693 | print_sep(seq, &first); | ||
694 | seq_puts(seq, "packing_groups"); | ||
695 | } | ||
696 | if (TEST_OPTION(hashed_formatted_nodes, s)) { | ||
697 | print_sep(seq, &first); | ||
698 | seq_puts(seq, "hashed_formatted_nodes"); | ||
699 | } | ||
700 | if (TEST_OPTION(skip_busy, s)) { | ||
701 | print_sep(seq, &first); | ||
702 | seq_puts(seq, "skip_busy"); | ||
703 | } | ||
704 | if (TEST_OPTION(hundredth_slices, s)) { | ||
705 | print_sep(seq, &first); | ||
706 | seq_puts(seq, "hundredth_slices"); | ||
707 | } | ||
708 | if (TEST_OPTION(old_way, s)) { | ||
709 | print_sep(seq, &first); | ||
710 | seq_puts(seq, "old_way"); | ||
711 | } | ||
712 | if (TEST_OPTION(displace_based_on_dirid, s)) { | ||
713 | print_sep(seq, &first); | ||
714 | seq_puts(seq, "displace_based_on_dirid"); | ||
715 | } | ||
716 | if (REISERFS_SB(s)->s_alloc_options.preallocmin != 0) { | ||
717 | print_sep(seq, &first); | ||
718 | seq_printf(seq, "preallocmin=%d", | ||
719 | REISERFS_SB(s)->s_alloc_options.preallocmin); | ||
720 | } | ||
721 | if (REISERFS_SB(s)->s_alloc_options.preallocsize != 17) { | ||
722 | print_sep(seq, &first); | ||
723 | seq_printf(seq, "preallocsize=%d", | ||
724 | REISERFS_SB(s)->s_alloc_options.preallocsize); | ||
725 | } | ||
726 | } | ||
727 | |||
637 | static inline void new_hashed_relocation(reiserfs_blocknr_hint_t * hint) | 728 | static inline void new_hashed_relocation(reiserfs_blocknr_hint_t * hint) |
638 | { | 729 | { |
639 | char *hash_in; | 730 | char *hash_in; |