aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/vt.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-08-14 01:41:02 -0400
committerTejun Heo <tj@kernel.org>2009-08-14 01:45:31 -0400
commit384be2b18a5f9475eab9ca2bdfa95cc1a04ef59c (patch)
tree04c93f391a1b65c8bf8d7ba8643c07d26c26590a /drivers/char/vt.c
parenta76761b621bcd8336065c4fe3a74f046858bc34c (diff)
parent142d44b0dd6741a64a7bdbe029110e7c1dcf1d23 (diff)
Merge branch 'percpu-for-linus' into percpu-for-next
Conflicts: arch/sparc/kernel/smp_64.c arch/x86/kernel/cpu/perf_counter.c arch/x86/kernel/setup_percpu.c drivers/cpufreq/cpufreq_ondemand.c mm/percpu.c Conflicts in core and arch percpu codes are mostly from commit ed78e1e078dd44249f88b1dd8c76dafb39567161 which substituted many num_possible_cpus() with nr_cpu_ids. As for-next branch has moved all the first chunk allocators into mm/percpu.c, the changes are moved from arch code to mm/percpu.c. Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/char/vt.c')
-rw-r--r--drivers/char/vt.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index d9113b4c76e3..404f4c1ee431 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -89,6 +89,7 @@
89#include <linux/mutex.h> 89#include <linux/mutex.h>
90#include <linux/vt_kern.h> 90#include <linux/vt_kern.h>
91#include <linux/selection.h> 91#include <linux/selection.h>
92#include <linux/smp_lock.h>
92#include <linux/tiocl.h> 93#include <linux/tiocl.h>
93#include <linux/kbd_kern.h> 94#include <linux/kbd_kern.h>
94#include <linux/consolemap.h> 95#include <linux/consolemap.h>
@@ -769,14 +770,12 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */
769 visual_init(vc, currcons, 1); 770 visual_init(vc, currcons, 1);
770 if (!*vc->vc_uni_pagedir_loc) 771 if (!*vc->vc_uni_pagedir_loc)
771 con_set_default_unimap(vc); 772 con_set_default_unimap(vc);
772 if (!vc->vc_kmalloced) 773 vc->vc_screenbuf = kmalloc(vc->vc_screenbuf_size, GFP_KERNEL);
773 vc->vc_screenbuf = kmalloc(vc->vc_screenbuf_size, GFP_KERNEL);
774 if (!vc->vc_screenbuf) { 774 if (!vc->vc_screenbuf) {
775 kfree(vc); 775 kfree(vc);
776 vc_cons[currcons].d = NULL; 776 vc_cons[currcons].d = NULL;
777 return -ENOMEM; 777 return -ENOMEM;
778 } 778 }
779 vc->vc_kmalloced = 1;
780 vc_init(vc, vc->vc_rows, vc->vc_cols, 1); 779 vc_init(vc, vc->vc_rows, vc->vc_cols, 1);
781 vcs_make_sysfs(currcons); 780 vcs_make_sysfs(currcons);
782 atomic_notifier_call_chain(&vt_notifier_list, VT_ALLOCATE, &param); 781 atomic_notifier_call_chain(&vt_notifier_list, VT_ALLOCATE, &param);
@@ -912,10 +911,8 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc,
912 if (new_scr_end > new_origin) 911 if (new_scr_end > new_origin)
913 scr_memsetw((void *)new_origin, vc->vc_video_erase_char, 912 scr_memsetw((void *)new_origin, vc->vc_video_erase_char,
914 new_scr_end - new_origin); 913 new_scr_end - new_origin);
915 if (vc->vc_kmalloced) 914 kfree(vc->vc_screenbuf);
916 kfree(vc->vc_screenbuf);
917 vc->vc_screenbuf = newscreen; 915 vc->vc_screenbuf = newscreen;
918 vc->vc_kmalloced = 1;
919 vc->vc_screenbuf_size = new_screen_size; 916 vc->vc_screenbuf_size = new_screen_size;
920 set_origin(vc); 917 set_origin(vc);
921 918
@@ -994,8 +991,7 @@ void vc_deallocate(unsigned int currcons)
994 vc->vc_sw->con_deinit(vc); 991 vc->vc_sw->con_deinit(vc);
995 put_pid(vc->vt_pid); 992 put_pid(vc->vt_pid);
996 module_put(vc->vc_sw->owner); 993 module_put(vc->vc_sw->owner);
997 if (vc->vc_kmalloced) 994 kfree(vc->vc_screenbuf);
998 kfree(vc->vc_screenbuf);
999 if (currcons >= MIN_NR_CONSOLES) 995 if (currcons >= MIN_NR_CONSOLES)
1000 kfree(vc); 996 kfree(vc);
1001 vc_cons[currcons].d = NULL; 997 vc_cons[currcons].d = NULL;
@@ -2880,7 +2876,6 @@ static int __init con_init(void)
2880 INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK); 2876 INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK);
2881 visual_init(vc, currcons, 1); 2877 visual_init(vc, currcons, 1);
2882 vc->vc_screenbuf = kzalloc(vc->vc_screenbuf_size, GFP_NOWAIT); 2878 vc->vc_screenbuf = kzalloc(vc->vc_screenbuf_size, GFP_NOWAIT);
2883 vc->vc_kmalloced = 0;
2884 vc_init(vc, vc->vc_rows, vc->vc_cols, 2879 vc_init(vc, vc->vc_rows, vc->vc_cols,
2885 currcons || !vc->vc_sw->con_save_screen); 2880 currcons || !vc->vc_sw->con_save_screen);
2886 } 2881 }