Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libbpf-bootstrap
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Luis Gerhorst
libbpf-bootstrap
Commits
fd2876bb
Commit
fd2876bb
authored
3 years ago
by
Luis Gerhorst
Browse files
Options
Downloads
Patches
Plain Diff
du: Reuse name_user buffer for child name
parent
1b5f2252
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/task_find.bpf.c
+4
-2
4 additions, 2 deletions
src/task_find.bpf.c
with
4 additions
and
2 deletions
src/task_find.bpf.c
+
4
−
2
View file @
fd2876bb
...
...
@@ -46,7 +46,8 @@ static long iter_dir(uint32_t d_type, size_t namelen, bool match) {
}
int
parent_dfd
=
dfd
[
depth
];
void
*
name_user
=
u_iterdents64_buf
+
depth
*
PATHLEN
;
/* void *name_user = u_iterdents64_buf + depth * PATHLEN; */
void
*
name_user
=
u_iterdents64_buf
;
if
(
match
)
{
if
(
flags
&
PRINT_MATCHES
)
{
write
(
STDOUT_FILENO
,
name_user
,
namelen
);
...
...
@@ -84,7 +85,8 @@ static long iter_dir(uint32_t d_type, size_t namelen, bool match) {
}
unsigned
long
child_depth
=
depth
+
1
;
void
*
child_name_user
=
u_iterdents64_buf
+
child_depth
*
PATHLEN
;
/* void *child_name_user = u_iterdents64_buf + child_depth * PATHLEN; */
void
*
child_name_user
=
name_user
;
curr_depth
=
child_depth
;
dfd
[
curr_depth
]
=
child_dfd
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment