Commit Graph

160 Commits

Author SHA1 Message Date
Bruce Evans
e5b19842ef Removed unused includes. 1998-06-21 14:53:44 +00:00
Peter Wemm
7a204420d3 Don't silently accept attempts to change flags where they are not
supported.
1998-06-10 06:34:57 +00:00
Mike Smith
7be2d30077 In the words of the submitter:
---------
Make callers of namei() responsible for releasing references or locks
instead of having the underlying filesystems do it.  This eliminates
redundancy in all terminal filesystems and makes it possible for stacked
transport layers such as umapfs or nullfs to operate correctly.

Quality testing was done with testvn, and lat_fs from the lmbench suite.

Some NFS client testing courtesy of Patrik Kudo.

vop_mknod and vop_symlink still release the returned vpp.  vop_rename
still releases 4 vnode arguments before it returns.  These remaining cases
will be corrected in the next set of patches.
---------

Submitted by:	Michael Hancock <michaelh@cet.co.jp>
1998-05-07 04:58:58 +00:00
Mike Smith
79cc756d8b As described by the submitter:
Reverse the VFS_VRELE patch.  Reference counting of vnodes does not need
to be done per-fs.  I noticed this while fixing vfs layering violations.
Doing reference counting in generic code is also the preference cited by
John Heidemann in recent discussions with him.

The implementation of alternative vnode management per-fs is still a valid
requirement for some filesystems but will be revisited sometime later,
most likely using a different framework.

Submitted by:	Michael Hancock <michaelh@cet.co.jp>
1998-05-06 05:29:41 +00:00
Julian Elischer
c0bab11dfe Make the devfs SLICE option a standard type option.
(hopefully it will go away eventually anyhow)
1998-04-20 03:57:41 +00:00
Julian Elischer
3e425b968d Add changes and code to implement a functional DEVFS.
This code will be turned on with the TWO options
DEVFS and SLICE. (see LINT)
Two labels PRE_DEVFS_SLICE and POST_DEVFS_SLICE will deliniate these changes.

/dev will be automatically mounted by init (thanks phk)
on bootup. See /sys/dev/slice/slice.4 for more info.
All code should act the same without these options enabled.

Mike Smith, Poul Henning Kamp, Soeren, and a few dozen others

This code does not support the following:
bad144 handling.
Persistance. (My head is still hurting from the last time we discussed this)
ATAPI flopies are not handled by the SLICE code yet.

When this code is running, all major numbers are arbitrary and COULD
be dynamically assigned. (this is not done, for POLA only)
Minor numbers for disk slices ARE arbitray and dynamically assigned.
1998-04-19 23:32:49 +00:00
Dag-Erling Smørgrav
dc73342347 Seventy-odd "its" / "it's" typos in comments fixed as per kern/6108. 1998-04-17 22:37:19 +00:00
Poul-Henning Kamp
a0502b19d4 Add two new functions, get{micro|nano}time.
They are atomic, but return in essence what is in the "time" variable.
gettime() is now a macro front for getmicrotime().

Various patches to use the two new functions instead of the various
hacks used in their absence.

Some puntuation and grammer patches from Bruce.

A couple of XXX comments.
1998-03-26 20:54:05 +00:00
Julian Elischer
2b28ffe5aa Free the vnode in the failure case of vop_symlink()
Suggested by: Michaelh@cet.co.jp
1998-03-10 09:12:19 +00:00
Mike Smith
34bdbbd0de The intent is to get rid of WILLRELE in vnode_if.src by making
a complement to all ops that return a vpp, VFS_VRELE.  This is
initially only for file systems that implement the following ops
that do a WILLRELE:

	vop_create, vop_whiteout, vop_mknod, vop_remove, vop_link,
	vop_rename, vop_mkdir, vop_rmdir, vop_symlink

This is initial DNA that doesn't do anything yet.  VFS_VRELE is
implemented but not called.

A default vfs_vrele was created for fs implementations that use the
standard vnode management routines.

VFS_VRELE implementations were made for the following file systems:

