Skip to content

Commit

Permalink
Get rid of pdflush_operation() in emergency sync and remount
Browse files Browse the repository at this point in the history
Opencode a cheasy approach with kevent. The idea here is that we'll
add some generic delayed work infrastructure, which probably wont be
based on pdflush (or maybe it will, in which case we can just add it
back).

This is in preparation for getting rid of pdflush completely.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
Jens Axboe committed Mar 26, 2009
1 parent 6933c02 commit a2a9537
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
11 changes: 9 additions & 2 deletions fs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ int do_remount_sb(struct super_block *sb, int flags, void *data, int force)
return 0;
}

static void do_emergency_remount(unsigned long foo)
static void do_emergency_remount(struct work_struct *work)
{
struct super_block *sb;

Expand All @@ -697,12 +697,19 @@ static void do_emergency_remount(unsigned long foo)
spin_lock(&sb_lock);
}
spin_unlock(&sb_lock);
kfree(work);
printk("Emergency Remount complete\n");
}

void emergency_remount(void)
{
pdflush_operation(do_emergency_remount, 0);
struct work_struct *work;

work = kmalloc(sizeof(*work), GFP_ATOMIC);
if (work) {
INIT_WORK(work, do_emergency_remount);
schedule_work(work);
}
}

/*
Expand Down
14 changes: 13 additions & 1 deletion fs/sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,21 @@ SYSCALL_DEFINE0(sync)
return 0;
}

static void do_sync_work(struct work_struct *work)
{
do_sync(0);
kfree(work);
}

void emergency_sync(void)
{
pdflush_operation(do_sync, 0);
struct work_struct *work;

work = kmalloc(sizeof(*work), GFP_ATOMIC);
if (work) {
INIT_WORK(work, do_sync_work);
schedule_work(work);
}
}

/*
Expand Down

0 comments on commit a2a9537

Please sign in to comment.