History log of /openbsd/sys/nfs/nfs_subs.c (Results 1 – 25 of 151)
Revision Date Author Comments
# d2b6e45e 09-Sep-2024 jsg <jsg@openbsd.org>

move some server only functions from nfs_subs.c to nfs_srvsubs.c
saves space on ramdisks that have option NFSCLIENT

initial diff from and ok miod@


# 9593dc34 04-Sep-2024 mglocker <mglocker@openbsd.org>

Fix some spelling.

Input and ok jmc@, jsg@


# 564dba15 01-May-2024 jsg <jsg@openbsd.org>

remove unneeded includes
ok miod@ mpi@


# 45db009a 30-Apr-2024 miod <miod@openbsd.org>

Constify NFS data whenever possible. Also make a few more const data static.

ok jsg@ semarie@


# a43f2b81 30-Apr-2024 miod <miod@openbsd.org>

Convert all the NFS macros (in nfsm_subs.h) into inline functions with the
appropriate extra arguments.

This (hopefully) completes the unmessyfication work started by thib@ a long,
long time ago (in

Convert all the NFS macros (in nfsm_subs.h) into inline functions with the
appropriate extra arguments.

This (hopefully) completes the unmessyfication work started by thib@ a long,
long time ago (in a galaxy far away).

The conversion logic has been:
- nfsm_dissect has been turned into an rvalue expression, leaving the
cast operation up to its caller.
- macros which had three different exit paths (return, goto nfsmout or
fallthrough) have been split so that no macros have more than two exit paths.
- then they have been modified to return a value, which lets the caller
figure out what exit path is needed.
- local variables abused by the macros are now local variables of the new
inline functions.

This single commit is the sum of 25 intermediate diffs, which have all been
carefully reviewed by (at least) jsg@ and semarie@.

Tested with v2 and v3 servers and clients.

ok jsg@ semarie@

show more ...


# 78a2c979 12-Jan-2022 mbuhl <mbuhl@openbsd.org>

fixup previous refactoring
OK stsp@ (without assuming any responsibility for NFS)


# 0d297f47 11-Jan-2022 jsg <jsg@openbsd.org>

spelling
ok jmc@


# 3209772d 24-Jun-2020 cheloha <cheloha@openbsd.org>

kernel: use gettime(9)/getuptime(9) in lieu of time_second(9)/time_uptime(9)

time_second(9) and time_uptime(9) are widely used in the kernel to
quickly get the system UTC or system uptime as a time_

kernel: use gettime(9)/getuptime(9) in lieu of time_second(9)/time_uptime(9)

time_second(9) and time_uptime(9) are widely used in the kernel to
quickly get the system UTC or system uptime as a time_t. However,
time_t is 64-bit everywhere, so it is not generally safe to use them
on 32-bit platforms: you have a split-read problem if your hardware
cannot perform atomic 64-bit reads.

This patch replaces time_second(9) with gettime(9), a safer successor
interface, throughout the kernel. Similarly, time_uptime(9) is replaced
with getuptime(9).

There is a performance cost on 32-bit platforms in exchange for
eliminating the split-read problem: instead of two register reads you
now have a lockless read loop to pull the values from the timehands.
This is really not *too* bad in the grand scheme of things, but
compared to what we were doing before it is several times slower.

There is no performance cost on 64-bit (__LP64__) platforms.

With input from visa@, dlg@, and tedu@.

Several bugs squashed by visa@.

ok kettenis@

show more ...


# 2d6b9e38 20-Jan-2020 claudio <claudio@openbsd.org>

struct vops is not modified during runtime so use const which moves each
into read-only data segment.
OK deraadt@ tedu@


# d65b7ceb 14-Jan-2020 bluhm <bluhm@openbsd.org>

In nfs_clearcommit() the loops over mnt_vnodelist and v_dirtyblkhd
do not delete anything. So the safe variant of foreach is not
necessary.
OK mpi@ millert@ tedu@


# a2b5c922 10-Jan-2020 bluhm <bluhm@openbsd.org>

Convert the vnode list at the mount point into a tailq. During
unmount this list is traversed and the dirty vnodes are flushed to
disk. Forced unmount expects that the list is empty after flushing,

Convert the vnode list at the mount point into a tailq. During
unmount this list is traversed and the dirty vnodes are flushed to
disk. Forced unmount expects that the list is empty after flushing,
otherwise the kernel panics with "dangling vnode". As the write
to disk can sleep, new vnodes may be inserted. If softdep is
enabled, resolving the dependencies creates new dirty vnodes and
inserts them to the list. To fix the panic, let insmntque() insert
new vnodes at the tail of the list. Then vflush() will still catch
them while traversing the list in forward direction.
OK tedu@ millert@ visa@

show more ...


# 638b8534 25-Dec-2019 bluhm <bluhm@openbsd.org>

Use FOREACH macro to iterate over mnt_vnodelist.
OK millert@ visa@ benno@


# fc978722 30-Nov-2018 claudio <claudio@openbsd.org>

Switch MH_ALIGN to m_align which is the same.
OK bluhm@


# b5b7f62e 09-Nov-2018 claudio <claudio@openbsd.org>

M_LEADINGSPACE() and M_TRAILINGSPACE() are just wrappers for
m_leadingspace() and m_trailingspace(). Convert all callers to call
directly the functions and remove the defines.
OK krw@, mpi@


# 3ae16189 02-Jul-2018 bluhm <bluhm@openbsd.org>

Use more list macros for v_dirtyblkhd.
OK mpi@


# 36bb23f1 28-Apr-2018 visa <visa@openbsd.org>

Clean up the parameters of VOP_LOCK() and VOP_UNLOCK(). It is always
curproc that does the locking or unlocking, so the proc parameter
is pointless and can be dropped.

OK mpi@, deraadt@


# f46da438 29-Aug-2017 deraadt <deraadt@openbsd.org>

Remove old deactivated pledge path code. A replacement mechanism is
being brewed.
ok beck


# fe1f2e8d 22-Feb-2017 mpi <mpi@openbsd.org>

Keep local definitions local.

"good work" deraadt@, ok visa@


# 1378bae2 15-Sep-2016 dlg <dlg@openbsd.org>

all pools have their ipl set via pool_setipl, so fold it into pool_init.

the ioff argument to pool_init() is unused and has been for many
years, so this replaces it with an ipl argument. because the

all pools have their ipl set via pool_setipl, so fold it into pool_init.

the ioff argument to pool_init() is unused and has been for many
years, so this replaces it with an ipl argument. because the ipl
will be set on init we no longer need pool_setipl.

most of these changes have been done with coccinelle using the spatch
below. cocci sucks at formatting code though, so i fixed that by hand.

the manpage and subr_pool.c bits i did myself.

ok tedu@ jmatthew@

@ipl@
expression pp;
expression ipl;
expression s, a, o, f, m, p;
@@
-pool_init(pp, s, a, o, f, m, p);
-pool_setipl(pp, ipl);
+pool_init(pp, s, a, ipl, f, m, p);

show more ...


# e297897f 30-Aug-2016 dlg <dlg@openbsd.org>

pool_setipl for nfs pools

ok natano@


# 9b247b22 29-Apr-2016 beck <beck@openbsd.org>

Fix some gibbering horrors due to uninitialized struct nameidata's

1) turn NDINITAT into a function and make the macros point to it
with the later goal of getting rid of them.

