Lines Matching defs:tinfo
6007 * @tinfo: The descriptor to free up
6011 void trace_user_fault_destroy(struct trace_user_buf_info *tinfo)
6016 if (!tinfo || !tinfo->tbuf)
6020 buf = per_cpu_ptr(tinfo->tbuf, cpu)->buf;
6023 free_percpu(tinfo->tbuf);
6026 static int user_fault_buffer_enable(struct trace_user_buf_info *tinfo, size_t size)
6033 tinfo->tbuf = alloc_percpu(struct trace_user_buf);
6034 if (!tinfo->tbuf)
6037 tinfo->ref = 1;
6038 tinfo->size = size;
6042 per_cpu_ptr(tinfo->tbuf, cpu)->buf = NULL;
6050 per_cpu_ptr(tinfo->tbuf, cpu)->buf = buf;
6057 static void user_buffer_free(struct trace_user_buf_info **tinfo)
6061 trace_user_fault_destroy(*tinfo);
6062 kfree(*tinfo);
6063 *tinfo = NULL;
6067 static int user_buffer_init(struct trace_user_buf_info **tinfo, size_t size)
6074 if (!*tinfo) {
6076 *tinfo = kzalloc_obj(**tinfo);
6077 if (!*tinfo)
6081 ret = user_fault_buffer_enable(*tinfo, size);
6083 user_buffer_free(tinfo);
6089 static void user_buffer_put(struct trace_user_buf_info **tinfo)
6093 if (WARN_ON_ONCE(!*tinfo || !(*tinfo)->ref))
6096 if (--(*tinfo)->ref)
6099 user_buffer_free(tinfo);
6104 * @tinfo: A pointer to the trace buffer descriptor
6116 int trace_user_fault_init(struct trace_user_buf_info *tinfo, size_t size)
6120 if (!tinfo)
6125 ret = user_buffer_init(&tinfo, size);
6127 trace_user_fault_destroy(tinfo);
6134 * @tinfo: A pointer to a pointer to the trace buffer descriptor
6140 int trace_user_fault_get(struct trace_user_buf_info *tinfo)
6142 if (!tinfo)
6147 tinfo->ref++;
6148 return tinfo->ref;
6153 * @tinfo: The @tinfo that was passed to trace_user_fault_get()
6155 * Decrement the ref count of @tinfo.
6159 int trace_user_fault_put(struct trace_user_buf_info *tinfo)
6163 if (WARN_ON_ONCE(!tinfo || !tinfo->ref))
6166 --tinfo->ref;
6167 return tinfo->ref;
6172 * @tinfo: The @tinfo allocated by trace_user_fault_get()
6188 * buffer: the per CPU buffer of the @tinfo.
6202 char *trace_user_fault_read(struct trace_user_buf_info *tinfo,
6207 char *buffer = per_cpu_ptr(tinfo->tbuf, cpu)->buf;
6218 if (size > tinfo->size)
6246 buffer = per_cpu_ptr(tinfo->tbuf, cpu)->buf;