tech-kern archive

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

Re: [PATCH] netbsd32 swapctl, round 4



In article <20140202043534.GA8344%homeworld.netbsd.org@localhost>,
Emmanuel Dreyfus  <manu%netbsd.org@localhost> wrote:

>Latest revision of the netbsd32 swapctl patch
>
>+      for (i = 0; i < count; i++) {
>+              sep32[i].se_dev = sep[i].se_dev;
>+              sep32[i].se_flags = sep[i].se_flags;
>+              sep32[i].se_nblks = sep[i].se_nblks;
>+              sep32[i].se_inuse = sep[i].se_inuse;
>+              sep32[i].se_priority = sep[i].se_priority;
>+              memcpy(sep32[i].se_path, sep[i].se_path,
>+                      sizeof(sep32[i].se_path));
>+      }
>+
>+      error = copyout(sep32, SCARG(uap, arg), sizeof(*sep32) * count);

I thought we decided that it is better to have one sep32 on the stack
and do copyout in the loop.

>+out:
>+      kmem_free(sep, sizeof(*sep));
>+      kmem_free(sep32, sizeof(*sep32));

The sizes are wrong.

christos



Home | Main Index | Thread Index | Old Index