{
int size;
- lock_kernel();
+ down(&con_buf_sem);
size = vcs_size(file->f_dentry->d_inode);
switch (orig) {
default:
- unlock_kernel();
+ up(&con_buf_sem);
return -EINVAL;
case 2:
offset += size;
break;
}
if (offset < 0 || offset > size) {
- unlock_kernel();
+ up(&con_buf_sem);
return -EINVAL;
}
file->f_pos = offset;
- unlock_kernel();
+ up(&con_buf_sem);
return file->f_pos;
}
-/* We share this temporary buffer with the console write code
- * so that we can easily avoid touching user space while holding the
- * console spinlock.
- */
-extern char con_buf[PAGE_SIZE];
-#define CON_BUF_SIZE PAGE_SIZE
-extern struct semaphore con_buf_sem;
static ssize_t
vcs_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
{
struct inode *inode = file->f_dentry->d_inode;
unsigned int currcons = iminor(inode);
- long pos = *ppos;
+ long pos;
long viewed, attr, read;
int col, maxcol;
unsigned short *org = NULL;
down(&con_buf_sem);
+ pos = *ppos;
+
/* Select the proper current console and verify
* sanity of the situation under the console lock.
*/
{
struct inode *inode = file->f_dentry->d_inode;
unsigned int currcons = iminor(inode);
- long pos = *ppos;
+ long pos;
long viewed, attr, size, written;
char *con_buf0;
int col, maxcol;
down(&con_buf_sem);
+ pos = *ppos;
+
/* Select the proper current console and verify
* sanity of the situation under the console lock.
*/