Commit Graph

56 Commits

Author SHA1 Message Date
Poul-Henning Kamp bfbb9ce670 Divorce "dev_t" from the "major|minor" bitmap, which is now called
udev_t in the kernel but still called dev_t in userland.

Provide functions to manipulate both types:
        major()         umajor()
        minor()         uminor()
        makedev()       umakedev()
        dev2udev()      udev2dev()

For now they're functions, they will become in-line functions
after one of the next two steps in this process.

Return major/minor/makedev to macro-hood for userland.

Register a name in cdevsw[] for the "filedescriptor" driver.

In the kernel the udev_t appears in places where we have the
major/minor number combination, (ie: a potential device: we
may not have the driver nor the device), like in inodes, vattr,
cdevsw registration and so on, whereas the dev_t appears where
we carry around a reference to a actual device.

In the future the cdevsw and the aliased-from vnode will be hung
directly from the dev_t, along with up to two softc pointers for
the device driver and a few houskeeping bits.  This will essentially
replace the current "alias" check code (same buck, bigger bang).

A little stunt has been provided to try to catch places where the
wrong type is being used (dev_t vs udev_t), if you see something
not working, #undef DEVT_FASCIST in kern/kern_conf.c and see if
it makes a difference.  If it does, please try to track it down
(many hands make light work) or at least try to reproduce it
as simply as possible, and describe how to do that.

Without DEVT_FASCIST I belive this patch is a no-op.

