On Thu, Jun 23, 2016 at 12:44:04PM -0400, Ted Unangst wrote:
> Instead of using the old flags and tsleep style lock, switch to rwlock in
> sblock. That's what it's for. More legible, and as a bonus, MP safer.

As mentioned by mikeb@ returning EWOULDBLOCK is important.

> +void
> +sbunlock(struct sockbuf *sb)
> +{
> +     rw_exit(&sb->sb_rwl);
> +}
> +
> +

Only one empty line please.

> +             struct  rwlock sb_rwl;  /* lock */

                struct  rwlock sb_lock; /* exclusive access from process */

I think calling the field lock instead of rwl makes clearer what
it is.  And it only controls access from process context, interrupt
locking is done with splsoftnet().  A good place for a comment.

enough bikeshedding, OK bluhm@

Reply via email to