Standard (vfs_vrele)
	ffs mfs nfs msdosfs devfs ext2fs

Custom
	union umapfs

Just EOPNOTSUPP
	fdesc procfs kernfs portal cd9660

These implementations may change as VOP changes are implemented.

In the next phase, in the vop implementations calls to vrele and the vrele
part of vput will be moved to the top layer vfs_vnops and made visible
to all layers.  vput will be replaced by unlock in these cases.  Unlocking
will still be done in the per fs layer but the refcount decrement will be
triggered at the top because it doesn't hurt to hold a vnode reference a
little longer.  This will have minimal impact on the structure of the
existing code.

This will only be done for vnode arguments that are released by the various
fs vop implementations.

Wider use of VFS_VRELE will likely require restructuring of the code.

Reviewed by:	phk, dyson, terry et. al.
Submitted by:	Michael Hancock <michaelh@cet.co.jp>
1998-03-01 22:46:53 +00:00
Julian Elischer
dd86d26a6d add copyrights 1998-01-02 07:31:07 +00:00
Bruce Evans
1cd52ec333 Don't include <sys/lock.h> in headers when only `struct simplelock' is
required.  Fixed everything that depended on the pollution.
1997-12-05 19:55:52 +00:00
Julian Elischer
171d1bf26d fix slight breakages from PHK's VFS work.
also remove irrelevant copyright, now that all that code has gone away.
1997-11-08 19:02:28 +00:00
Bruce Evans
ef91bd5734 Removed unused #includes. The need for most of them went away with
recent changes (docluster* and vfs improvements).
1997-10-27 13:33:47 +00:00
Poul-Henning Kamp
dba3870c10 VFS interior redecoration.
Rename vn_default_error to vop_defaultop all over the place.
Move vn_bwrite from vfs_bio.c to vfs_default.c and call it vop_stdbwrite.
Use vop_null instead of nullop.
Move vop_nopoll from vfs_subr.c to vfs_default.c
Move vop_sharedlock from vfs_subr.c to vfs_default.c
Move vop_nolock from vfs_subr.c to vfs_default.c
Move vop_nounlock from vfs_subr.c to vfs_default.c
Move vop_noislocked from vfs_subr.c to vfs_default.c
Use vop_ebadf instead of *_ebadf.
Add vop_defaultop for getpages on master vnode in MFS.
1997-10-26 20:55:39 +00:00
Poul-Henning Kamp
e9565321ea VFS clean up "hekto commit"
1.  Add defaults for more VOPs
        VOP_LOCK        vop_nolock
        VOP_ISLOCKED    vop_noislocked
        VOP_UNLOCK      vop_nounlock
    and remove direct reference in filesystems.

2.  Rename the nfsv2 vnop tables to improve sorting order.
1997-10-16 22:01:05 +00:00
Poul-Henning Kamp
987f569678 Another VFS cleanup "kilo commit"
1.  Remove VOP_UPDATE, it is (also) an UFS/{FFS,LFS,EXT2FS,MFS}
    intereface function, and now lives in the ufsmount structure.

2.  Remove VOP_SEEK, it was unused.

3.  Add mode default vops:

    VOP_ADVLOCK          vop_einval
    VOP_CLOSE            vop_null
    VOP_FSYNC            vop_null
    VOP_IOCTL            vop_enotty
    VOP_MMAP             vop_einval
    VOP_OPEN             vop_null
    VOP_PATHCONF         vop_einval
    VOP_READLINK         vop_einval
    VOP_REALLOCBLKS      vop_eopnotsupp

    And remove identical functionality from filesystems

4.   Add vop_stdpathconf, which returns the canonical stuff.  Use
     it in the filesystems.  (XXX: It's probably wrong that specfs
     and fifofs sets this vop, shouldn't it come from the "host"
     filesystem, for instance ufs or cd9660 ?)

5.   Try to make system wide VOP functions have vop_* names.

6.   Initialize the um_* vectors in LFS.

