TTY: audit, stop accessing tty->icount

This is a private member of n_tty. Stop accessing it. Instead, take is
as an argument.

This is needed to allow clean switch of the private members to a
separate private structure of n_tty.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Jiri Slaby
2012-10-18 22:26:37 +02:00
committed by Greg Kroah-Hartman
parent 3383427a7b
commit 6c633f27cc
3 changed files with 13 additions and 11 deletions

View File

@@ -76,7 +76,7 @@
static inline int tty_put_user(struct tty_struct *tty, unsigned char x,
unsigned char __user *ptr)
{
tty_audit_add_data(tty, &x, 1);
tty_audit_add_data(tty, &x, 1, tty->icanon);
return put_user(x, ptr);
}
@@ -1644,7 +1644,8 @@ static int copy_from_read_buf(struct tty_struct *tty,
n -= retval;
is_eof = n == 1 &&
tty->read_buf[tty->read_tail] == EOF_CHAR(tty);
tty_audit_add_data(tty, &tty->read_buf[tty->read_tail], n);
tty_audit_add_data(tty, &tty->read_buf[tty->read_tail], n,
tty->icanon);
spin_lock_irqsave(&tty->read_lock, flags);
tty->read_tail = (tty->read_tail + n) & (N_TTY_BUF_SIZE-1);
tty->read_cnt -= n;