~ubuntu-branches/ubuntu/quantal/linux-lowlatency/quantal-proposed

« back to all changes in this revision

Viewing changes to fs/reiserfs/bitmap.c

  • Committer: Package Import Robot
  • Author(s): Andy Whitcroft, Andy Whitcroft
  • Date: 2012-06-21 09:16:38 UTC
  • Revision ID: package-import@ubuntu.com-20120621091638-gubhv4nox8xez1ct
Tags: 3.5.0-1.1
[ Andy Whitcroft]

* Rebuild lowlatency against Ubuntu-3.5.0-1.1
* All new configuration system to allow configuration deltas to be
  exposed via debian.lowlatency/config-delta

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
/* Reiserfs block (de)allocator, bitmap-based. */
5
5
 
6
6
#include <linux/time.h>
7
 
#include <linux/reiserfs_fs.h>
 
7
#include "reiserfs.h"
8
8
#include <linux/errno.h>
9
9
#include <linux/buffer_head.h>
10
10
#include <linux/kernel.h>
11
11
#include <linux/pagemap.h>
12
12
#include <linux/vmalloc.h>
13
 
#include <linux/reiserfs_fs_sb.h>
14
 
#include <linux/reiserfs_fs_i.h>
15
13
#include <linux/quotaops.h>
 
14
#include <linux/seq_file.h>
16
15
 
17
16
#define PREALLOCATION_SIZE 9
18
17
 
634
633
        return 0;
635
634
}
636
635
 
 
636
static void print_sep(struct seq_file *seq, int *first)
 
637
{
 
638
        if (!*first)
 
639
                seq_puts(seq, ":");
 
640
        else
 
641
                *first = 0;
 
642
}
 
643
 
 
644
void show_alloc_options(struct seq_file *seq, struct super_block *s)
 
645
{
 
646
        int first = 1;
 
647
 
 
648
        if (SB_ALLOC_OPTS(s) == ((1 << _ALLOC_skip_busy) |
 
649
                (1 << _ALLOC_dirid_groups) | (1 << _ALLOC_packing_groups)))
 
650
                return;
 
651
 
 
652
        seq_puts(seq, ",alloc=");
 
653
 
 
654
        if (TEST_OPTION(concentrating_formatted_nodes, s)) {
 
655
                print_sep(seq, &first);
 
656
                if (REISERFS_SB(s)->s_alloc_options.border != 10) {
 
657
                        seq_printf(seq, "concentrating_formatted_nodes=%d",
 
658
                                100 / REISERFS_SB(s)->s_alloc_options.border);
 
659
                } else
 
660
                        seq_puts(seq, "concentrating_formatted_nodes");
 
661
        }
 
662
        if (TEST_OPTION(displacing_large_files, s)) {
 
663
                print_sep(seq, &first);
 
664
                if (REISERFS_SB(s)->s_alloc_options.large_file_size != 16) {
 
665
                        seq_printf(seq, "displacing_large_files=%lu",
 
666
                            REISERFS_SB(s)->s_alloc_options.large_file_size);
 
667
                } else
 
668
                        seq_puts(seq, "displacing_large_files");
 
669
        }
 
670
        if (TEST_OPTION(displacing_new_packing_localities, s)) {
 
671
                print_sep(seq, &first);
 
672
                seq_puts(seq, "displacing_new_packing_localities");
 
673
        }
 
674
        if (TEST_OPTION(old_hashed_relocation, s)) {
 
675
                print_sep(seq, &first);
 
676
                seq_puts(seq, "old_hashed_relocation");
 
677
        }
 
678
        if (TEST_OPTION(new_hashed_relocation, s)) {
 
679
                print_sep(seq, &first);
 
680
                seq_puts(seq, "new_hashed_relocation");
 
681
        }
 
682
        if (TEST_OPTION(dirid_groups, s)) {
 
683
                print_sep(seq, &first);
 
684
                seq_puts(seq, "dirid_groups");
 
685
        }
 
686
        if (TEST_OPTION(oid_groups, s)) {
 
687
                print_sep(seq, &first);
 
688
                seq_puts(seq, "oid_groups");
 
689
        }
 
690
        if (TEST_OPTION(packing_groups, s)) {
 
691
                print_sep(seq, &first);
 
692
                seq_puts(seq, "packing_groups");
 
693
        }
 
694
        if (TEST_OPTION(hashed_formatted_nodes, s)) {
 
695
                print_sep(seq, &first);
 
696
                seq_puts(seq, "hashed_formatted_nodes");
 
697
        }
 
698
        if (TEST_OPTION(skip_busy, s)) {
 
699
                print_sep(seq, &first);
 
700
                seq_puts(seq, "skip_busy");
 
701
        }
 
702
        if (TEST_OPTION(hundredth_slices, s)) {
 
703
                print_sep(seq, &first);
 
704
                seq_puts(seq, "hundredth_slices");
 
705
        }
 
706
        if (TEST_OPTION(old_way, s)) {
 
707
                print_sep(seq, &first);
 
708
                seq_puts(seq, "old_way");
 
709
        }
 
710
        if (TEST_OPTION(displace_based_on_dirid, s)) {
 
711
                print_sep(seq, &first);
 
712
                seq_puts(seq, "displace_based_on_dirid");
 
713
        }
 
714
        if (REISERFS_SB(s)->s_alloc_options.preallocmin != 0) {
 
715
                print_sep(seq, &first);
 
716
                seq_printf(seq, "preallocmin=%d",
 
717
                                REISERFS_SB(s)->s_alloc_options.preallocmin);
 
718
        }
 
719
        if (REISERFS_SB(s)->s_alloc_options.preallocsize != 17) {
 
720
                print_sep(seq, &first);
 
721
                seq_printf(seq, "preallocsize=%d",
 
722
                                REISERFS_SB(s)->s_alloc_options.preallocsize);
 
723
        }
 
724
}
 
725
 
637
726
static inline void new_hashed_relocation(reiserfs_blocknr_hint_t * hint)
638
727
{
639
728
        char *hash_in;
1273
1362
        struct reiserfs_bitmap_info *bitmap;
1274
1363
        unsigned int bmap_nr = reiserfs_bmap_count(sb);
1275
1364
 
1276
 
        /* Avoid lock recursion in fault case */
1277
 
        reiserfs_write_unlock(sb);
1278
1365
        bitmap = vmalloc(sizeof(*bitmap) * bmap_nr);
1279
 
        reiserfs_write_lock(sb);
1280
1366
        if (bitmap == NULL)
1281
1367
                return -ENOMEM;
1282
1368