fd: stop passing M_ZERO to uma_zalloc

The optimisation seen with malloc cannot be used here as zone sizes are
now known at compilation. Thus bzero by hand to get the optimisation
instead.
This commit is contained in:
Mateusz Guzik 2018-07-12 22:48:18 +00:00
parent efb6d4a479
commit bcbc8d35eb

View File

@ -1865,7 +1865,8 @@ falloc_noinstall(struct thread *td, struct file **resultfp)
}
return (ENFILE);
}
fp = uma_zalloc(file_zone, M_WAITOK | M_ZERO);
fp = uma_zalloc(file_zone, M_WAITOK);
bzero(fp, sizeof(*fp));
refcount_init(&fp->f_count, 1);
fp->f_cred = crhold(td->td_ucred);
fp->f_ops = &badfileops;