Add branch prediction hints to getsock_cap

This commit is contained in:
Mateusz Guzik 2022-09-10 19:41:34 +00:00
parent 13604a80f7
commit a2ad70923f

View File

@ -96,9 +96,9 @@ getsock_cap(struct thread *td, int fd, cap_rights_t *rightsp,
int error;
error = fget_cap(td, fd, rightsp, &fp, havecapsp);
if (error != 0)
if (__predict_false(error != 0))
return (error);
if (fp->f_type != DTYPE_SOCKET) {
if (__predict_false(fp->f_type != DTYPE_SOCKET)) {
fdrop(fp, td);
if (havecapsp != NULL)
filecaps_free(havecapsp);