Go to file
Al Viro 77cf363f76 alloc_fdtable(): change calling conventions.
[ Upstream commit 1d3b4bec3c ]

First of all, tell it how many slots do we want, not which slot
is wanted.  It makes one caller (dup_fd()) more straightforward
and doesn't harm another (expand_fdtable()).

Furthermore, make it return ERR_PTR() on failure rather than
returning NULL.  Simplifies the callers.

Simplify the size calculation, while we are at it - note that we
always have slots_wanted greater than BITS_PER_LONG.  What the
rules boil down to is
	* use the smallest power of two large enough to give us
that many slots
	* on 32bit skip 64 and 128 - the minimal capacity we want
there is 256 slots (i.e. 1Kb fd array).
	* on 64bit don't skip anything, the minimal capacity is
128 - and we'll never be asked for 64 or less.  128 slots means
1Kb fd array, again.
	* on 128bit, if that ever happens, don't skip anything -
we'll never be asked for 128 or less, so the fd array allocation
will be at least 2Kb.

Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-08-28 16:24:39 +02:00
arch s390/hypfs: Enable limited access during lockdown 2025-08-28 16:24:39 +02:00
block
certs
crypto
Documentation
drivers bonding: update LACP activity flag after setting lacp_active 2025-08-28 16:24:38 +02:00
fs alloc_fdtable(): change calling conventions. 2025-08-28 16:24:39 +02:00
include bonding: update LACP activity flag after setting lacp_active 2025-08-28 16:24:38 +02:00
init
io_uring
ipc
kernel
lib
LICENSES
mm
net wifi: mac80211: check basic rates validity in sta_link_apply_parameters 2025-08-28 16:24:39 +02:00
samples
scripts
security
sound ALSA: usb-audio: Use correct sub-type for UAC3 feature unit validation 2025-08-28 16:24:38 +02:00
tools
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.