2) Sweep the kernel f

Fix some gibbering horrors due to uninitialized struct nameidata's

1) turn NDINITAT into a function and make the macros point to it
with the later goal of getting rid of them.

2) Sweep the kernel for places where people make a struct nameidata manually
on the stack and fill in what they hope are the required fields and count
on prayer and clean living to always get them right. Instead use NDINIT
everywhere. NFS was especially bad for this and there have likely
been things lurking there for a while.

3) Add a couple of strategic KASSERT's to catch future offenders.

ok krw@ sthen@ deraadt@

show more ...


# 937fcae7 19-Mar-2016 natano <natano@openbsd.org>

Remove the unused flags argument from VOP_UNLOCK().

torture tested on amd64, i386 and macppc
ok beck mpi stefan
"the change looks right" deraadt


# dafa748f 13-Feb-2016 stefan <stefan@openbsd.org>

Convert to uiomove. From Martin Natano.


# fb492c37 16-Jun-2015 mpi <mpi@openbsd.org>

Store a unique ID, an interface index, rather than a pointer to the
receiving interface in the packet header of every mbuf.

The interface pointer should now be retrieved when necessary with
if_get()

Store a unique ID, an interface index, rather than a pointer to the
receiving interface in the packet header of every mbuf.

The interface pointer should now be retrieved when necessary with
if_get(). If a NULL pointer is returned by if_get(), the interface
has probably been destroy/removed and the mbuf should be freed.

Such mechanism will simplify garbage collection of mbufs and limit
problems with dangling ifp pointers.

Tested by jmatthew@ and krw@, discussed with many.

ok mikeb@, bluhm@, dlg@

show more ...


# 4707cbe3 17-Apr-2015 guenther <guenther@openbsd.org>

Tweaks utimensat/futimens handling to always update ctime, even when both
atime and mtime are UTIME_OMIT (at least for ufs, tmpfs, and ext2fs), and
to correctly handle a timestamp of -1.

ok millert@


1234567