~ubuntu-branches/ubuntu/utopic/crash/utopic-proposed

« back to all changes in this revision

Viewing changes to filesys.c

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2008-05-05 12:54:24 UTC
  • mfrom: (0.1.10 upstream) (2.1.3 lenny)
  • Revision ID: james.westby@ubuntu.com-20080505125424-5q3qi10b5t8f1hc1
Tags: 4.0-6.3-1ubuntu1
* Merge from debian unstable, remaining changes:
  - debian/patches/01_spu_commands.dpatch:
    + SPU extension support
  - debian/rules:
    + Build SPU on powerpc

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* filesys.c - core analysis suite
2
2
 *
3
3
 * Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc.
4
 
 * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 David Anderson
5
 
 * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Red Hat, Inc. All rights reserved.
 
4
 * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 David Anderson
 
5
 * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Red Hat, Inc. All rights reserved.
6
6
 *
7
7
 * This program is free software; you can redistribute it and/or modify
8
8
 * it under the terms of the GNU General Public License as published by
240
240
 
241
241
        if (match_file_string(pc->namelist, kt->proc_version, buffer)) {
242
242
                if (CRASHDEBUG(1)) {
243
 
                        fprintf(fp, "/proc/version:\n%s", kt->proc_version);
 
243
                        fprintf(fp, "/proc/version:\n%s\n", kt->proc_version);
244
244
                        fprintf(fp, "%s:\n%s", pc->namelist, buffer);
245
245
                }
246
246
                return;
709
709
        
710
710
        fclose(version);
711
711
 
 
712
        strip_linefeeds(kt->proc_version);
 
713
 
712
714
        return TRUE;
713
715
}
714
716
 
3484
3486
#define RADIX_TREE_MAP_SHIFT  6
3485
3487
#define RADIX_TREE_MAP_SIZE  (1UL << RADIX_TREE_MAP_SHIFT)
3486
3488
#define RADIX_TREE_MAP_MASK  (RADIX_TREE_MAP_SIZE-1)
 
3489
#define RADIX_TREE_TAGS         2
 
3490
#define RADIX_TREE_TAG_LONGS    \
 
3491
        ((RADIX_TREE_MAP_SIZE + BITS_PER_LONG - 1) / BITS_PER_LONG)
3487
3492
 
3488
3493
struct radix_tree_node {
3489
3494
        unsigned int    count;
3490
3495
        void            *slots[RADIX_TREE_MAP_SIZE];
 
3496
        unsigned long   tags[RADIX_TREE_TAGS][RADIX_TREE_TAG_LONGS];
3491
3497
};
3492
3498
 
3493
3499
/*
3639
3645
radix_tree_lookup(ulong root_rnode, ulong index, int height)
3640
3646
{
3641
3647
        unsigned int shift;
3642
 
        struct radix_tree_node **slot;
 
3648
        void *slot;
3643
3649
        struct radix_tree_node slotbuf;
3644
 
        void **kslotp, **uslotp;
3645
3650
 
3646
3651
        shift = (height-1) * RADIX_TREE_MAP_SHIFT;
3647
 
        kslotp = (void **)root_rnode;
 
3652
 
 
3653
        readmem(root_rnode, KVADDR, &slot, sizeof(void *),
 
3654
                "radix_tree_root rnode", FAULT_ON_ERROR);
3648
3655
 
3649
3656
        while (height > 0) {
3650
 
                readmem((ulong)kslotp, KVADDR, &slot, sizeof(void *),
3651
 
                        "radix_tree_node slot", FAULT_ON_ERROR);
3652
3657
 
3653
3658
                if (slot == NULL)
3654
3659
                        return NULL;
3657
3662
                        sizeof(struct radix_tree_node),
3658
3663
                        "radix_tree_node struct", FAULT_ON_ERROR);
3659
3664
 
3660
 
                uslotp = (void **)
3661
 
                    (slotbuf.slots + ((index >> shift) & RADIX_TREE_MAP_MASK));
3662
 
                kslotp = *uslotp;
3663
 
 
 
3665
                slot = slotbuf.slots[((index >> shift) & RADIX_TREE_MAP_MASK)];
 
3666
                
3664
3667
                shift -= RADIX_TREE_MAP_SHIFT;
3665
3668
                height--;
3666
3669
        }
3667
3670
 
3668
 
        return (void *) kslotp;
 
3671
        return slot;
3669
3672
}
3670
3673
 
3671
3674
int