Skip to content

Commit 37cd0d1

Browse files
committed
eventfs: Remove getattr and permission callbacks
Now that inodes have their permissions updated on remount, the only other places to update the inode permissions are when they are created and in the setattr callback. The getattr and permission callbacks are not needed as the inodes should already be set at their proper settings. Remove the callbacks, as it not only simplifies the code, but also allows more flexibility to fix the inconsistencies with various corner cases (like changing the permission of an instance directory). Link: https://lore.kernel.org/lkml/[email protected] Cc: Linus Torvalds <[email protected]> Cc: Masami Hiramatsu <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: Andrew Morton <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 625acf9 commit 37cd0d1

File tree

1 file changed

+0
-40
lines changed

1 file changed

+0
-40
lines changed

fs/tracefs/event_inode.c

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -250,49 +250,9 @@ static void update_events_attr(struct eventfs_inode *ei, struct super_block *sb)
250250
ei->attr.gid = parent->i_gid;
251251
}
252252

253-
static void set_top_events_ownership(struct inode *inode)
254-
{
255-
struct tracefs_inode *ti = get_tracefs(inode);
256-
struct eventfs_inode *ei = ti->private;
257-
258-
/* The top events directory doesn't get automatically updated */
259-
if (!ei || !ei->is_events)
260-
return;
261-
262-
update_events_attr(ei, inode->i_sb);
263-
264-
if (!(ei->attr.mode & EVENTFS_SAVE_UID))
265-
inode->i_uid = ei->attr.uid;
266-
267-
if (!(ei->attr.mode & EVENTFS_SAVE_GID))
268-
inode->i_gid = ei->attr.gid;
269-
}
270-
271-
static int eventfs_get_attr(struct mnt_idmap *idmap,
272-
const struct path *path, struct kstat *stat,
273-
u32 request_mask, unsigned int flags)
274-
{
275-
struct dentry *dentry = path->dentry;
276-
struct inode *inode = d_backing_inode(dentry);
277-
278-
set_top_events_ownership(inode);
279-
280-
generic_fillattr(idmap, request_mask, inode, stat);
281-
return 0;
282-
}
283-
284-
static int eventfs_permission(struct mnt_idmap *idmap,
285-
struct inode *inode, int mask)
286-
{
287-
set_top_events_ownership(inode);
288-
return generic_permission(idmap, inode, mask);
289-
}
290-
291253
static const struct inode_operations eventfs_dir_inode_operations = {
292254
.lookup = eventfs_root_lookup,
293255
.setattr = eventfs_set_attr,
294-
.getattr = eventfs_get_attr,
295-
.permission = eventfs_permission,
296256
};
297257

298258
static const struct inode_operations eventfs_file_inode_operations = {

0 commit comments

Comments
 (0)