Commit Graph

12 Commits

Author SHA1 Message Date
Linus Torvalds
bf4afc53b7 Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
This was done entirely with mindless brute force, using

    git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' |
        xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/'

to convert the new alloc_obj() users that had a simple GFP_KERNEL
argument to just drop that argument.

Note that due to the extreme simplicity of the scripting, any slightly
more complex cases spread over multiple lines would not be triggered:
they definitely exist, but this covers the vast bulk of the cases, and
the resulting diff is also then easier to check automatically.

For the same reason the 'flex' versions will be done as a separate
conversion.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2026-02-21 17:09:51 -08:00
Kees Cook
69050f8d6d treewide: Replace kmalloc with kmalloc_obj for non-scalar types
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:

Single allocations:	kmalloc(sizeof(TYPE), ...)
are replaced with:	kmalloc_obj(TYPE, ...)

Array allocations:	kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with:	kmalloc_objs(TYPE, COUNT, ...)

Flex array allocations:	kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with:	kmalloc_flex(*PTR, FAM, COUNT, ...)

(where TYPE may also be *VAR)

The resulting allocations no longer return "void *", instead returning
"TYPE *".

Signed-off-by: Kees Cook <kees@kernel.org>
2026-02-21 01:02:28 -08:00
Anna Schumaker
9c54afc106 NFS: Move sequence slot operations into minorversion operations
At the same time, I move the NFS v4.0 functions into nfs40proc.c to keep
v4.0 features together in their own files.

Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
2026-01-30 11:42:20 -05:00
Anna Schumaker
2118913743 NFS: Pass a struct nfs_client to nfs4_init_sequence()
No functional change in this patch. This just makes the next patch where
I introduce "sequence slot operations" simpler.

Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
2026-01-30 11:42:20 -05:00
Anna Schumaker
c695ac2d60 NFS: Move nfs40_shutdown_client into nfs40client.c
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
2026-01-30 11:42:20 -05:00
Anna Schumaker
c30493d8c5 NFS: Make the various NFS v4.0 operations static again
They don't need to be visible outside of nfs40proc.c anymore now that
the minor version ops have been moved over.

Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
2026-01-30 11:42:20 -05:00
Anna Schumaker
0cba208fb9 NFS: Move the NFS v4.0 minor version ops into nfs40proc.c
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
2026-01-30 11:42:20 -05:00
Anna Schumaker
b6ee9a9ba7 NFS: Split out the nfs40_mig_recovery_ops to nfs40proc.c
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
2026-01-30 11:42:20 -05:00
Anna Schumaker
963707b122 NFS: Split out the nfs40_state_renewal_ops into nfs40proc.c
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
2026-01-30 11:42:20 -05:00
Anna Schumaker
0e854d761e NFS: Split out the nfs40_nograce_recovery_ops into nfs40proc.c
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
2026-01-30 11:42:20 -05:00
Anna Schumaker
c96c05fcfe NFS: Split out the nfs40_reboot_recovery_ops into nfs40client.c
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
2026-01-30 11:42:20 -05:00
Anna Schumaker
e5e45ea615 NFS: Move nfs40_call_sync_ops into nfs40proc.c
This is the first step in extracting NFS v4.0 into its own set of files
that can be disabled through Kconfig.

Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
2026-01-30 11:42:19 -05:00