Lines Matching refs:tinfo

7318  * @tinfo: The descriptor to free up
7322 void trace_user_fault_destroy(struct trace_user_buf_info *tinfo)
7327 if (!tinfo || !tinfo->tbuf)
7331 buf = per_cpu_ptr(tinfo->tbuf, cpu)->buf;
7334 free_percpu(tinfo->tbuf);
7337 static int user_fault_buffer_enable(struct trace_user_buf_info *tinfo, size_t size)
7344 tinfo->tbuf = alloc_percpu(struct trace_user_buf);
7345 if (!tinfo->tbuf)
7348 tinfo->ref = 1;
7349 tinfo->size = size;
7353 per_cpu_ptr(tinfo->tbuf, cpu)->buf = NULL;
7361 per_cpu_ptr(tinfo->tbuf, cpu)->buf = buf;
7368 static void user_buffer_free(struct trace_user_buf_info **tinfo)
7372 trace_user_fault_destroy(*tinfo);
7373 kfree(*tinfo);
7374 *tinfo = NULL;
7378 static int user_buffer_init(struct trace_user_buf_info **tinfo, size_t size)
7385 if (!*tinfo) {
7387 *tinfo = kzalloc(sizeof(**tinfo), GFP_KERNEL);
7388 if (!*tinfo)
7392 ret = user_fault_buffer_enable(*tinfo, size);
7394 user_buffer_free(tinfo);
7400 static void user_buffer_put(struct trace_user_buf_info **tinfo)
7404 if (WARN_ON_ONCE(!*tinfo || !(*tinfo)->ref))
7407 if (--(*tinfo)->ref)
7410 user_buffer_free(tinfo);
7415 * @tinfo: A pointer to the trace buffer descriptor
7427 int trace_user_fault_init(struct trace_user_buf_info *tinfo, size_t size)
7431 if (!tinfo)
7436 ret = user_buffer_init(&tinfo, size);
7438 trace_user_fault_destroy(tinfo);
7445 * @tinfo: A pointer to a pointer to the trace buffer descriptor
7451 int trace_user_fault_get(struct trace_user_buf_info *tinfo)
7453 if (!tinfo)
7458 tinfo->ref++;
7459 return tinfo->ref;
7464 * @tinfo: The @tinfo that was passed to trace_user_fault_get()
7466 * Decrement the ref count of @tinfo.
7470 int trace_user_fault_put(struct trace_user_buf_info *tinfo)
7474 if (WARN_ON_ONCE(!tinfo || !tinfo->ref))
7477 --tinfo->ref;
7478 return tinfo->ref;
7483 * @tinfo: The @tinfo allocated by trace_user_fault_get()
7499 * buffer: the per CPU buffer of the @tinfo.
7513 char *trace_user_fault_read(struct trace_user_buf_info *tinfo,
7518 char *buffer = per_cpu_ptr(tinfo->tbuf, cpu)->buf;
7529 if (size > tinfo->size)