Re: [PATCH bpf-next v4 2/5] libbpf: Store map pin path and status in struct bpf_map

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 31, 2019 at 10:31 AM Toke Høiland-Jørgensen <toke@xxxxxxxxxx> wrote:
>
> Andrii Nakryiko <andrii.nakryiko@xxxxxxxxx> writes:
>
> > [...]
> >
> >>
> >>         return err;
> >> @@ -4131,17 +4205,24 @@ int bpf_object__unpin_maps(struct bpf_object *obj, const char *path)
> >>                 return -ENOENT;
> >>
> >>         bpf_object__for_each_map(map, obj) {
> >> +               char *pin_path = NULL;
> >>                 char buf[PATH_MAX];
> >
> > you can call buf as pin_path and get rid of extra pointer?
>
> The idea here is to end up with bpf_map__unpin(map, NULL) if path is
> unset. GCC complains if I reassign a static array pointer, so don't
> think I can actually get rid of this?

oh, right, it's nullable pointer, then you do need buf and pin_path,
never mind. I keep forgetting this NULL semantics for pin/unpin :)

>
> -Toke




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux