68
68
EVENTFS_SAVE_MODE = BIT (16 ),
69
69
EVENTFS_SAVE_UID = BIT (17 ),
70
70
EVENTFS_SAVE_GID = BIT (18 ),
71
- EVENTFS_TOPLEVEL = BIT (19 ),
72
71
};
73
72
74
73
#define EVENTFS_MODE_MASK (EVENTFS_SAVE_MODE - 1)
@@ -239,14 +238,10 @@ static int eventfs_set_attr(struct mnt_idmap *idmap, struct dentry *dentry,
239
238
return ret ;
240
239
}
241
240
242
- static void update_top_events_attr (struct eventfs_inode * ei , struct super_block * sb )
241
+ static void update_events_attr (struct eventfs_inode * ei , struct super_block * sb )
243
242
{
244
243
struct inode * root ;
245
244
246
- /* Only update if the "events" was on the top level */
247
- if (!ei || !(ei -> attr .mode & EVENTFS_TOPLEVEL ))
248
- return ;
249
-
250
245
/* Get the tracefs root inode. */
251
246
root = d_inode (sb -> s_root );
252
247
ei -> attr .uid = root -> i_uid ;
@@ -259,10 +254,10 @@ static void set_top_events_ownership(struct inode *inode)
259
254
struct eventfs_inode * ei = ti -> private ;
260
255
261
256
/* The top events directory doesn't get automatically updated */
262
- if (!ei || !ei -> is_events || !( ei -> attr . mode & EVENTFS_TOPLEVEL ) )
257
+ if (!ei || !ei -> is_events )
263
258
return ;
264
259
265
- update_top_events_attr (ei , inode -> i_sb );
260
+ update_events_attr (ei , inode -> i_sb );
266
261
267
262
if (!(ei -> attr .mode & EVENTFS_SAVE_UID ))
268
263
inode -> i_uid = ei -> attr .uid ;
@@ -291,7 +286,7 @@ static int eventfs_permission(struct mnt_idmap *idmap,
291
286
return generic_permission (idmap , inode , mask );
292
287
}
293
288
294
- static const struct inode_operations eventfs_root_dir_inode_operations = {
289
+ static const struct inode_operations eventfs_dir_inode_operations = {
295
290
.lookup = eventfs_root_lookup ,
296
291
.setattr = eventfs_set_attr ,
297
292
.getattr = eventfs_get_attr ,
@@ -359,7 +354,7 @@ static struct eventfs_inode *eventfs_find_events(struct dentry *dentry)
359
354
// Walk upwards until you find the events inode
360
355
} while (!ei -> is_events );
361
356
362
- update_top_events_attr (ei , dentry -> d_sb );
357
+ update_events_attr (ei , dentry -> d_sb );
363
358
364
359
return ei ;
365
360
}
@@ -465,7 +460,7 @@ static struct dentry *lookup_dir_entry(struct dentry *dentry,
465
460
update_inode_attr (dentry , inode , & ei -> attr ,
466
461
S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO );
467
462
468
- inode -> i_op = & eventfs_root_dir_inode_operations ;
463
+ inode -> i_op = & eventfs_dir_inode_operations ;
469
464
inode -> i_fop = & eventfs_file_operations ;
470
465
471
466
/* All directories will have the same inode number */
@@ -845,14 +840,6 @@ struct eventfs_inode *eventfs_create_events_dir(const char *name, struct dentry
845
840
uid = d_inode (dentry -> d_parent )-> i_uid ;
846
841
gid = d_inode (dentry -> d_parent )-> i_gid ;
847
842
848
- /*
849
- * If the events directory is of the top instance, then parent
850
- * is NULL. Set the attr.mode to reflect this and its permissions will
851
- * default to the tracefs root dentry.
852
- */
853
- if (!parent )
854
- ei -> attr .mode = EVENTFS_TOPLEVEL ;
855
-
856
843
/* This is used as the default ownership of the files and directories */
857
844
ei -> attr .uid = uid ;
858
845
ei -> attr .gid = gid ;
@@ -861,13 +848,13 @@ struct eventfs_inode *eventfs_create_events_dir(const char *name, struct dentry
861
848
INIT_LIST_HEAD (& ei -> list );
862
849
863
850
ti = get_tracefs (inode );
864
- ti -> flags |= TRACEFS_EVENT_INODE | TRACEFS_EVENT_TOP_INODE ;
851
+ ti -> flags |= TRACEFS_EVENT_INODE ;
865
852
ti -> private = ei ;
866
853
867
854
inode -> i_mode = S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO ;
868
855
inode -> i_uid = uid ;
869
856
inode -> i_gid = gid ;
870
- inode -> i_op = & eventfs_root_dir_inode_operations ;
857
+ inode -> i_op = & eventfs_dir_inode_operations ;
871
858
inode -> i_fop = & eventfs_file_operations ;
872
859
873
860
dentry -> d_fsdata = get_ei (ei );
0 commit comments