Home | History | Annotate | Download | only in ultrix
History log of /src/sys/compat/ultrix/ultrix_fs.c
RevisionDateAuthorComments
 1.60  05-Jul-2022  andvar s/retrys/retries/ in comments.
 1.59  29-Sep-2020  msaitoh s/parition/partition/
 1.58  03-Dec-2017  maxv Fix uninitialized pointer, found by Mootja. Not a surprise in untested
code.
 1.57  13-Apr-2017  hannken branches: 1.57.4;
Switch ultrix_sys_getmnt() to mountlist iterator.
Really skip "start" items instead of a useless loop.
Compile tested only.
 1.56  23-Oct-2015  maxv branches: 1.56.2; 1.56.4;
Change do_sys_mount() so that it only takes as argument the type of the
drive instead of its associated vfsops. Makes it more friendly, and allows
compat binaries to autoload VFS modules if needed.

sent on tech-kern@, ok christos@
 1.55  24-Jul-2015  maxv Unused inits (harmless).

Found by Brainy.
 1.54  27-Nov-2013  christos branches: 1.54.6;
Change the queue.3 *_END(&head) macros to NULL. Since we don't have CIRCLEQ
anymore, all the macros expand to NULL anyway, so this improves readability.
Requested by rmind@
 1.53  23-Nov-2013  christos fix previous, list ends in NULL, and don't open-code
 1.52  23-Nov-2013  riz Since mountlist is now a TAILQ, convert some missed usages
so things build again.
 1.51  14-Dec-2009  matt branches: 1.51.12; 1.51.22; 1.51.26;
Merge from matt-nb5-mips64
 1.50  17-Dec-2008  cegger kill MALLOC and FREE macros.
 1.49  06-May-2008  ad branches: 1.49.2; 1.49.8; 1.49.16;
PR kern/38141 lookup/vfs_busy acquire rwlock recursively

Simplify the mount locking. Remove all the crud to deal with recursion on
the mount lock, and crud to deal with unmount as another weirdo lock.

Hopefully this will once and for all fix the deadlocks with this. With this
commit there are two locks on each mount:

- krwlock_t mnt_unmounting. This is used to prevent unmount across critical
sections like getnewvnode(). It's only ever read locked with rw_tryenter(),
and is only ever write locked in dounmount(). A write hold can't be taken
on this lock if the current LWP could hold a vnode lock.

- kmutex_t mnt_updating. This is taken by threads updating the mount, for
example when going r/o -> r/w, and is only present to serialize updates.
In order to take this lock, a read hold must first be taken on
mnt_unmounting, and the two need to be held across the operation.

One effect of this change: previously if an unmount failed, we would make a
half hearted attempt to back out of it gracefully, but that was unlikely to
work in a lot of cases. Now while an unmount that will be aborted is in
progress, new file operations within the mount will fail instead of being
delayed. That is unlikely to be a problem though, because if the admin
requests unmount of a file system then s(he) has made a decision to deny
access to the resource.
 1.48  30-Apr-2008  ad PR kern/38135 vfs_busy/vfs_trybusy confusion

The previous fix worked, but it opened a window where mounts could have
disappeared from mountlist while the caller was traversing it using
vfs_trybusy(). Fix that.
 1.47  30-Apr-2008  jmmv Fix build of these files after the vfs_trybusy change. Apply the same
modification done in compat/common/vfs_syscalls_20.c:1.27.
 1.46  30-Jan-2008  ad branches: 1.46.6; 1.46.8; 1.46.10;
PR kern/37706 (forced unmount of file systems is unsafe):

- Do reference counting for 'struct mount'. Each vnode associated with a
mount takes a reference, and in turn the mount takes a reference to the
vfsops.
- Now that mounts are reference counted, replace the overcomplicated mount
locking inherited from 4.4BSD with a recursable rwlock.
 1.45  27-Dec-2007  christos make this compile again.
 1.44  20-Dec-2007  dsl Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.43  27-Nov-2007  dogcow branches: 1.43.2; 1.43.6;
more VFS_STATVFS(x,y,z) fallout; change them to VFS_STATVFS(x,y). (hi, pooka!)
 1.42  23-Oct-2007  pooka branches: 1.42.2;
vfs_getopsbyname("ngs") -> vfs_getopsbyname("nfs"). 'nuff said
 1.41  10-Oct-2007  ad branches: 1.41.2;
Merge from vmlocking:

- Split vnode::v_flag into three fields, depending on field locking.
- simple_lock -> kmutex in a few places.
- Fix some simple locking problems.
 1.40  17-Jul-2007  christos branches: 1.40.6; 1.40.8; 1.40.10;
include <compat/sys/mount.h> for MFSNAMELEN
 1.39  14-Jul-2007  ad <dsl> I suspect my set of test build kernels is longer than ad's :-)

