• Home
  • Raw
  • Download

Lines Matching refs:user

663 	struct devkmsg_user *user = file->private_data;  in devkmsg_write()  local
667 if (!user || len > LOG_LINE_MAX) in devkmsg_write()
676 if (!___ratelimit(&user->rs, current->comm)) in devkmsg_write()
722 struct devkmsg_user *user = file->private_data; in devkmsg_read() local
723 struct printk_record *r = &user->record; in devkmsg_read()
727 if (!user) in devkmsg_read()
730 ret = mutex_lock_interruptible(&user->lock); in devkmsg_read()
734 if (!prb_read_valid(prb, atomic64_read(&user->seq), r)) { in devkmsg_read()
752 atomic64_read(&user->seq), r)); /* LMM(devkmsg_read:A) */ in devkmsg_read()
757 if (r->info->seq != atomic64_read(&user->seq)) { in devkmsg_read()
759 atomic64_set(&user->seq, r->info->seq); in devkmsg_read()
764 len = info_print_ext_header(user->buf, sizeof(user->buf), r->info); in devkmsg_read()
765 len += msg_print_ext_body(user->buf + len, sizeof(user->buf) - len, in devkmsg_read()
769 atomic64_set(&user->seq, r->info->seq + 1); in devkmsg_read()
776 if (copy_to_user(buf, user->buf, len)) { in devkmsg_read()
782 mutex_unlock(&user->lock); in devkmsg_read()
796 struct devkmsg_user *user = file->private_data; in devkmsg_llseek() local
799 if (!user) in devkmsg_llseek()
807 atomic64_set(&user->seq, prb_first_valid_seq(prb)); in devkmsg_llseek()
815 atomic64_set(&user->seq, latched_seq_read_nolock(&clear_seq)); in devkmsg_llseek()
819 atomic64_set(&user->seq, prb_next_seq(prb)); in devkmsg_llseek()
829 struct devkmsg_user *user = file->private_data; in devkmsg_poll() local
833 if (!user) in devkmsg_poll()
838 if (prb_read_valid_info(prb, atomic64_read(&user->seq), &info, NULL)) { in devkmsg_poll()
840 if (info.seq != atomic64_read(&user->seq)) in devkmsg_poll()
851 struct devkmsg_user *user; in devkmsg_open() local
865 user = kvmalloc(sizeof(struct devkmsg_user), GFP_KERNEL); in devkmsg_open()
866 if (!user) in devkmsg_open()
869 ratelimit_default_init(&user->rs); in devkmsg_open()
870 ratelimit_set_flags(&user->rs, RATELIMIT_MSG_ON_RELEASE); in devkmsg_open()
872 mutex_init(&user->lock); in devkmsg_open()
874 prb_rec_init_rd(&user->record, &user->info, in devkmsg_open()
875 &user->text_buf[0], sizeof(user->text_buf)); in devkmsg_open()
877 atomic64_set(&user->seq, prb_first_valid_seq(prb)); in devkmsg_open()
879 file->private_data = user; in devkmsg_open()
885 struct devkmsg_user *user = file->private_data; in devkmsg_release() local
887 if (!user) in devkmsg_release()
890 ratelimit_state_exit(&user->rs); in devkmsg_release()
892 mutex_destroy(&user->lock); in devkmsg_release()
893 kvfree(user); in devkmsg_release()