Skip to content

Commit

Permalink
Remove unneeded code
Browse files Browse the repository at this point in the history
Signed-off-by: David Windsor <[email protected]>
  • Loading branch information
dwindsor committed Jun 27, 2024
1 parent 2cd5858 commit 41c3fa2
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions bpf/process/bpf_process_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -366,19 +366,15 @@ d_path_local(const struct path *path, int *buflen, int *error)

FUNC_INLINE char * path_from_dentry(struct dentry *dentry, char *buf, int *buflen)
{
struct task_struct *task;
struct fs_struct *fs;

task = (struct task_struct *)get_current_task();
probe_read(&fs, sizeof(fs), _(&task->fs));

if (d_unlinked(dentry)) {
int error = prepend(&buf, buflen, " (deleted)", 10);
if (error) // will never happen as prepend will never return a value != 0
return NULL;
}

// Construct struct path element with cur->nsproxy->mnt_ns->root
// Construct struct path element with task->nsproxy->mnt_ns->root
struct task_struct *task;
task = (struct task_struct *)get_current_task();
struct nsproxy *ns;
probe_read(&ns, sizeof(ns), _(&task->nsproxy));
struct mnt_namespace *mnt_ns;
Expand All @@ -393,10 +389,8 @@ FUNC_INLINE char * path_from_dentry(struct dentry *dentry, char *buf, int *bufle
int flags;
buf = d_path_local(&target, buflen, &flags);
if (!buf) {
bpf_printk("pathbuf is NULL");
return NULL;
}
bpf_printk("buf=%s, buflen=%d", buf, buflen);

return buf;
}
Expand Down

0 comments on commit 41c3fa2

Please sign in to comment.