tsk!
 1.38  12-Jul-2007  dsl Change compat mount code to pass do_sys_mount() kernel resident buffers.
Possibly the standard nfs code needs teaching how to set the length and
address family in order to support non-netbsd sockaddr.
There are now no active stackgap() calls in the compat tree.
 1.37  05-Mar-2007  he branches: 1.37.2;
Need a char* for doing pointer arithmetic.
 1.36  04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.35  09-Feb-2007  ad branches: 1.35.2;
Merge newlock2 to head.
 1.34  11-Dec-2005  christos branches: 1.34.20;
merge ktrace-lwp.
 1.33  24-Sep-2005  jmmv Instead of trying to clear ufs_args' export member, zero the whole
structure so that we don't rely on that (renamed) field. Should fix
the build. Found by he@.
 1.32  31-Aug-2005  he Now that <ufs/ufsmount.h> includes <ufs/extattr.h>, we also need
<sys/vnode.h> and <sys/vnode_if.h> to bring the definition of struct
vop_getextattr_args into scope. Fixes build problem for arc.
 1.31  01-Jun-2005  drochner branches: 1.31.2;
fix const'ification fallout
 1.30  26-Feb-2005  perry nuke trailing whitespace
 1.29  21-Apr-2004  simonb branches: 1.29.4; 1.29.6;
ANSIfy, some KNF.
 1.28  21-Apr-2004  simonb Fix some statfs->statvfs fallout. Compile tested only...
 1.27  29-Jun-2003  fvdl branches: 1.27.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.26  29-Jun-2003  simonb Fix 'struct lwp *' lossage.
 1.25  18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.24  06-Jan-2003  wiz compatibility, not compatiblity.
 1.23  02-Nov-2002  jdolecek retval is 'register_t *', not 'int *'
 1.22  16-Mar-2002  christos make the stackgap_{init,alloc} functions MP friendly (i.e. pass struct proc *
in, instead of using curproc). While there add an optional size argument to
stackgap_init.
 1.21  13-Nov-2001  lukem add RCSIDs (including regeneration of files as appropriate)
 1.20  03-May-2001  matt branches: 1.20.2;
Use NULL instead of an explicit cast.
 1.19  28-Jun-2000  mrg branches: 1.19.2;
remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h>
 1.18  30-Mar-2000  augustss Kill register declarations.
 1.17  25-Apr-1999  simonb branches: 1.17.2;
Shut 'gcc -Wuninitialized' up.
 1.16  09-Aug-1998  perry branches: 1.16.8;
bzero->memset, bcopy->memcpy, bcmp->memcmp
 1.15  05-Mar-1998  thorpej Make this compile again in light of Lite2.
 1.14  05-Mar-1998  thorpej Arrgh, I said "abort", dammit...
 1.13  05-Mar-1998  thorpej *** empty log message ***
 1.12  25-May-1997  jonathan Update copyright.
 1.11  25-May-1997  jonathan lint: add prototype for static function make_ultrix_mntent().
 1.10  24-May-1997  jonathan lint: gc unused variables in ultrix_sys_mount().
 1.9  06-Apr-1997  jonathan Add changes to make vic-2.8 Ultrix binaries work on NetBSD with COMPAT_ULTRIX:
* Add IPmulticast setsockopt emulation.
* Add Ultrix shmsys emulation (untested).
* tidy up use of stackgap.
 1.8  15-Jan-1997  jonathan Fix const-pointer lint in copyout of consed-up native fstype string,
from consed-up native mount args.
 1.7  19-Oct-1996  jonathan branches: 1.7.2;
Update copyright.
 1.6  13-Oct-1996  christos Backout previous kprintf change.
 1.5  10-Oct-1996  christos printf -> kprintf, sprintf -> ksprintf
 1.4  07-Apr-1996  jonathan Remove gcc -Wall lint from ultrix emulation.-
Mostly adding explicit != comparison to "if (error = copyin/out( ... ))".
Fix comment glitch in ultrix_fs.c
 1.3  19-Feb-1996  pk Adapt to NFSv3.
 1.2  26-Dec-1995  jonathan Add emulation of ultrix mount(2). Sufficient to NFS-mount filesystems
using a NetBSD kernel in an ultrix root filesystem.

Move wait emulation to the old (v7) wait syscall number, as that's
what the Ultrix ufs_mount binary uses.
 1.1  26-Dec-1995  jonathan Add emulation of Ultrix select: before calling native sys_select(),
limit the number of FDs to select on to the maximum supported by NetBSD --
which is as many FDs as the emul_ultrix process can have open, anyway.

Add emulation of Ultrix getmnt(2) in ultrix_fs.c

