Skip to content

Commit

Permalink
Cleanup - indentation, unneeded exports etc.
Browse files Browse the repository at this point in the history
Cleanup indentation & remove unneeded includes and symbol
exports. Remove now unused filesystem freezer code. Generally
minimise the diff from vanilla.

Signed-off-by: Nigel <nigel@tuxonice.net>
  • Loading branch information
Nigel committed Jul 7, 2012
1 parent b3fa8dd commit 00b0d92
Show file tree
Hide file tree
Showing 28 changed files with 28 additions and 120 deletions.
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/83xx/suspend.c
Expand Up @@ -262,7 +262,7 @@ static int mpc83xx_suspend_begin(suspend_state_t state)


static int agent_thread_fn(void *data) static int agent_thread_fn(void *data)
{ {
set_freezable(); set_freezable();


while (1) { while (1) {
wait_event_interruptible(agent_wq, pci_pm_state >= 2); wait_event_interruptible(agent_wq, pci_pm_state >= 2);
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/ps3/device-init.c
Expand Up @@ -841,7 +841,7 @@ static int ps3_probe_thread(void *data)
if (res) if (res)
goto fail_free_irq; goto fail_free_irq;


set_freezable(); set_freezable();


/* Loop here processing the requested notification events. */ /* Loop here processing the requested notification events. */
do { do {
Expand Down
1 change: 0 additions & 1 deletion arch/x86/kernel/reboot.c
Expand Up @@ -747,7 +747,6 @@ void machine_restart(char *cmd)
{ {
machine_ops.restart(cmd); machine_ops.restart(cmd);
} }
EXPORT_SYMBOL_GPL(machine_restart);


void machine_halt(void) void machine_halt(void)
{ {
Expand Down
1 change: 1 addition & 0 deletions arch/x86/mm/pageattr.c
Expand Up @@ -1349,6 +1349,7 @@ void kernel_map_pages(struct page *page, int numpages, int enable)
*/ */
__flush_tlb_all(); __flush_tlb_all();
} }

EXPORT_SYMBOL_GPL(kernel_map_pages); EXPORT_SYMBOL_GPL(kernel_map_pages);


#ifdef CONFIG_HIBERNATION #ifdef CONFIG_HIBERNATION
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpi_pad.c
Expand Up @@ -153,7 +153,7 @@ static int power_saving_thread(void *data)
u64 last_jiffies = 0; u64 last_jiffies = 0;


sched_setscheduler(current, SCHED_RR, &param); sched_setscheduler(current, SCHED_RR, &param);
set_freezable(); set_freezable();


while (!kthread_should_stop()) { while (!kthread_should_stop()) {
int cpu; int cpu;
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/xen-blkback/blkback.c
Expand Up @@ -276,7 +276,7 @@ int xen_blkif_schedule(void *arg)
struct xen_vbd *vbd = &blkif->vbd; struct xen_vbd *vbd = &blkif->vbd;


xen_blkif_get(blkif); xen_blkif_get(blkif);
set_freezable(); set_freezable();


while (!kthread_should_stop()) { while (!kthread_should_stop()) {
if (try_to_freeze()) if (try_to_freeze())
Expand Down
10 changes: 5 additions & 5 deletions drivers/md/md.c
Expand Up @@ -7104,13 +7104,13 @@ void md_do_sync(struct mddev *mddev)
* *
*/ */


set_freezable(); set_freezable();


do { do {
mddev->curr_resync = 2; mddev->curr_resync = 2;


try_again: try_again:
try_to_freeze(); try_to_freeze();


if (kthread_should_stop()) if (kthread_should_stop())
set_bit(MD_RECOVERY_INTR, &mddev->recovery); set_bit(MD_RECOVERY_INTR, &mddev->recovery);
Expand All @@ -7135,7 +7135,7 @@ void md_do_sync(struct mddev *mddev)
*/ */
continue; continue;


try_to_freeze(); try_to_freeze();


/* We need to wait 'interruptible' so as not to /* We need to wait 'interruptible' so as not to
* contribute to the load average, and not to * contribute to the load average, and not to
Expand Down Expand Up @@ -7257,7 +7257,7 @@ void md_do_sync(struct mddev *mddev)
|| kthread_should_stop()); || kthread_should_stop());
} }


try_to_freeze(); try_to_freeze();


if (kthread_should_stop()) if (kthread_should_stop())
goto interrupted; goto interrupted;
Expand Down Expand Up @@ -7302,7 +7302,7 @@ void md_do_sync(struct mddev *mddev)
last_mark = next; last_mark = next;
} }


try_to_freeze(); try_to_freeze();


if (kthread_should_stop()) if (kthread_should_stop())
goto interrupted; goto interrupted;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/irda/stir4200.c
Expand Up @@ -739,7 +739,7 @@ static int stir_transmit_thread(void *arg)
struct net_device *dev = stir->netdev; struct net_device *dev = stir->netdev;
struct sk_buff *skb; struct sk_buff *skb;


set_freezable(); set_freezable();


while (!kthread_should_stop()) { while (!kthread_should_stop()) {
#ifdef CONFIG_PM #ifdef CONFIG_PM
Expand Down
2 changes: 1 addition & 1 deletion drivers/uwb/uwbd.c
Expand Up @@ -271,7 +271,7 @@ static int uwbd(void *param)
struct uwb_event *evt; struct uwb_event *evt;
int should_stop = 0; int should_stop = 0;


set_freezable(); set_freezable();
while (1) { while (1) {
wait_event_interruptible_timeout( wait_event_interruptible_timeout(
rc->uwbd.wq, rc->uwbd.wq,
Expand Down
2 changes: 1 addition & 1 deletion drivers/w1/w1.c
Expand Up @@ -976,7 +976,7 @@ int w1_process(void *data)
* time can be calculated in jiffies once. * time can be calculated in jiffies once.
*/ */
const unsigned long jtime = msecs_to_jiffies(w1_timeout * 1000); const unsigned long jtime = msecs_to_jiffies(w1_timeout * 1000);
set_freezable(); set_freezable();


while (!kthread_should_stop()) { while (!kthread_should_stop()) {
if (dev->search_count) { if (dev->search_count) {
Expand Down
87 changes: 0 additions & 87 deletions fs/block_dev.c
Expand Up @@ -337,93 +337,6 @@ int thaw_bdev(struct block_device *bdev, struct super_block *sb)
} }
EXPORT_SYMBOL(thaw_bdev); EXPORT_SYMBOL(thaw_bdev);


#ifdef CONFIG_FS_FREEZER_DEBUG
#define FS_PRINTK(fmt, args...) printk(fmt, ## args)
#else
#define FS_PRINTK(fmt, args...)
#endif

/* #define DEBUG_FS_FREEZING */

/**
* freeze_filesystems - lock all filesystems and force them into a consistent
* state
* @which: What combination of fuse & non-fuse to freeze.
*/
void freeze_filesystems(int which)
{
struct super_block *sb;

lockdep_off();

/*
* Freeze in reverse order so filesystems dependant upon others are
* frozen in the right order (eg. loopback on ext3).
*/
list_for_each_entry_reverse(sb, &super_blocks, s_list) {
FS_PRINTK(KERN_INFO "Considering %s.%s: (root %p, bdev %x)",
sb->s_type->name ? sb->s_type->name : "?",
sb->s_subtype ? sb->s_subtype : "", sb->s_root,
sb->s_bdev ? sb->s_bdev->bd_dev : 0);

if (sb->s_type->fs_flags & FS_IS_FUSE &&
sb->s_frozen == SB_UNFROZEN &&
which & FS_FREEZER_FUSE) {
sb->s_frozen = SB_FREEZE_TRANS;
sb->s_flags |= MS_FROZEN;
FS_PRINTK("Fuse filesystem done.\n");
continue;
}

if (!sb->s_root || !sb->s_bdev ||
(sb->s_frozen == SB_FREEZE_TRANS) ||
(sb->s_flags & MS_RDONLY) ||
(sb->s_flags & MS_FROZEN) ||
!(which & FS_FREEZER_NORMAL)) {
FS_PRINTK(KERN_INFO "Nope.\n");
continue;
}

FS_PRINTK(KERN_INFO "Freezing %x... ", sb->s_bdev->bd_dev);
freeze_bdev(sb->s_bdev);
sb->s_flags |= MS_FROZEN;
FS_PRINTK(KERN_INFO "Done.\n");
}

lockdep_on();
}

/**
* thaw_filesystems - unlock all filesystems
* @which: What combination of fuse & non-fuse to thaw.
*/
void thaw_filesystems(int which)
{
struct super_block *sb;

lockdep_off();

list_for_each_entry(sb, &super_blocks, s_list) {
if (!(sb->s_flags & MS_FROZEN))
continue;

if (sb->s_type->fs_flags & FS_IS_FUSE) {
if (!(which & FS_FREEZER_FUSE))
continue;

sb->s_frozen = SB_UNFROZEN;
} else {
if (!(which & FS_FREEZER_NORMAL))
continue;

thaw_bdev(sb->s_bdev, sb);
}
sb->s_flags &= ~MS_FROZEN;
}

lockdep_on();
}

static int blkdev_writepage(struct page *page, struct writeback_control *wbc) static int blkdev_writepage(struct page *page, struct writeback_control *wbc)
{ {
return block_write_full_page(page, blkdev_get_block, wbc); return block_write_full_page(page, blkdev_get_block, wbc);
Expand Down
2 changes: 1 addition & 1 deletion fs/btrfs/async-thread.c
Expand Up @@ -301,7 +301,7 @@ static int worker_loop(void *arg)
INIT_LIST_HEAD(&head); INIT_LIST_HEAD(&head);
INIT_LIST_HEAD(&prio_head); INIT_LIST_HEAD(&prio_head);


set_freezable(); set_freezable();


do { do {
again: again:
Expand Down
4 changes: 2 additions & 2 deletions fs/btrfs/disk-io.c
Expand Up @@ -1585,7 +1585,7 @@ static int cleaner_kthread(void *arg)
{ {
struct btrfs_root *root = arg; struct btrfs_root *root = arg;


set_freezable(); set_freezable();


do { do {
vfs_check_frozen(root->fs_info->sb, SB_FREEZE_WRITE); vfs_check_frozen(root->fs_info->sb, SB_FREEZE_WRITE);
Expand Down Expand Up @@ -1618,7 +1618,7 @@ static int transaction_kthread(void *arg)
unsigned long delay; unsigned long delay;
int ret; int ret;


set_freezable(); set_freezable();


do { do {
delay = HZ * 30; delay = HZ * 30;
Expand Down
2 changes: 1 addition & 1 deletion fs/ext4/super.c
Expand Up @@ -2837,7 +2837,7 @@ static int ext4_lazyinit_thread(void *arg)
unsigned long next_wakeup, cur; unsigned long next_wakeup, cur;


BUG_ON(NULL == eli); BUG_ON(NULL == eli);
set_freezable(); set_freezable();


cont_thread: cont_thread:
while (true) { while (true) {
Expand Down
2 changes: 1 addition & 1 deletion fs/gfs2/log.c
Expand Up @@ -932,7 +932,7 @@ int gfs2_logd(void *data)
DEFINE_WAIT(wait); DEFINE_WAIT(wait);
unsigned preflush; unsigned preflush;


set_freezable(); set_freezable();


while (!kthread_should_stop()) { while (!kthread_should_stop()) {


Expand Down
2 changes: 1 addition & 1 deletion fs/gfs2/quota.c
Expand Up @@ -1397,7 +1397,7 @@ int gfs2_quotad(void *data)
DEFINE_WAIT(wait); DEFINE_WAIT(wait);
int empty; int empty;


set_freezable(); set_freezable();


while (!kthread_should_stop()) { while (!kthread_should_stop()) {


Expand Down
2 changes: 1 addition & 1 deletion fs/jfs/jfs_logmgr.c
Expand Up @@ -2337,7 +2337,7 @@ int jfsIOWait(void *arg)
{ {
struct lbuf *bp; struct lbuf *bp;


set_freezable(); set_freezable();


do { do {
spin_lock_irq(&log_redrive_lock); spin_lock_irq(&log_redrive_lock);
Expand Down
4 changes: 2 additions & 2 deletions fs/jfs/jfs_txnmgr.c
Expand Up @@ -2752,7 +2752,7 @@ int jfs_lazycommit(void *arg)
unsigned long flags; unsigned long flags;
struct jfs_sb_info *sbi; struct jfs_sb_info *sbi;


set_freezable(); set_freezable();


do { do {
LAZY_LOCK(flags); LAZY_LOCK(flags);
Expand Down Expand Up @@ -2938,7 +2938,7 @@ int jfs_sync(void *arg)
struct jfs_inode_info *jfs_ip; struct jfs_inode_info *jfs_ip;
tid_t tid; tid_t tid;


set_freezable(); set_freezable();


do { do {
/* /*
Expand Down
2 changes: 1 addition & 1 deletion fs/nilfs2/segment.c
Expand Up @@ -2435,7 +2435,7 @@ static int nilfs_segctor_thread(void *arg)
struct the_nilfs *nilfs = sci->sc_super->s_fs_info; struct the_nilfs *nilfs = sci->sc_super->s_fs_info;
int timeout = 0; int timeout = 0;


set_freezable(); set_freezable();


sci->sc_timer.data = (unsigned long)current; sci->sc_timer.data = (unsigned long)current;
sci->sc_timer.function = nilfs_construction_timeout; sci->sc_timer.function = nilfs_construction_timeout;
Expand Down
2 changes: 1 addition & 1 deletion fs/xfs/xfs_trans_ail.c
Expand Up @@ -544,7 +544,7 @@ xfsaild(
struct xfs_ail *ailp = data; struct xfs_ail *ailp = data;
long tout = 0; /* milliseconds */ long tout = 0; /* milliseconds */


set_freezable(); set_freezable();


while (!kthread_should_stop()) { while (!kthread_should_stop()) {
if (tout && tout <= 20) if (tout && tout <= 20)
Expand Down
2 changes: 1 addition & 1 deletion kernel/kthread.c
Expand Up @@ -342,7 +342,7 @@ int kthread_worker_fn(void *worker_ptr)


WARN_ON(worker->task); WARN_ON(worker->task);
worker->task = current; worker->task = current;
set_freezable(); set_freezable();


repeat: repeat:
set_current_state(TASK_INTERRUPTIBLE); /* mb paired w/ kthread_stop */ set_current_state(TASK_INTERRUPTIBLE); /* mb paired w/ kthread_stop */
Expand Down
1 change: 0 additions & 1 deletion kernel/power/tuxonice.h
Expand Up @@ -16,7 +16,6 @@
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <linux/suspend.h> #include <linux/suspend.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/kmod.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/tuxonice.h> #include <linux/tuxonice.h>
#include <asm/setup.h> #include <asm/setup.h>
Expand Down
2 changes: 1 addition & 1 deletion kernel/power/tuxonice_ui.c
Expand Up @@ -178,7 +178,7 @@ void toi_early_boot_message(int message_detail, int default_answer,


post_ask: post_ask:
if ((warning_reason) && (!continue_req)) if ((warning_reason) && (!continue_req))
machine_restart(NULL); kernel_restart(NULL);


restore_toi_state(orig_state); restore_toi_state(orig_state);
if (continue_req) if (continue_req)
Expand Down
1 change: 0 additions & 1 deletion kernel/power/tuxonice_userui.c
Expand Up @@ -29,7 +29,6 @@
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/vt_kern.h> #include <linux/vt_kern.h>
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/kmod.h>
#include <linux/security.h> #include <linux/security.h>
#include <linux/syscalls.h> #include <linux/syscalls.h>
#include <linux/vt.h> #include <linux/vt.h>
Expand Down
1 change: 0 additions & 1 deletion kernel/power/user.c
Expand Up @@ -13,7 +13,6 @@
#include <linux/syscalls.h> #include <linux/syscalls.h>
#include <linux/reboot.h> #include <linux/reboot.h>
#include <linux/export.h> #include <linux/export.h>
#include <linux/kmod.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
Expand Down
1 change: 0 additions & 1 deletion mm/bootmem.c
Expand Up @@ -33,7 +33,6 @@ EXPORT_SYMBOL(contig_page_data);
unsigned long max_low_pfn; unsigned long max_low_pfn;
unsigned long min_low_pfn; unsigned long min_low_pfn;
unsigned long max_pfn; unsigned long max_pfn;
EXPORT_SYMBOL_GPL(max_pfn);


bootmem_data_t bootmem_node_data[MAX_NUMNODES] __initdata; bootmem_data_t bootmem_node_data[MAX_NUMNODES] __initdata;


Expand Down
1 change: 0 additions & 1 deletion mm/swapfile.c
Expand Up @@ -449,7 +449,6 @@ swp_entry_t get_swap_page(void)
spin_unlock(&swap_lock); spin_unlock(&swap_lock);
return (swp_entry_t) {0}; return (swp_entry_t) {0};
} }
EXPORT_SYMBOL_GPL(get_swap_page);


/* The only caller of this function is now susupend routine */ /* The only caller of this function is now susupend routine */
swp_entry_t get_swap_page_of_type(int type) swp_entry_t get_swap_page_of_type(int type)
Expand Down
4 changes: 2 additions & 2 deletions mm/vmscan.c
Expand Up @@ -2020,8 +2020,8 @@ static inline bool should_continue_reclaim(struct mem_cgroup_zone *mz,
unsigned long pages_for_compaction; unsigned long pages_for_compaction;
unsigned long inactive_lru_pages; unsigned long inactive_lru_pages;


if (sc->hibernation_mode && nr_reclaimed && nr_scanned && sc->nr_to_reclaim >= sc->nr_reclaimed) if (sc->hibernation_mode && nr_reclaimed && nr_scanned && sc->nr_to_reclaim >= sc->nr_reclaimed)
return true; return true;


/* If not in reclaim/compaction mode, stop */ /* If not in reclaim/compaction mode, stop */
if (!(sc->reclaim_mode & RECLAIM_MODE_COMPACTION)) if (!(sc->reclaim_mode & RECLAIM_MODE_COMPACTION))
Expand Down

0 comments on commit 00b0d92

Please sign in to comment.