~ubuntu-branches/ubuntu/precise/linux-linaro-u8500/precise

« back to all changes in this revision

Viewing changes to mm/swapfile.c

  • Committer: Bazaar Package Importer
  • Author(s): John Rigby, Upstream Fixes, Andy Green, John Rigby
  • Date: 2011-04-14 12:16:06 UTC
  • Revision ID: james.westby@ubuntu.com-20110414121606-b77podkyqgr2oix7
Tags: 2.6.38-1002.3
[ Upstream Fixes ]

* MUSB: shutdown: Make sure block is awake before doing shutdown
  - LP: #745737
* Fixed gpio polarity of gpio USB-phy reset.
  - LP: #747639

[ Andy Green ]

* LINARO: SAUCE: disable CONFIG_OMAP_RESET_CLOCKS
  - LP: #752900

[ John Rigby ]

* Rebase to new upstreams:
  Linux v2.6.38.1
  linaro-linux-2.6.38-upstream-29Mar2011
  Ubuntu-2.6.38-7.35
* SAUCE: OMAP4: clock: wait for module to become accessible on
  a clk enable
  - LP: #745737
* Rebase to new upstreams:
  Linux v2.6.38.2
  linaro-linux-2.6.38-upstream-5Apr2011
  Ubuntu-2.6.38-8.41
  - LP: #732842
* Update configs for device tree, dvfs and lttng
* LINARO: add building of dtb's
* LINARO: SAUCE: Disable lowest operating freqs on omap34xx
  - LP: #732912

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
#include <linux/syscalls.h>
32
32
#include <linux/memcontrol.h>
33
33
#include <linux/poll.h>
 
34
#include <trace/swap.h>
34
35
 
35
36
#include <asm/pgtable.h>
36
37
#include <asm/tlbflush.h>
37
38
#include <linux/swapops.h>
38
39
#include <linux/page_cgroup.h>
39
40
 
 
41
DEFINE_TRACE(swap_file_open);
 
42
DEFINE_TRACE(swap_file_close);
 
43
 
40
44
static bool swap_count_continued(struct swap_info_struct *, pgoff_t,
41
45
                                 unsigned char);
42
46
static void free_swap_count_continuations(struct swap_info_struct *);
1675
1679
        swap_map = p->swap_map;
1676
1680
        p->swap_map = NULL;
1677
1681
        p->flags = 0;
 
1682
        trace_swap_file_close(swap_file);
1678
1683
        spin_unlock(&swap_lock);
1679
1684
        mutex_unlock(&swapon_mutex);
1680
1685
        vfree(swap_map);
2135
2140
                swap_list.head = swap_list.next = type;
2136
2141
        else
2137
2142
                swap_info[prev]->next = type;
 
2143
        trace_swap_file_open(swap_file, name);
2138
2144
        spin_unlock(&swap_lock);
2139
2145
        mutex_unlock(&swapon_mutex);
2140
2146
        atomic_inc(&proc_poll_event);
2155
2161
        p->flags = 0;
2156
2162
        spin_unlock(&swap_lock);
2157
2163
        vfree(swap_map);
2158
 
        if (swap_file)
 
2164
        if (swap_file) {
 
2165
                if (did_down) {
 
2166
                        mutex_unlock(&inode->i_mutex);
 
2167
                        did_down = 0;
 
2168
                }
2159
2169
                filp_close(swap_file, NULL);
 
2170
        }
2160
2171
out:
2161
2172
        if (page && !IS_ERR(page)) {
2162
2173
                kunmap(page);
2286
2297
        return err;
2287
2298
}
2288
2299
 
 
2300
struct swap_info_struct *
 
2301
get_swap_info_struct(unsigned type)
 
2302
{
 
2303
        return swap_info[type];
 
2304
}
 
2305
EXPORT_SYMBOL_GPL(get_swap_info_struct);
 
2306
 
2289
2307
/*
2290
2308
 * @entry: swap entry for which we allocate swap cache.
2291
2309
 *
2583
2601
                }
2584
2602
        }
2585
2603
}
 
2604
 
 
2605
void ltt_dump_swap_files(void *call_data)
 
2606
{
 
2607
        int type;
 
2608
        struct swap_info_struct *p = NULL;
 
2609
 
 
2610
        mutex_lock(&swapon_mutex);
 
2611
        for (type = swap_list.head; type >= 0; type = swap_info[type]->next) {
 
2612
                p = swap_info[type];
 
2613
                if (!(p->flags & SWP_WRITEOK))
 
2614
                        continue;
 
2615
                __trace_mark(0, swap_state, statedump_swap_files, call_data,
 
2616
                        "filp %p vfsmount %p dname %s",
 
2617
                        p->swap_file, p->swap_file->f_vfsmnt,
 
2618
                        p->swap_file->f_dentry->d_name.name);
 
2619
        }
 
2620
        mutex_unlock(&swapon_mutex);
 
2621
}
 
2622
EXPORT_SYMBOL_GPL(ltt_dump_swap_files);