Add partial emulation of Ultrix tty ioctl()s in ultrix_ioctl.c, derived
from compat/sunos/sunos_ioctl.c. Ultrix libc's ``isatty()'' now works
in compat_emul processes.
 1.7.2.1  18-Jan-1997  thorpej Update from trunk.
 1.16.8.1  21-Jun-1999  thorpej Sync w/ -current.
 1.17.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.19.2.8  07-Jan-2003  thorpej Sync with HEAD.
 1.19.2.7  11-Nov-2002  nathanw Catch up to -current
 1.19.2.6  12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.19.2.5  29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.19.2.4  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.19.2.3  06-Dec-2001  wdk struct proc -> struct lwp changes for COMPAT_ULTRIX support
 1.19.2.2  14-Nov-2001  nathanw Catch up to -current.
 1.19.2.1  21-Jun-2001  nathanw Catch up to -current.
 1.20.2.2  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.20.2.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.27.2.6  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.27.2.5  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.27.2.4  28-Nov-2004  skrll Adapt to branch
 1.27.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.27.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.27.2.1  03-Aug-2004  skrll Sync with HEAD
 1.29.6.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.29.4.1  29-Apr-2005  kent sync with -current
 1.31.2.7  04-Feb-2008  yamt sync with head.
 1.31.2.6  21-Jan-2008  yamt sync with head
 1.31.2.5  07-Dec-2007  yamt sync with head
 1.31.2.4  27-Oct-2007  yamt sync with head.
 1.31.2.3  03-Sep-2007  yamt sync with head.
 1.31.2.2  26-Feb-2007  yamt sync with head.
 1.31.2.1  21-Jun-2006  yamt sync with head.
 1.34.20.1  30-Jan-2007  ad Remove support for SA. Ok core@.
 1.35.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.37.2.3  20-Aug-2007  ad Sync with HEAD.
 1.37.2.2  15-Jul-2007  ad Sync with head.
 1.37.2.1  13-Mar-2007  ad Pull in the initial set of changes for the vmlocking branch.
 1.40.10.1  14-Oct-2007  yamt sync with head.
 1.40.8.3  23-Mar-2008  matt sync with HEAD
 1.40.8.2  09-Jan-2008  matt sync with HEAD
 1.40.8.1  06-Nov-2007  matt sync with HEAD
 1.40.6.2  27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.40.6.1  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.41.2.1  13-Nov-2007  bouyer Sync with HEAD
 1.42.2.3  18-Feb-2008  mjf Sync with HEAD.
 1.42.2.2  27-Dec-2007  mjf Sync with HEAD.
 1.42.2.1  08-Dec-2007  mjf Sync with HEAD.
 1.43.6.1  02-Jan-2008  bouyer Sync with HEAD
 1.43.2.3  26-Dec-2007  ad Sync with head.
 1.43.2.2  08-Dec-2007  ad Fix typo.
 1.43.2.1  04-Dec-2007  ad Pull the vmlocking changes into a new branch.
 1.46.10.3  11-Mar-2010  yamt sync with head
 1.46.10.2  04-May-2009  yamt sync with head.
 1.46.10.1  16-May-2008  yamt sync with head.
 1.46.8.1  18-May-2008  yamt sync with head.
 1.46.6.2  17-Jan-2009  mjf Sync with HEAD.
 1.46.6.1  02-Jun-2008  mjf Sync with HEAD.
 1.49.16.1  09-Sep-2009  matt Change to use fixed sized types.
 1.49.8.1  19-Jan-2009  skrll Sync with HEAD.
 1.49.2.2  14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

Instead, create a new file, sys/satypes.h, which contains just the
types needed for syscallargs.h. Yes, there's only one now, but that
may change and it's probably more likely to change if it'd be difficult
to handle. :-)

Per discussion with matt at n dot o, add an include of satypes.h to
sigtypes.h. Upcall handlers are kinda signal handlers, and signalling
is the header file that's already included for syscallargs.h that
closest matches SA.

This shaves about 3000 lines off of the diff of the branch relative
to the base. That also represents about 18% of the total before this
checkin.

I think this reduction is very good thing.
 1.49.2.1  10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.51.26.1  18-May-2014  rmind sync with head
 1.51.22.2  03-Dec-2017  jdolecek update from HEAD
 1.51.22.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.51.12.1  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.54.6.3  28-Aug-2017  skrll Sync with HEAD
 1.54.6.2  27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.54.6.1  22-Sep-2015  skrll Sync with HEAD
 1.56.4.1  21-Apr-2017  bouyer Sync with HEAD
 1.56.2.1  26-Apr-2017  pgoyette Sync with HEAD
 1.57.4.1  21-Dec-2017  snj Pull up following revision(s) (requested by maxv in ticket #434):
sys/compat/ultrix/ultrix_fs.c: revision 1.58
Fix uninitialized pointer, found by Mootja. Not a surprise in untested
code.

RSS XML Feed