Stylistic/posixoid comments about the userland view of the <sys/*.h>
files welcome now, from userland they now contain the end result.

Next planned step: make all dev_t's refer to the same devsw[] which
means convert BLK's to CHR's at the perimeter of the vnodes and
other places where they enter the game (bootdev, mknod, sysctl).
1999-05-11 19:55:07 +00:00
Daniel C. Sobral 44e568e2a1 Add support for Joliet extensions to the iso9660 fs. The related PR
cannot yet be closed, though.

I hope I got all credits right, and that the multiple submitted by lines
do not break anyone's scripts...

PR:		kern/5038, kern/5567
Submitted by:	Keith Jang <keith@email.gcn.net.tw>
Submitted by:	Joachim Kuebart <joki@kuebart.stuttgart.netsurf.de>
Submitted by:	Byung Yang <byung@wam.umd.edu>
Submitted by:	Motomichi Matsuzaki <mzaki@e-mail.ne.jp>
1999-04-18 10:58:03 +00:00
Matthew Dillon d254af07a1 Fix warnings in preparation for adding -Wall -Wcast-qual to the
kernel compile
1999-01-27 21:50:00 +00:00
Julian Elischer fd5d1124e2 VOP_STRATEGY grows an (struct vnode *) argument
as the value in b_vp is often not really what you want.
(and needs to be frobbed). more cleanups will follow this.
Reviewed by: Bruce Evans <bde@freebsd.org>
1998-07-04 20:45:42 +00:00
Mike Smith 651ae11e2f Trivial filesystem getpages/putpages implementations, set the second.
These should be considered the first steps in a work-in-progress.
Submitted by:	Terry Lambert <terry@freebsd.org>
1998-03-06 09:46:52 +00:00
Bruce Evans 675ea6f083 Unspammed nested include of <vm/vm_zone.h>. 1997-12-27 02:56:39 +00:00
Poul-Henning Kamp f041a9bdfc Staticize a few things. 1997-11-18 14:40:36 +00:00
Bruce Evans 5a5573fd8e Use bread() instead of cluster_read() for reading the last block
in a file.  There was a (harmless, I think) off-by-1 error.  This
was fixed in ufs long ago (rev.1.21 of ufs_readwrite.c) but not
in cd9660.

cd9660_read() has stagnated in many other ways.  It is closer to
the Net/2 ufs_read() (which is was cloned from) than ufs_read()
itself is.
1997-10-27 14:55:49 +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 d54d34b533 Make a set of VOP standard lock, unlock & islocked VOP operators, which
depend on the lock being located at vp->v_data.  Saves 3x3 identical
vop procs, more as the other filesystems becomes lock aware.
1997-10-17 12:36:19 +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
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
KATO Takenori 81bca6ddae Clustered read and write are switched at mount-option level.
1. Clustered I/O is switched by the MNT_NOCLUSTERR and MNT_NOCLUSTERW
   bits of the mnt_flag.  The sysctl variables, vfs.foo.doclusterread
   and vfs.foo.doclusterwrite are deleted.  Only mount option can
   control clustered I/O from userland.
2. When foofs_mount mounts block device, foofs_mount checks D_CLUSTERR
   and D_CLUSTERW bits of the d_flags member in the block device switch
   table.  If D_NOCLUSTERR / D_NOCLUSTERW are set, MNT_NOCLUSTERR /
   MNT_NOCLUSTERW bits will be set.  In this case, MNT_NOCLUSTERR and
   MNT_NOCLUSTERW cannot be cleared from userland.
3. Vnode driver disables both clustered read and write.
4. Union filesystem disables clutered write.

Reviewed by:	bde
1997-09-27 13:40:20 +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
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
Poul-Henning Kamp 0fa2443f0e Uncut&paste cache_lookup().
This unifies several times in theory indentical 50 lines of code.

The filesystems have a new method: vop_cachedlookup, which is the
meat of the lookup, and use vfs_cache_lookup() for their vop_lookup
method.  vfs_cache_lookup() will check the namecache and pass on
to the vop_cachedlookup method in case of a miss.

It's still the task of the individual filesystems to populate the
namecache with cache_enter().

Filesystems that do not use the namecache will just provide the
vop_lookup method as usual.
1997-08-26 07:32:51 +00:00
KATO Takenori 9d3220061d Added a sysctl arg, vfs.cd9660.doclusterread. Deleted debug and
!FreeBSD code arround cluster read stuff.
1997-08-25 10:26:18 +00:00
Bruce Evans 6a57385056 Removed more traces of ISODEVMAP. 1997-04-15 08:05:08 +00:00
Poul-Henning Kamp 438d3e3188 Remove all traces of undocumented feature ISODEVMAP. 1997-04-14 18:15:47 +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
Peter Wemm 6875d25465 Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not
ready for it yet.
1997-02-22 09:48:43 +00:00
Bruce Evans 4f3850c2a8 Removed bogus B_AGE policy again (see rev 1.4).
Removed FIFO ifdef again (see rev.1.8).  This also fixes vfs initialization
since the VNODEOP_SET() was inside the ifdef.
1997-02-13 00:39:06 +00:00
John Dyson 996c772f58 This is the kernel Lite/2 commit. There are some requisite userland
changes, so don't expect to be able to run the kernel as-is (very well)
without the appropriate Lite/2 userland changes.

The system boots and can mount UFS filesystems.

Untested: ext2fs, msdosfs, NFS
Known problems: Incorrect Berkeley ID strings in some files.
		Mount_std mounts will not work until the getfsent
		library routine is changed.

Reviewed by:	various people
Submitted by:	Jeffery Hsu <hsu@freebsd.org>
1997-02-10 02:22:35 +00:00
Jordan K. Hubbard 1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
John Dyson 8b612c4b4a This commit is the embodiment of some VFS read clustering improvements.
Firstly, now our read-ahead clustering is on a file descriptor basis and not
on a per-vnode basis.  This will allow multiple processes reading the
same file to take advantage of read-ahead clustering.  Secondly, there
previously was a problem with large reads still using the ramp-up
algorithm.  Of course, that was bogus, and now we read the entire
"chunk" off of the disk in one operation.   The read-ahead clustering
algorithm should use less CPU than the previous also (I hope :-)).

NOTE:  THAT LKMS MUST BE REBUILT!!!
1996-12-29 02:45:28 +00:00
Alexander Langer 92579404e8 Fix signed/unsigned comparison warnings.
Reviewed by:	bde
1996-10-20 21:01:46 +00:00
Nate Williams 95a1574e4f Whoops, I should've used the LINT config file. More ts -> tv changes
for timespec structure.
1996-09-20 05:51:12 +00:00
Poul-Henning Kamp f8845af0db First pass at cleaning up macros relating to pages, clusters and all that. 1996-05-02 10:43:17 +00:00
Joerg Wunsch 81ec856a3b Provide a better handling of partially corrupted directory entries.
Submitted by:	bde
1996-03-14 21:44:32 +00:00
Bruce Evans 10dd32cd87 Added prototypes.
cd9660_rrip.c:
Added lots of bogus casts to hide type errors exposed by the prototypes.
(Different structs are assumed to have a common prefix.)

cd9660_vnops.c:
Finished staticizing.
1995-12-03 17:14:38 +00:00
John Dyson 2d6ec99c0a Since FreeBSD clustering code now supports filesystems < PAGE_SIZE,
enable clustering for cd9660, thereby giving a BIG performance boost.
1995-11-20 03:57:50 +00:00
David Greenman de8583ced0 Brought in the setattr call support from Lite-2 so that more correct error
returns are provided.

Obtained from:	4.4BSD-Lite2
1995-11-12 10:36:19 +00:00
David Greenman ba14c32725 Fix isoilk hang caused by not checking for read-onlyness in several places.
The fix for this in Lite-2 is more complete, but these quick hacks of mine
are safer for now. I plan to integrate the additional Lite-2 stuff at some
later time. Should completely fix PR810.
1995-11-12 10:16:53 +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
Poul-Henning Kamp 605e9724c6 Make a lot of stuff static. 1995-10-31 12:13:49 +00:00
John Dyson 2c4488fce3 Finalize GETPAGES layering scheme. Move the device GETPAGES
interface into specfs code.  No need at this point to modify the
PUTPAGES stuff except in the layered-type (NULL/UNION) filesystems.
1995-10-23 02:23:29 +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
Doug Rabson 94a8606f1b Add support for the va_filerev attribute required by NFSv3. 1995-08-02 13:00:40 +00:00
Rodney W. Grimes 9b2e535452 Remove trailing whitespace. 1995-05-30 08:16:23 +00:00
Poul-Henning Kamp 1b9d1a091a Readdir on a CDrom would return bogus "d_type" values, potentially confusing
everybody (incl find(1) ?).  Initialize it to DT_UNKNOWN.  Maybe we can
do better, but I don't have the time.
1995-03-28 07:46:38 +00:00
Poul-Henning Kamp 4a565df5ed strategy for block and char devices are rightfully spec_strategy.
I feel like yanking all the "ISODEVMAP" stuff altogether, it looks
like a bad kludge...
1995-02-13 06:12:32 +00:00
Joerg Wunsch 988fa8efe3 Roll in my changes to make the cd9660 code understand the older
(original "High Sierra") CD format.  I've already implemented this for
1.1.5.1 (and posted to -hackers), but didn't get any response to it.
Perhaps i'm the only one who has such an old CD lying around...

Everything is done empirically, but i had three of them around (from
different vendors), so there's a high probability that i've got it
right. :)
1995-01-16 17:03:29 +00:00
Doug Rabson 9abf4d6ee0 Make NFS ask the filesystems for directory cookies instead of making them
itself.
1994-09-28 16:45:22 +00:00
Gary Palmer 1295d82e6c Alterations to silence gcc -Wall. Some unused variables deleted.
Reviewed by:	davidg
1994-09-26 00:32:59 +00:00
Garrett Wollman c9b1d6048d More loadable VFS changes:
- Make a number of filesystems work again when they are statically compiled
  (blush)

- FIFOs are no longer optional; ``options FIFO'' removed from distributed
  config files.
1994-09-22 19:38:41 +00:00
Garrett Wollman c901836c14 Implemented loadable VFS modules, and made most existing filesystems
loadable.  (NFS is a notable exception.)
1994-09-21 03:47:43 +00:00