@@ -182,21 +182,11 @@ static void user_event_group_destroy(struct user_event_group *group)
182
182
kfree (group );
183
183
}
184
184
185
- static char * user_event_group_system_name (struct user_namespace * user_ns )
185
+ static char * user_event_group_system_name (void )
186
186
{
187
187
char * system_name ;
188
188
int len = sizeof (USER_EVENTS_SYSTEM ) + 1 ;
189
189
190
- if (user_ns != & init_user_ns ) {
191
- /*
192
- * Unexpected at this point:
193
- * We only currently support init_user_ns.
194
- * When we enable more, this will trigger a failure so log.
195
- */
196
- pr_warn ("user_events: Namespace other than init_user_ns!\n" );
197
- return NULL ;
198
- }
199
-
200
190
system_name = kmalloc (len , GFP_KERNEL );
201
191
202
192
if (!system_name )
@@ -207,34 +197,12 @@ static char *user_event_group_system_name(struct user_namespace *user_ns)
207
197
return system_name ;
208
198
}
209
199
210
- static inline struct user_event_group
211
- * user_event_group_from_user_ns (struct user_namespace * user_ns )
212
- {
213
- if (user_ns == & init_user_ns )
214
- return init_group ;
215
-
216
- return NULL ;
217
- }
218
-
219
200
static struct user_event_group * current_user_event_group (void )
220
201
{
221
- struct user_namespace * user_ns = current_user_ns ();
222
- struct user_event_group * group = NULL ;
223
-
224
- while (user_ns ) {
225
- group = user_event_group_from_user_ns (user_ns );
226
-
227
- if (group )
228
- break ;
229
-
230
- user_ns = user_ns -> parent ;
231
- }
232
-
233
- return group ;
202
+ return init_group ;
234
203
}
235
204
236
- static struct user_event_group
237
- * user_event_group_create (struct user_namespace * user_ns )
205
+ static struct user_event_group * user_event_group_create (void )
238
206
{
239
207
struct user_event_group * group ;
240
208
@@ -243,7 +211,7 @@ static struct user_event_group
243
211
if (!group )
244
212
return NULL ;
245
213
246
- group -> system_name = user_event_group_system_name (user_ns );
214
+ group -> system_name = user_event_group_system_name ();
247
215
248
216
if (!group -> system_name )
249
217
goto error ;
@@ -2603,7 +2571,7 @@ static int __init trace_events_user_init(void)
2603
2571
if (!fault_cache )
2604
2572
return - ENOMEM ;
2605
2573
2606
- init_group = user_event_group_create (& init_user_ns );
2574
+ init_group = user_event_group_create ();
2607
2575
2608
2576
if (!init_group ) {
2609
2577
kmem_cache_destroy (fault_cache );
0 commit comments