(Recompile your LKMS!!!)
1997-10-16 20:32:40 +00:00
Poul-Henning Kamp
cec0f20ce7 VFS mega cleanup commit (x/N)
1.  Add new file "sys/kern/vfs_default.c" where default actions for
    VOPs go. Implement proper defaults for ABORTOP, BWRITE, LEASE,
    POLL, REVOKE and STRATEGY.  Various stuff spread over the entire
    tree belongs here.

2.  Change VOP_BLKATOFF to a normal function in cd9660.

3.  Kill VOP_BLKATOFF, VOP_TRUNCATE, VOP_VFREE, VOP_VALLOC.  These
    are private interface functions between UFS and the underlying
    storage manager layer (FFS/LFS/MFS/EXT2FS).  The functions now
    live in struct ufsmount instead.

4.  Remove a kludge of VOP_ functions in all filesystems, that did
    nothing but obscure the simplicity and break the expandability.
    If a filesystem doesn't implement VOP_FOO, it shouldn't have an
    entry for it in its vnops table.  The system will try to DTRT
    if it is not implemented.  There are still some cruft left, but
    the bulk of it is done.

5.  Fix another VCALL in vfs_cache.c (thanks Bruce!)
1997-10-16 10:50:27 +00:00
Julian Elischer
67d65825cf remove forgotten debug printf() 1997-10-16 08:18:38 +00:00
Julian Elischer
2daae425f5 1/ by default make all versions of the same device get the same vnode.
2/ Show the dummy mount in the mount list. it cannot be reached (that I know of)
	but puting it there, means that disks mounted from devfs will have their	things such as the superblock and the bitmaps, synced to disk :)
1997-10-16 07:28:50 +00:00
Julian Elischer
2a5e970deb some cleanups of init code, and changes needed to support disk layering. 1997-10-16 06:29:27 +00:00
Poul-Henning Kamp
138ec1f71a vnops megacommit
1.  Use the default function to access all the specfs operations.
2.  Use the default function to access all the fifofs operations.
3.  Use the default function to access all the ufs operations.
4.  Fix VCALL usage in vfs_cache.c
5.  Use VOCALL to access specfs functions in devfs_vnops.c
6.  Staticize most of the spec and fifofs vnops functions.
7.  Make UFS panic if it lacks bits of the underlying storage handling.
1997-10-15 13:24:07 +00:00
Poul-Henning Kamp
6a525123aa Hmm, realign the vnops into two columns. 1997-10-15 10:05:29 +00:00
Poul-Henning Kamp
539ef70c2d Stylistic overhaul of vnops tables.
1. Remove comment stating the blatantly obvious.
        2. Align in two columns.
        3. Sort all but the default element alphabetically.
        4. Remove XXX comments pointing out entries not needed.
1997-10-15 09:22:02 +00:00
Julian Elischer
d9c15b1f71 if we free all the links to a node, then by definition
we freed the name we used to find it..
SO DON'T free it again later!

pointy hat over here please..
1997-10-12 22:27:11 +00:00
Poul-Henning Kamp
a1c995b626 Last major round (Unless Bruce thinks of somthing :-) of malloc changes.
Distribute all but the most fundamental malloc types.  This time I also
remembered the trick to making things static:  Put "static" in front of
them.

