aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/vt.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2006-09-29 05:00:03 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-29 12:18:12 -0400
commitca9bda00b4aafc42cd3d1b9d32934463e2993b4c (patch)
treedbb7ba5320bb8d1cbf97b3493687cb87932ad5f4 /drivers/char/vt.c
parentae78bf9c4f5fde3c67e2829505f195d7347ce3e4 (diff)
[PATCH] tty locking on resize
The current kernel serializes console resizes but does not serialize the resize against the tty structure updates. This means that while two parallel resizes cannot mess up the console you can get incorrect results reported. Secondly while doing this I added vc_lock_resize() to lock and resize the console. This leaves all knowledge of the console_sem in the vt/console driver and kicks it out of the tty layer, which is good Thirdly while doing this I decided I couldn't stand "disallocate" any longer so I switched it to "deallocate". Signed-off-by: Alan Cox <alan@redhat.com> Cc: Paul Fulghum <paulkf@microgate.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/vt.c')
-rw-r--r--drivers/char/vt.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 0fca83ededff..b49f03375439 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -885,8 +885,17 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines)
885 return err; 885 return err;
886} 886}
887 887
888int vc_lock_resize(struct vc_data *vc, unsigned int cols, unsigned int lines)
889{
890 int rc;
891
892 acquire_console_sem();
893 rc = vc_resize(vc, cols, lines);
894 release_console_sem();
895 return rc;
896}
888 897
889void vc_disallocate(unsigned int currcons) 898void vc_deallocate(unsigned int currcons)
890{ 899{
891 WARN_CONSOLE_UNLOCKED(); 900 WARN_CONSOLE_UNLOCKED();
892 901
@@ -3790,6 +3799,7 @@ EXPORT_SYMBOL(default_blu);
3790EXPORT_SYMBOL(update_region); 3799EXPORT_SYMBOL(update_region);
3791EXPORT_SYMBOL(redraw_screen); 3800EXPORT_SYMBOL(redraw_screen);
3792EXPORT_SYMBOL(vc_resize); 3801EXPORT_SYMBOL(vc_resize);
3802EXPORT_SYMBOL(vc_lock_resize);
3793EXPORT_SYMBOL(fg_console); 3803EXPORT_SYMBOL(fg_console);
3794EXPORT_SYMBOL(console_blank_hook); 3804EXPORT_SYMBOL(console_blank_hook);
3795EXPORT_SYMBOL(console_blanked); 3805EXPORT_SYMBOL(console_blanked);