Home | History | Annotate | Download | only in putter
History log of /src/sys/dev/putter/putter.c
RevisionDateAuthorComments
 1.39  26-Sep-2021  thorpej Change the kqueue filterops::f_isfd field to filterops::f_flags, and
define a flag FILTEROP_ISFD that has the meaning of the prior f_isfd.
Field and flag name aligned with OpenBSD.

This does not constitute a functional or ABI change, as the field location
and size, and the value placed in that field, are the same as the previous
code, but we're bumping __NetBSD_Version__ so 3rd-party module source code
can adapt, as needed.

NetBSD 9.99.89
 1.38  18-Dec-2020  thorpej Use sel{record,remove}_knote().
 1.37  30-Nov-2017  christos branches: 1.37.18;
add fo_name so we can identify the fileops in a simple way.
 1.36  25-Oct-2017  maya Use C99 initializer for filterops

Mostly done with spatch with touchups for indentation

@@
expression a;
identifier b,c,d;
identifier p;
@@
const struct filterops p =
- { a, b, c, d
+ {
+ .f_isfd = a,
+ .f_attach = b,
+ .f_detach = c,
+ .f_event = d,
};
 1.35  25-Jul-2014  dholland branches: 1.35.8; 1.35.18;
Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.
 1.34  16-Mar-2014  dholland branches: 1.34.2;
Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
 1.33  26-Jul-2012  yamt branches: 1.33.2; 1.33.4;
fix request leak.
 1.32  23-Jul-2011  hannken branches: 1.32.2;
putter_fop_stat(): set st_mode to S_IFCHR.

Fixes PR #44807: something broken in stat(2).
 1.31  06-Feb-2011  haad Revert my fix.
 1.30  06-Feb-2011  haad Putter depends on puffs add missing dependience.
 1.29  27-Aug-2010  pooka branches: 1.29.2; 1.29.4;
waiters gonna wait, so call seldestroy to wake them up when we go south
 1.28  11-Apr-2010  pooka Call putterattach in modcmd init. Fixes lockdebug panic. Disable
unload, since putterdetach() is not implemented (i.e. current
implementation of modcmd fini is flawed), and I don't plan to fix
that now.
 1.27  28-Jan-2010  pooka branches: 1.27.2; 1.27.4;
Adjust some comments which were written when this was still a part of puffs.
 1.26  20-Dec-2009  dsl If a multithreaded app closes an fd while another thread is blocked in
read/write/accept, then the expectation is that the blocked thread will
exit and the close complete.
Since only one fd is affected, but many fd can refer to the same file,
the close code can only request the fs code unblock with ERESTART.
Fixed for pipes and sockets, ERESTART will only be generated after such
a close - so there should be no change for other programs.
Also rename fo_abort() to fo_restart() (this used to be fo_drain()).
Fixes PR/26567
 1.25  09-Dec-2009  dsl Rename fo_drain() to fo_abort(), 'drain' is used to mean 'wait for output
do drain' in many places, whereas fo_drain() was called in order to force
blocking read()/write() etc calls to return to userspace so that a close()
call from a different thread can complete.
In the sockets code comment out the broken code in the inner function,
it was being called from compat code.
 1.24  07-Dec-2009  pooka Mark putter as MODULE_CLASS_DRIVER to make it autoloadable. This
fixes autoloading of puffs upon mount.
 1.23  11-Apr-2009  christos Fix locking as Andy explained. Also fill in uid and gid like sys_pipe did.
 1.22  11-Apr-2009  christos Fix PR/37878 and PR/37550: Provide stat(2) for all devices and don't use
fbadop_stat.
 1.21  04-Apr-2009  ad Add fileops::fo_drain(), to be called from fd_close() when there is more
than one active reference to a file descriptor. It should dislodge threads
sleeping while holding a reference to the descriptor. Implemented only for
sockets but should be extended to pipes, fifos, etc.

Fixes the case of a multithreaded process doing something like the
following, which would have hung until the process got a signal.

thr0 accept(fd, ...)
thr1 close(fd)
 1.20  18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.19  20-Jan-2009  drochner branches: 1.19.2;
Change major()/minor() to return 32-bit types again, called
devmajor_t/devminor_t, as proposed on tech-kern.
This avoids 64-bit arithmetics and 64-bit printf formats in parts
of the kernel where it is not really useful, and helps clarity.
 1.18  29-Dec-2008  pooka Actually, revert previous - I doubt it would work with a non-rump kernel.
The filthy #ifdef _MODULE lives to stink another day.
 1.17  29-Dec-2008  pooka die filthy #ifdef _MODULE, die!
 1.16  08-Aug-2008  pooka branches: 1.16.2; 1.16.4;
KASSERT works better with == instead of =
 1.15  21-Jul-2008  pooka Repeat after me: do not pollute sys with #ifdef _RUMPKERNEL
 1.14  30-May-2008  jmcneill branches: 1.14.2; 1.14.4;
Don't call devsw_attach/detach if _MODULE is not defined.
 1.13  21-May-2008  ad Acquire kernel_lock in putter's fileops.
 1.12  19-May-2008  jmcneill Don't build as module if _RUMPKERNEL is defined.
 1.11  19-May-2008  ad Return result of devsw_detach().
 1.10  19-May-2008  jmcneill Support building putter as a module.
 1.9  21-Mar-2008  ad branches: 1.9.2; 1.9.4; 1.9.6;
Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
 1.8  01-Mar-2008  rmind Welcome to 4.99.55:

- Add a lot of missing selinit() and seldestroy() calls.

- Merge selwakeup() and selnotify() calls into a single selnotify().

- Add an additional 'events' argument to selnotify() call. It will
indicate which event (POLL_IN, POLL_OUT, etc) happen. If unknown,
zero may be used.

Note: please pass appropriate value of 'events' where possible.
Proposed on: <tech-kern>
 1.7  02-Jan-2008  pooka branches: 1.7.2; 1.7.4; 1.7.8;
unstaticate putterdebug
 1.6  03-Dec-2007  pooka branches: 1.6.6;
Allow EVFILT_WRITE kqfilters to be registered and map them to
seltrue_filtops.
 1.5  20-Nov-2007  pooka Allow to register configuration routines to putter. Once a
configuration routine has been attached to the putter device minor
number, the configuration routine will be called when the device
is opened. This is required for subsystems which enter the kernel
only through the file descriptor and cannot configure themselves
via another route (like puffs does via the mount() syscall). Keep
the minor number 0 for "wildcard" uses where we do not require a
hardwired config routine (e.g. the puffs case).
 1.4  13-Nov-2007  pooka branches: 1.4.2; 1.4.4; 1.4.6;
Don't specialcase minor device, treat all minors the same.
 1.3  12-Nov-2007  pooka Bounds-check responses from userspace.
 1.2  12-Nov-2007  pooka * split the putter header into a kernel version and a userland version
+ install latter to /usr/include/dev/putter
* remove last dependencies to puffs from putter, it's completely
independent now
 1.1  12-Nov-2007  pooka Move putter code from directly under dev/ to dev/putter/

no functional change
 1.4.6.4  18-Feb-2008  mjf Sync with HEAD.
 1.4.6.3  08-Dec-2007  mjf Sync with HEAD.
 1.4.6.2  19-Nov-2007  mjf Try to fix sync botch.
 1.4.6.1  13-Nov-2007  mjf file putter.c was added on branch mjf-devfs on 2007-11-19 19:58:40 +0000
 1.4.4.6  24-Mar-2008  yamt sync with head.
 1.4.4.5  17-Mar-2008  yamt sync with head.
 1.4.4.4  21-Jan-2008  yamt sync with head
 1.4.4.3  07-Dec-2007  yamt sync with head
 1.4.4.2  15-Nov-2007  yamt sync with head.
 1.4.4.1  13-Nov-2007  yamt file putter.c was added on branch yamt-lazymbuf on 2007-11-15 11:44:29 +0000
 1.4.2.4  09-Dec-2007  jmcneill Sync with HEAD.
 1.4.2.3  21-Nov-2007  joerg Sync with HEAD.
 1.4.2.2  14-Nov-2007  joerg Sync with HEAD.
 1.4.2.1  13-Nov-2007  joerg file putter.c was added on branch jmcneill-pm on 2007-11-14 19:04:33 +0000
 1.6.6.1  02-Jan-2008  bouyer Sync with HEAD
 1.7.8.3  28-Sep-2008  mjf Sync with HEAD.
 1.7.8.2  02-Jun-2008  mjf Sync with HEAD.
 1.7.8.1  03-Apr-2008  mjf Sync with HEAD.
 1.7.4.1  24-Mar-2008  keiichi sync with head.
 1.7.2.3  23-Mar-2008  matt sync with HEAD
 1.7.2.2  09-Jan-2008  matt sync with HEAD
 1.7.2.1  02-Jan-2008  matt file putter.c was added on branch matt-armv6 on 2008-01-09 01:54:20 +0000
 1.9.6.2  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.9.6.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.9.4.4  09-Oct-2010  yamt sync with head
 1.9.4.3  11-Aug-2010  yamt sync with head.
 1.9.4.2  11-Mar-2010  yamt sync with head
 1.9.4.1  04-May-2009  yamt sync with head.
 1.9.2.1  04-Jun-2008  yamt sync with head
 1.14.4.1  19-Oct-2008  haad Sync with HEAD.
 1.14.2.1  28-Jul-2008  simonb Sync with head.
 1.16.4.1  04-Apr-2009  snj Pull up following revision(s) (requested by ad in ticket #661):
sys/arch/xen/xen/xenevt.c: revision 1.32
sys/compat/svr4/svr4_net.c: revision 1.56
sys/compat/svr4_32/svr4_32_net.c: revision 1.19
sys/dev/dmover/dmover_io.c: revision 1.32
sys/dev/putter/putter.c: revision 1.21
sys/kern/kern_descrip.c: revision 1.190
sys/kern/kern_drvctl.c: revision 1.23
sys/kern/kern_event.c: revision 1.64
sys/kern/sys_mqueue.c: revision 1.14
sys/kern/sys_pipe.c: revision 1.109
sys/kern/sys_socket.c: revision 1.59
sys/kern/uipc_syscalls.c: revision 1.136
sys/kern/vfs_vnops.c: revision 1.164
sys/kern/uipc_socket.c: revision 1.188
sys/net/bpf.c: revision 1.144
sys/net/if_tap.c: revision 1.55
sys/opencrypto/cryptodev.c: revision 1.47
sys/sys/file.h: revision 1.67
sys/sys/param.h: patch
sys/sys/socketvar.h: revision 1.119
Add fileops::fo_drain(), to be called from fd_close() when there is more
than one active reference to a file descriptor. It should dislodge threads
sleeping while holding a reference to the descriptor. Implemented only for
sockets but should be extended to pipes, fifos, etc.
Fixes the case of a multithreaded process doing something like the
following, which would have hung until the process got a signal.
thr0 accept(fd, ...)
thr1 close(fd)
 1.16.2.3  28-Apr-2009  skrll Sync with HEAD.
 1.16.2.2  03-Mar-2009  skrll Sync with HEAD.
 1.16.2.1  19-Jan-2009  skrll Sync with HEAD.
 1.19.2.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.27.4.2  05-Mar-2011  rmind sync with head
 1.27.4.1  30-May-2010  rmind sync with head
 1.27.2.2  22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.27.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.29.4.1  08-Feb-2011  bouyer Sync with HEAD
 1.29.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.32.2.2  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.32.2.1  30-Oct-2012  yamt sync with head
 1.33.4.1  18-May-2014  rmind sync with head
 1.33.2.2  03-Dec-2017  jdolecek update from HEAD
 1.33.2.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.34.2.1  10-Aug-2014  tls Rebase.
 1.35.18.2  29-Apr-2017  pgoyette Remove more unnecessary #include for sys/localcount.h
 1.35.18.1  27-Apr-2017  pgoyette Restore all work from the former pgoyette-localcount branch (which is
now abandoned doe to cvs merge botch).

The branch now builds, and installs via anita. There are still some
problems (cgd is non-functional and all atf tests time-out) but they
will get resolved soon.
 1.35.8.3  26-Jul-2016  pgoyette Rename LOCALCOUNT_INITIALIZER to DEVSW_MODULE_INIT. This better describes
what we're doing, and why.
 1.35.8.2  19-Jul-2016  pgoyette Instead of repeatedly typing the conditional initialization of the
.d_localcount members in the various {b,c}devsw, define an initializer
macro and use it. This also removes the need for defining new symbols
for each 'struct localcount'.

As suggested by riastradh@
 1.35.8.1  18-Jul-2016  pgoyette Another devsw needing a localcount when built as a module.
 1.37.18.1  03-Jan-2021  thorpej Sync w/ HEAD.

RSS XML Feed