A couple of finer points by:	bde
1997-10-12 20:26:33 +00:00
Poul-Henning Kamp
55166637cd Distribute and statizice a lot of the malloc M_* types.
Substantial input from:	bde
1997-10-11 18:31:40 +00:00
Julian Elischer
d5ad8952dc Allow a deleted deveice to delte it's nodes in other mounted devfs
filesystems even if not in SPLIT_DEVS mode.
1997-10-10 07:54:05 +00:00
John Dyson
99448ed11d Change the M_NAMEI allocations to use the zone allocator. This change
plus the previous changes to use the zone allocator decrease the useage
of malloc by half.  The Zone allocator will be upgradeable to be able
to use per CPU-pools, and has more intelligent usage of SPLs.  Additionally,
it has reasonable stats gathering capabilities, while making most calls
inline.
1997-09-21 04:24:27 +00:00
Julian Elischer
72963672f5 devfs changes to allow old (better) and newer (braindamaged) behaviour.
I'm going to try migrate back, while keeping the newer code.
1997-09-16 09:10:18 +00:00
Peter Wemm
a6aeade2c4 Convert select -> poll.
Delete 'always succeed' select/poll handlers, replaced with generic call.
Flag missing vnode op table entries.
1997-09-14 02:58:12 +00:00
Bruce Evans
41fadeeb28 Removed yet more vestiges of config-time swap configuration and/or
cleaned up nearby cruft.
1997-09-07 16:21:11 +00:00
Bruce Evans
a910e75cdc Removed vestiges of config-time "argument processing" configuration. 1997-09-07 13:49:56 +00:00
Julian Elischer
139c7c8e2d remove un-needed if statement (now the poul removed the 'then' clause) 1997-08-27 02:58:40 +00:00
Julian Elischer
bdb9147f65 two fixes submitted by Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>
fixes problems in unmounting and propogation.
1997-08-26 17:17:52 +00:00
Poul-Henning Kamp
013739386f Copy&Paste considered harmful:
Remove all traces of the name_cache from devfs.  It is hardly sensible to
use the namecache for an all-RAM filesystem.
1997-08-25 20:31:00 +00:00
Garrett Wollman
57bf258e3d Fix all areas of the system (or at least all those in LINT) to avoid storing
socket addresses in mbufs.  (Socket buffers are the one exception.)  A number
of kernel APIs needed to get fixed in order to make this happen.  Also,
fix three protocol families which kept PCBs in mbufs to not malloc them
instead.  Delete some old compatibility cruft while we're at it, and add
some new routines in the in_cksum family.
1997-08-16 19:16:27 +00:00
Bruce Evans
1fd0b0588f Removed unused #includes. 1997-08-02 14:33:27 +00:00
Julian Elischer
0ec278018b two tiny typo's 1997-07-14 04:53:52 +00:00
Julian Elischer
5897e2693a remove annoying debug message 1997-07-14 04:30:22 +00:00
Joerg Wunsch
ce34628b4b Fix the umount problems for DEVFS.
PR:		3276 & 3469 (the fixes), 2738, 2033 (reports)
Submitted by:	Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>
1997-05-03 21:19:54 +00:00
Bruce Evans
c90607ba7f Get the declaration of `struct dirent' from <sys/dirent.h>, not from
<sys/dir.h>, and use the new macro GENERIC_DIRSIZ() instead of DIRSIZ().

Removed unused #includes.
1997-04-10 15:05:38 +00:00
Bruce Evans
1a2efb7550 Removed unused or apparently-unused #includes, especially of the
deprecated header <sys/dir.h>.
1997-04-10 14:35:32 +00:00
Bruce Evans
9135a51377 Use Lite2's stub locking vops instead of nullop. 1997-02-24 17:08:49 +00:00
Mike Pritchard
fd7a659f2f Make this compile again after the Lite2 merge.
Call vget/VOP_UNLOCK with the correct number of
arguments.  Call vn_lock where appropriate.
vfs_goneall is now replaced by VOP_REVOKE.

Submitted by:	bde
1997-02-12 16:19:11 +00:00
Julian Elischer
acdbeb6b1c changes to make devfs more 'normal'
also fixes a bug I've been chasing for a LONG TIME,
due to the fact that spec_bwrite is a NOP and I didn't realise it..

old symptom:
mount -t devfs devfs /mnt
mount /mnt/wd0e /mnt/mnt2
umount /mnt2 <process hangs>

there are some pretty large structural differences internal to devfs
but outwards it should look the same.
I have not yet tested extensively but will do so and fix 3 warnings tomorrow.
1996-11-21 07:19:00 +00:00
Poul-Henning Kamp
7f6a56eff7 devfs_tree.c: improve our bdevvp() function.
devfs_vnops.c:	move a debug printf to be consistent.
1996-10-28 11:36:06 +00:00
Julian Elischer
24b3bdfe8d Just because something doesn't make sense doesn't mean it should be illegal..
just ignore it instead.
===================================================================
RCS file: /home/ncvs/src/sys/miscfs/devfs/devfs_vnops.c,v
retrieving revision 1.30
diff -r1.30 devfs_vnops.c
631d630
<           (vap->va_size != VNOVAL) || /* doesn't make sense in devfs */
1996-10-17 22:47:23 +00:00
Julian Elischer
138e4d769c actually impliment permissions for teh chown/chmod/etc functions
that resemble what the man pages say.
also fix braino (type last week)
1996-10-16 23:14:00 +00:00
Julian Elischer
336cf5014e Allow the utimes call to work on devfs nodes. 1996-10-16 18:02:53 +00:00
Julian Elischer
1737b9d383 reads and writes to devices update m and a times
add some security onn the chmod/chown operations
should now be root or owner
(still needs more thought but kinda-plugs tow holes pointed out by bde)
1996-10-12 00:07:53 +00:00
Bruce Evans
dc927d0c6b Started unspamming <sys/systm.h>. Don't include <machine/stdarg.h>
to get the declaration of va_list; just use _BSD_VA_LIST.  Fixed
the 2 places that need <machine.stdarg.h> but didn't include it
explicitly.
1996-09-29 15:00:37 +00:00
Nate Williams
d977b72dbd Whoops, I should've used the LINT config file. More ts -> tv changes
for timespec structure.
1996-09-20 05:56:36 +00:00
Julian Elischer
99892d2317 fix the ability of the VFS to reclaim devfs nodes correctly..
(was resulting in panics, especially when DIAGNOSTIC was set.)
1996-09-11 07:52:18 +00:00
Bruce Evans
f313170d3c Updated #includes to 4.4Lite style. 1996-09-10 08:32:01 +00:00
Bruce Evans
b71fec07db Eliminated nested include of <sys/unistd.h> in <sys/file.h> in the kernel.
Include it directly in the few places where it is used.

Reduced some #includes of <sys/file.h> to #includes of <sys/fcntl.h> or
nothing.
1996-09-03 14:25:27 +00:00
Julian Elischer
def534af64 Submitted by: doug Rabson (dfr@render.com)
cleaning up some of the vnode usage..

(I'm sure it still needs more..)
where can one find out what each vfs call expects to be locked
on completion, and how can one find out what each layer expects
to be freed on error.?
1996-08-13 19:48:41 +00:00
Julian Elischer
ed9a71b7fc symlink support in devfs.
it only barely works so don't get too carried away..
I noticed that teh symlink is length 0..
I guess I'll fix that tomorrow..
it also sometimes panics with "cleaned vnode isn't" but it's not more
broken than it was before.. I really want to go over it with someone
who understands the lifecycle of a vnode better than I do..

terry?
kirk?
david?
john?
1996-08-13 07:21:45 +00:00
Bruce Evans
8c2ff39670 Only use the special bdevvp() for DEVFS if DEVFS_ROOT is defined. This
makes option DEVFS safe to use again (although mounting devfs is unsafe).
1996-07-30 18:00:32 +00:00
Poul-Henning Kamp
c74bb98638 DEVFS needs a special bdevvp().
I just noticed some junk in my patch.  I'll remove that in a sec.
1996-07-24 21:22:36 +00:00
Gary Palmer
75cc5f07de Cosmetic change: make the ``ready to run'' line match the
``ready for devices'' printed out earlier by changing `devs '
to be `DEVFS: '
1996-06-15 20:37:22 +00:00
Gary Palmer
1409e0b384 Clean up -Wunused warnings. Julian asked me to just ifdef
out unused code as this is still work in progress.

Reviewed by:		bde
1996-06-12 05:08:34 +00:00
Joerg Wunsch
cbe4630780 Fix the reproto.sh script that was broken after my KNFification.
Pointed out by: bde
1996-04-07 01:15:03 +00:00
Joerg Wunsch
d9fb9dd03e KNFify the function definitions. It's harder to grep around when the
function names don't start in column 1.
1996-04-06 13:34:37 +00:00
Marc G. Fournier
ad98bd0b24 Merged devfs_add_devsw() into devfs_add_devswf() 1996-04-03 03:03:27 +00:00
Marc G. Fournier
2523e82c8b Made the src code match the man page.
Removed dev_link() and dev_linkf(), replacing dev_linkf() with devfs_link()
1996-04-02 04:53:05 +00:00
Marc G. Fournier
0d5b12e38e Added dev_linkf() function (dev_link() + printf-style arguments)
Reviewed by:	julian@freebsd.org
1996-03-28 14:32:27 +00:00
Julian Elischer
54a5291b37 Submitted by: "Marc G. Fournier" <scrappy@ki.net>
allows correct creation of subdirectories in devfs_add_devswf()
1996-03-25 21:56:59 +00:00
Julian Elischer
e9ee430593 really stupid mistake that stopped devices from appearing on the fly in mounted
DEVFS filesystems..

- 		if ( error = dev_add_name(child->name,parent->dnp
+ 		if ( error = dev_add_name(child->name,falias->dnp

Ok bruce, this is the one you were seeing..
1996-02-18 07:29:53 +00:00
Mike Pritchard
6c5e9bbdf5 Fix a bunch of spelling errors in the comment fields of
a bunch of system include files.
1996-01-30 23:02:38 +00:00
Poul-Henning Kamp
02ae573ca8 make devfs_add_devswf a little smarter about '/'; 1996-01-28 10:07:55 +00:00
Poul-Henning Kamp
831e28a67a Make devfs_add_devfsf() which takes printf style args. 1996-01-25 07:17:31 +00:00
Julian Elischer
da798be901 Slightly improved debug messages for inserting new items 1996-01-21 09:43:31 +00:00
Julian Elischer
b10669ebad oops.
get the last edit right
1996-01-21 09:07:58 +00:00
Julian Elischer
3daaa0c3bc Submitted by: Bruce Evans (bde)
better naming for  exported devfs function
and better place for the prototype
1996-01-21 09:03:15 +00:00
Peter Wemm
689d68d9c2 Remove unnecessary debug printf's ("no references", "bad-id") - these
were development aids :-) and normal events.

Initialise the "hidden" blueprint mount "mnt_op" and "mnt_vfc" fields so
that a statfs() on a devfs file would not panic anymore. Fixes PR#911.

Head-scratching by: Julian and Peter
1996-01-02 09:14:49 +00:00
Peter Wemm
a5b996a7ec recording cvs-1.6 file death 1995-12-30 19:02:48 +00:00
Bruce Evans
a899362e40 Restored lost prototypes. 1995-12-14 19:04:09 +00:00
Poul-Henning Kamp
f708ef1b9e Another mega commit to staticize things. 1995-12-14 09:55:16 +00:00
Julian Elischer
4d92e19833 clean a few DEVFS things..
fix a bug where you couldn't place devices in the root directory
of devfs

remove deprecated routines

On my machine devfs now shows:
julian@erf.tfs.com:
julian@erf.tfs.com: ls -RF
bpf0            mem             ptypb           spkr            ttyp8
bpf1            null            ptypc           stderr          ttyp9
bpf2            pcaudio         ptypd           stdin           ttypa
bpf3            pcaudioctl      ptype           stdout          ttypb
console         pt              ptypf           tty             ttypc
cuaa0           ptyp0           random          ttyd0           ttypd
cuaia0          ptyp1           rsd0            ttyid0          ttype
cuala0          ptyp2           rsd1            ttyld0          ttypf
fd/             ptyp3           rvn             ttyp0           tun0
fd0.1440        ptyp4           rworm           ttyp1           urandom
fd1.1200        ptyp5           scsi/           ttyp2           vn
io              ptyp6           sd0             ttyp3           zero
kmem            ptyp7           sd1             ttyp4
lkm             ptyp8           snp0            ttyp5
log             ptyp9           snp1            ttyp6
lpt0            ptypa           snp2            ttyp7

./fd:
0       15      21      28      34      40      47      53      6       9
1       16      22      29      35      41      48      54      60
10      17      23      3       36      42      49      55      61
11      18      24      30      37      43      5       56      62
12      19      25      31      38      44      50      57      63
13      2       26      32      39      45      51      58      7
14      20      27      33      4       46      52      59      8

./scsi:
sctarg  ssc
julian@erf.tfs.com:

which is all devices really there except for disk slices/partitions..
(if I don't have it it's not there, which has GOT to be an improvement..)

no DEVFS fixes from device maintainers yet?
1995-12-09 09:11:25 +00:00
Julian Elischer
87f6c6625d Pass 3 of the great devsw changes
most devsw referenced functions are now static, as they are
in the same file as their devsw structure. I've also added DEVFS
support for nearly every device in the system, however
many of the devices have 'incorrect' names under DEVFS
because I couldn't quickly work out the correct naming conventions.
(but devfs won't be coming on line for a month or so anyhow so that doesn't
matter)

If you "OWN" a device which would normally have an entry in /dev
then search for the devfs_add_devsw() entries and munge to make them right..
check out similar devices to see what I might have done in them in you
can't see what's going on..
for a laugh compare conf.c conf.h defore and after... :)
I have not doen DEVFS entries for any DISKSLICE devices yet as that will be
a much more complicated job.. (pass 5 :)

pass 4 will be to make the devsw tables of type (cdevsw * )
rather than (cdevsw)
seems to work here..
complaints to the usual places.. :)
1995-12-08 11:19:42 +00:00
Julian Elischer
53ac6efbd8 OK, that's it..
That's EVERY SINGLE driver that has an entry in conf.c..
my next trick will be to define cdevsw[] and bdevsw[]
as empty arrays and remove all those DAMNED defines as well..

Each of these drivers has a SYSINIT linker set entry
that comes in very early.. and asks teh driver to add it's own
entry to the two devsw[] tables.

some slight reworking of the commits from yesterday (added the SYSINIT
stuff and some usually wrong but token DEVFS entries to all these
devices.

BTW does anyone know where the 'ata' entries in conf.c actually reside?
seems we don't actually have a 'ataopen() etc...

If you want to add a new device in conf.c
please  make sure I know
so I can keep it up to date too..

as before, this is all dependent on #if defined(JREMOD)
(and #ifdef DEVFS in parts)
1995-11-29 10:49:16 +00:00
Bruce Evans
f57e65478d Introduced a type `vop_t' for vnode operation functions and used
it 1138 times (:-() in casts and a few more times in declarations.
This change is null for the i386.

The type has to be `typedef int vop_t(void *)' and not `typedef
int vop_t()' because `gcc -Wstrict-prototypes' warns about the
latter.  Since vnode op functions are called with args of different
(struct pointer) types, neither of these function types is any use
for type checking of the arg, so it would be preferable not to use
the complete function type, especially since using the complete
type requires adding 1138 casts to avoid compiler warnings and
another 40+ casts to reverse the function pointer conversions before
calling the functions.
1995-11-09 08:17:23 +00:00
Julian Elischer
2279703911 almost entirely cosmetic changes
just keeping the sources in sync with my own set..
1995-10-10 07:12:27 +00:00
Julian Elischer
56c3ab883e find some way of letting a node know where in its parent's directory structure
it was referenced from.. stops a rather annoying panic, but
introduces a rather interesting but "I can live with it" bug
`ln a b ; mv a b; echo ?`
returns a rather than b..
I know why but I need to think of the 'correct' answer. at least this is 'safe'
1995-10-04 11:05:09 +00:00
Julian Elischer
d51afe9d38 added support for link, and remove (unlink)
can now ln /devs/disks/floppy/fd1.1200 to fd1
and remove unwanted dirs and devices etc.
Still has a fatal bug.. don't use yet :)
1995-09-19 07:32:01 +00:00
Julian Elischer
55b7166d83 Submitted by: bde
prototype file follows the sources..
1995-09-14 06:17:28 +00:00
David Greenman
4590fd3a2a Fixed init functions argument type - caddr_t -> void *. Fixed a couple of
compiler warnings.
1995-09-09 18:10:37 +00:00
Julian Elischer
564643c636 More hacking on devfs..
I can  now do an mv on devices and directories in devfs
This was the hardest part.. link, delete and symlink will follow in
short order.
This code works but has definitly got vnode locking problems
I am electing to get the structure of it working before
spending too much time on the vnode confusion
so it's probably not reliable at the moment..
never-the less it looks good.
 :)
