[Midnightbsd-cvs] [MidnightBSD/src] 4372c4: libc/libc/rpc: refactor some global variables

Alan Somers noreply at github.com
Sat Dec 9 14:03:27 EST 2023


  Branch: refs/heads/master
  Home:   https://github.com/MidnightBSD/src
  Commit: 4372c4c0f1381e2306c14c4dff39eb824e462559
      https://github.com/MidnightBSD/src/commit/4372c4c0f1381e2306c14c4dff39eb824e462559
  Author: Alan Somers <asomers at FreeBSD.org>
  Date:   2023-12-09 (Sat, 09 Dec 2023)

  Changed paths:
    M include/rpc/rpc_com.h
    M lib/libc/rpc/clnt_dg.c
    M lib/libc/rpc/clnt_vc.c
    M lib/libc/rpc/rpc_com.h
    M lib/libc/rpc/rpc_generic.c
    M sys/rpc/rpc_com.h

  Log Message:
  -----------
  libc/libc/rpc: refactor some global variables

* Combine dg_fd_locks and dg_cv into one array.
* Similarly for vc_fd_locks and vc_cv
* Turn some macros into inline functions

This is a mostly cosmetic change to make refactoring these strutures in
a future commit easier.

Sponsored by:	Axcient
Reviewed by:	kib
Differential Revision: https://reviews.freebsd.org/D42597

(cherry picked from commit a5c2f4e939430f0048136c39fb9fa6093d401905)

lib/libc/rpc: switch the per-fd structs in clnt_{dg,vc}.c to RB Trees

This saves oodles of memory, especially when "ulimit -n" is large.  It
also prevents a buffer overflow if getrlimit should fail.

Also replace per-fd condvars with mutexes to simplify the code.

PR:		274968
Sponsored by:	Axcient
Reviewed by:	kib
Differential Revision: https://reviews.freebsd.org/D42597

(cherry picked from commit 24938f9311c9c9acc1ce747f4e6a088c2dbc967d)




More information about the Midnightbsd-cvs mailing list