Commit a2a9537ac0b37a5da6fbe7e1e9cb06c524d2a9c4
1 parent
6933c02e9c
Exists in
master
and in
7 other branches
Get rid of pdflush_operation() in emergency sync and remount
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>
Showing 2 changed files with 22 additions and 3 deletions Side-by-side Diff
fs/super.c
... | ... | @@ -674,7 +674,7 @@ |
674 | 674 | return 0; |
675 | 675 | } |
676 | 676 | |
677 | -static void do_emergency_remount(unsigned long foo) | |
677 | +static void do_emergency_remount(struct work_struct *work) | |
678 | 678 | { |
679 | 679 | struct super_block *sb; |
680 | 680 | |
681 | 681 | |
... | ... | @@ -697,12 +697,19 @@ |
697 | 697 | spin_lock(&sb_lock); |
698 | 698 | } |
699 | 699 | spin_unlock(&sb_lock); |
700 | + kfree(work); | |
700 | 701 | printk("Emergency Remount complete\n"); |
701 | 702 | } |
702 | 703 | |
703 | 704 | void emergency_remount(void) |
704 | 705 | { |
705 | - pdflush_operation(do_emergency_remount, 0); | |
706 | + struct work_struct *work; | |
707 | + | |
708 | + work = kmalloc(sizeof(*work), GFP_ATOMIC); | |
709 | + if (work) { | |
710 | + INIT_WORK(work, do_emergency_remount); | |
711 | + schedule_work(work); | |
712 | + } | |
706 | 713 | } |
707 | 714 | |
708 | 715 | /* |
fs/sync.c
... | ... | @@ -42,9 +42,21 @@ |
42 | 42 | return 0; |
43 | 43 | } |
44 | 44 | |
45 | +static void do_sync_work(struct work_struct *work) | |
46 | +{ | |
47 | + do_sync(0); | |
48 | + kfree(work); | |
49 | +} | |
50 | + | |
45 | 51 | void emergency_sync(void) |
46 | 52 | { |
47 | - pdflush_operation(do_sync, 0); | |
53 | + struct work_struct *work; | |
54 | + | |
55 | + work = kmalloc(sizeof(*work), GFP_ATOMIC); | |
56 | + if (work) { | |
57 | + INIT_WORK(work, do_sync_work); | |
58 | + schedule_work(work); | |
59 | + } | |
48 | 60 | } |
49 | 61 | |
50 | 62 | /* |