Skip to content

Commit 29142dc

Browse files
torvaldsrostedt
authored andcommitted
tracefs: remove stale 'update_gid' code
The 'eventfs_update_gid()' function is no longer called, so remove it (and the helper function it uses). Link: https://lore.kernel.org/all/CAHk-=wj+DsZZ=2iTUkJ-Nojs9fjYMvPs1NuoM3yK7aTDtJfPYQ@mail.gmail.com/ Fixes: 8186fff ("tracefs/eventfs: Use root and instance inodes as default ownership") Signed-off-by: Linus Torvalds <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 0958b33 commit 29142dc

File tree

2 files changed

+0
-39
lines changed

2 files changed

+0
-39
lines changed

fs/tracefs/event_inode.c

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -281,44 +281,6 @@ static void update_inode_attr(struct dentry *dentry, struct inode *inode,
281281
inode->i_gid = attr->gid;
282282
}
283283

284-
static void update_gid(struct eventfs_inode *ei, kgid_t gid, int level)
285-
{
286-
struct eventfs_inode *ei_child;
287-
288-
/* at most we have events/system/event */
289-
if (WARN_ON_ONCE(level > 3))
290-
return;
291-
292-
ei->attr.gid = gid;
293-
294-
if (ei->entry_attrs) {
295-
for (int i = 0; i < ei->nr_entries; i++) {
296-
ei->entry_attrs[i].gid = gid;
297-
}
298-
}
299-
300-
/*
301-
* Only eventfs_inode with dentries are updated, make sure
302-
* all eventfs_inodes are updated. If one of the children
303-
* do not have a dentry, this function must traverse it.
304-
*/
305-
list_for_each_entry_srcu(ei_child, &ei->children, list,
306-
srcu_read_lock_held(&eventfs_srcu)) {
307-
if (!ei_child->dentry)
308-
update_gid(ei_child, gid, level + 1);
309-
}
310-
}
311-
312-
void eventfs_update_gid(struct dentry *dentry, kgid_t gid)
313-
{
314-
struct eventfs_inode *ei = dentry->d_fsdata;
315-
int idx;
316-
317-
idx = srcu_read_lock(&eventfs_srcu);
318-
update_gid(ei, gid, 0);
319-
srcu_read_unlock(&eventfs_srcu, idx);
320-
}
321-
322284
/**
323285
* create_file - create a file in the tracefs filesystem
324286
* @name: the name of the file to create.

fs/tracefs/internal.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ struct inode *tracefs_get_inode(struct super_block *sb);
8282
struct dentry *eventfs_start_creating(const char *name, struct dentry *parent);
8383
struct dentry *eventfs_failed_creating(struct dentry *dentry);
8484
struct dentry *eventfs_end_creating(struct dentry *dentry);
85-
void eventfs_update_gid(struct dentry *dentry, kgid_t gid);
8685
void eventfs_set_ei_status_free(struct tracefs_inode *ti, struct dentry *dentry);
8786

8887
#endif /* _TRACEFS_INTERNAL_H */

0 commit comments

Comments
 (0)