Commit Graph

31 Commits

Author SHA1 Message Date
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
Rodney W. Grimes
9b2e535452 Remove trailing whitespace. 1995-05-30 08:16:23 +00:00
Julian Elischer
bacc93a004 change to reflect reality.
(yes I know I should have done one commit rod....)
1995-05-03 23:10:35 +00:00
Julian Elischer
c79137536b remove debugging printouts unless DEVFS_DEBUG is set. 1995-05-03 23:06:31 +00:00
Julian Elischer
8901d7cafe Submitted by: phk
if the 'time on a node is 0,..
tell the world it is the same as 'boottime'.
This is becasue 'time' is not set up when we create the nodes,
so we can't set them then.
1995-05-03 23:04:26 +00:00
Julian Elischer
9d55f6fd25 remove note about 'find' now that it's fixed. 1995-04-20 22:02:05 +00:00
Julian Elischer
b9494fba51 Submitted by: phk@freebsd.org
Reviewed by:	Julian
fixes the 'find' anomaly mentionned in the README
(hmm I guess I should fix that too..)

diff -r1.2 devfs_vnops.c
905a906
>                       dirent.d_type = DT_DIR;
914a916
>                       dirent.d_type = DT_DIR;
920a923,941
>                       switch(name_node->dnp->type) {
>                       case DEV_BDEV:
>                               dirent.d_type = DT_BLK;
>                               break;
>                       case DEV_CDEV:
>                               dirent.d_type = DT_CHR;
>                               break;
>                       case DEV_DDEV:
>                               dirent.d_type = DT_SOCK; /*XXX*/
>                               break;
>                       case DEV_DIR:
>                               dirent.d_type = DT_DIR;
>                               break;
>                       case DEV_SLNK:
>                               dirent.d_type = DT_LNK;
>                               break;
>                       default:
>                               dirent.d_type = DT_UNKNOWN;
>                       }
1995-04-20 22:00:05 +00:00
Julian Elischer
072506ba00 Submitted by: julian
@#%$#@ ftp -p corrupted the file in transfer..
(cut off the last 2 lines).. fix this
1995-04-20 07:42:41 +00:00
Julian Elischer
b79223f61b Submitted by: julian
I did a cleanup on the code..
(why didn't I do that before I checked it in? I hear you ask..)
1995-04-20 07:34:55 +00:00
Julian Elischer
adf18d3b60 Reviewed by:
Submitted by:	julian
oops rename doc file to README as agreed
1995-04-20 06:36:36 +00:00
Julian Elischer
e902d016a6 Reviewed by: no-one yet, but nonintrusive until configed in.. :)
Submitted by:	julian@freebsd.org
Obtained from:	written from scratch
1995-04-20 03:31:34 +00:00