1995-09-09 12:51:56 +00:00
Julian Elischer
7090c38afc added the dev_link external registration
used to produce a second link to an already exixting device
e.g.
dev_add /disks/sd0
dev_link /scsi/bus0/targ0/lun0 to /disks/sd0
(not real syntax)
1995-09-08 04:46:14 +00:00
Julian Elischer
f5c892dd57 brought the README in to line with present code (still a bit cryptic) 1995-09-07 06:16:28 +00:00
Julian Elischer
65ba86052a more cleanups.. lots of code shuffled around too
routines renamed.. more simplifications,
some warnings squashed.
1995-09-07 06:01:36 +00:00
Julian Elischer
ab746f65c1 Suggested by: :) bde of course
added prototypes for every function and
put (void *) as the args to the vop array definitions.

can now compile with:
CWARNFLAGS?=    -W -Wreturn-type -Wcomment -Wredundant-decls -Wimplicit \
                -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes \
                -Winline -Wstrict-prototypes
and only get errors for files external to this module:
namely
./vnode_if.h
../../sys/vnode.h
../../sys/buf.h
../../miscfs/specfs/specdev.h
1995-09-06 23:15:55 +00:00
Julian Elischer
a8ea97ec7f more devfs cleanups..
if this keeps simplifying there won't be any left :)
1995-09-06 09:29:19 +00:00
Julian Elischer
5ee2a9f3b6 this file replaces two others.. I haven't removed them yet, but
when this code seems more solid, they get the bullet.
1995-09-06 08:26:51 +00:00
John Dyson
c83ebe7781 Added VOP_GETPAGES/VOP_PUTPAGES and also the "backwards" block count
for VOP_BMAP.  Updated affected filesystems...
1995-09-04 00:21:16 +00:00
Julian Elischer
e475eb56ca remove about 50 lines of duplicate code..
the code to create the root directory now calls the generic
make directory routine..
1995-09-03 08:39:26 +00:00
Julian Elischer
8af5d536ff devfs changes..
changes to allow devices that don't probe (e.g. /dev/mem)
to create devfs entries
this required giving 'configure' its own SYSINIT entry
so we could duck in just before it with a DEVFS init
and some device inits..
my devfs now looks like:
./misc
./misc/speaker
./misc/mem
./misc/kmem
./misc/null
./misc/zero
./misc/io
./misc/console
./misc/pcaudio
./misc/pcaudioctl
./disks
./disks/rfloppy
./disks/rfloppy/fd0.1440
./disks/rfloppy/fd1.1200
./disks/floppy
./disks/floppy/fd0.1440
./disks/floppy/fd1.1200
also some sligt cleanups.. DEVFS needs a lot of work
but I'm getting back to it..
1995-09-03 05:43:50 +00:00
Julian Elischer
ffb10de317 Submitted by: Julian
changes to make it compile again
1995-09-02 07:09:01 +00:00
David Greenman
4777741358 Removed my special-case hack for VOP_LINK and fixed the problem with the
wrong vp's ops vector being used by changing the VOP_LINK's argument order.
The special-case hack doesn't go far enough and breaks the generic
bypass routine used in some non-leaf filesystems. Pointed out by Kirk
McKusick.
1995-08-01 18:51:02 +00:00