Commit Graph

297 Commits

Author SHA1 Message Date
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
Jordan K. Hubbard 8cf27db018 Needs to include <sys/lock.h> if we're using struct lock. 1997-12-05 13:43:47 +00:00
Poul-Henning Kamp ab3f746966 In all such uses of struct buf: 's/b_un.b_addr/b_data/g' 1997-12-02 21:07:20 +00:00
Bruce Evans eb2d1c01ef `nextgennumber' can go away now that is no longer (ab)used by foreign
fs's.
1997-12-02 11:43:45 +00:00
Bruce Evans 1dd78fb7ef Use the same algorithm as ffs for generation numbers. 1997-12-02 11:42:28 +00:00
Bruce Evans 23906a782b Fix a small style bug in the generation number change (rev.1.33) before
copying the change to other fs's.
1997-12-02 11:21:16 +00:00
Bruce Evans 5b76055a53 Fixed overflow in ufs_getblns(). For ufs on systems with 32-bit ints,
triple indirect blocks only worked for block sizes of 4K, since
MNINDIR(ump)**3 overflows for larger block sizes (e.g.,
(8192/4)**3 = 2**33 > INT_MAX).  This fix is not the obvious one of
changing some types to 64 bits.  It rearranges the code to avoid some
unnecessary 64-bit calculations.

Reviewed by:	Kirk McKusick <mckusick@McKusick.COM>
1997-11-24 16:33:03 +00:00
Bruce Evans cb451ebdbd Staticized. 1997-11-22 08:35:46 +00:00
Bruce Evans 2ea354c3bb Unremoved prtrealloc and the declaration of ffs_clusteralloc(). These
are used in the `#ifdef notyet' case :-).  This case is used except in
the `#if !defined (not_yes)' case :-|.  This has something to do with
the `#ifdef notyet_block_reallocation_enabled' case in vfs_cluster.c :-(.
1997-11-22 07:00:40 +00:00
Bruce Evans 3e8b388271 Fixed marking of access time for special files and fifos (don't do
it if the file system is mounted noatime).  Not fixed: the access
time is marked at the start of a read() and not marked on successful
completion.  I think this should be handled at the vfs level.

Print a better panic message for missing vops.  Don't use printf()
before panic(), since the printf()ed part isn't shown by gdb.
This actually loses a little with the current gdb, since gdb just
prints the fmt arg to panic, so %'s aren't expanded.  gdb should
fetch the full message from the message buffer if possible.

Fixed default vop function for vop_getpages_desc.  It needs to
just return EOPNOTSUPP so that the vnode pager can get the pages
in using a general method.  Panicing broke exec'ing of files on
ext2fs file systems.  ffs works because it doesn't use the default.

Fixed nearby style bugs.
1997-11-20 16:08:56 +00:00
Bruce Evans c5697b1f22 Removed an unused #include in the `#ifdef KERNEL' case.
Fixed a comment to match the code.  The code is still wrong
(ffs_checkoverlap() should be staticized and called from a
ddb command).
1997-11-18 15:10:38 +00:00
Poul-Henning Kamp 2c31072227 unifdef -UEXT2FS 1997-11-18 14:20:09 +00:00
Julian Elischer 65d748cf46 oops, fix left out semicolon in code I patched by hand. 1997-11-13 01:48:30 +00:00
Julian Elischer 52bf64c787 Reviewed by: hackers@freebsd.org in general
Obtained from: Whistle Communications tree

Add an option to the way UFS works dependent on the SUID bit of directories
This changes makes things a whole lot simpler on systems running as
fileservers for PCs and MACS. to enable the new code you must
1/ enable option SUIDDIR on the kernel.
2/ mount the filesystem with option suiddir.
hopefully this makes it difficult enough for people to
do this accidentally.
see the new chmod(2) man page for detailed info.
1997-11-13 00:28:51 +00:00
Julian Elischer b1f4a44b03 Reviewed by: various.
Ever since I first say the way the mount flags were used I've hated the
fact that modes, and events, internal and exported, and short-term
and long term flags are all thrown together. Finally it's annoyed me enough..
This patch to the entire FreeBSD tree adds a second mount flag word
to the mount struct. it is not exported to userspace. I have moved
some of the non exported flags over to this word. this means that we now
have 8 free bits in the mount flags. There are another two that might
well move over, but which I'm not sure about.
The only user visible change would have been in pstat -v, except
that davidg has disabled it anyhow.
I'd still like to move the state flags and the 'command' flags
apart from each other.. e.g. MNT_FORCE really doesn't have the
same semantics as MNT_RDONLY, but that's left  for another day.
1997-11-12 05:42:33 +00:00
Poul-Henning Kamp 4a11ca4e29 Remove a bunch of variables which were unused both in GENERIC and LINT.
Found by:	-Wunused
1997-11-07 08:53:44 +00:00
Poul-Henning Kamp cb226aaa62 Move the "retval" (3rd) parameter from all syscall functions and put
it in struct proc instead.

This fixes a boatload of compiler warning, and removes a lot of cruft
from the sources.

I have not removed the /*ARGSUSED*/, they will require some looking at.

libkvm, ps and other userland struct proc frobbing programs will need
recompiled.
1997-11-06 19:29:57 +00:00
Tor Egge 5f8dd62adf Move declaration of M_MFSNODE from mfs_vnops.c to mfsnode.h. 1997-11-01 20:40:14 +00:00
Tor Egge f97c4150dd Bring back mfs_reclaim(), which is used to reclaim the master vnode in MFS. 1997-11-01 20:19:44 +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
Bruce Evans 9405e2ed0c Forward declare precisely the structs that are actually used in this header. 1997-10-27 12:50:57 +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 04754a5a13 I belive this fixes MFS after I broke it. 1997-10-20 19:53:26 +00:00
John Dyson 933880dd6e This might fix the mfs_badop problem left over with the cool VFS fixes.
PHK should check this.
1997-10-19 01:36:49 +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 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 8a32f8a5d5 Staticize the ufs vnops member functions. 1997-10-16 11:59:09 +00:00
Poul-Henning Kamp 1ccb82ef21 Remove an overlapping variable I created in last round.
Don't do pointer subtraction on void *

Use VOP_STRATEGY instead of homegrown stuff.

Add an XXX warning for LFS freaks to ponder.
1997-10-16 11:58:30 +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 7d1f0a2825 Two more places where root filesystems were mounted, put them at the head of
the mount list  in case there is already  DEVFS present.
1997-10-16 08:16:34 +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
Bruce Evans ee57d34583 IN_HASHED goes in the in-core flags ip->i_flag, not in the on-disk flags
ip->i_flags.

Rev.1.18 completely broke ufs.  My root directory went away about 10
seconds after booting.  I think file system damage was null, since
IN_HASHED = 0x80 is not used in the disk flags (it would probably
be UF_SOMETHING if it were used).
1997-10-15 07:32:45 +00:00
Poul-Henning Kamp 072199cd57 Reset the flag right away, could catch a bogon someday. 1997-10-14 18:51:07 +00:00
Poul-Henning Kamp 40715905a7 I think my previous change may have opened a race conditio.
This patch does the same thing, with no change in semantics.
1997-10-14 18:46:48 +00:00
Poul-Henning Kamp 34a6a33036 ufs_ihashrem() should not be called from the UFS layer, but from the
lower layer (LFS/FFS/?) like the rest of the ihash functions.
Otherwise it is impossible to make a lower layer that doesn't use the
ihash facility.
1997-10-14 14:22:31 +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
Poul-Henning Kamp 2cfc47fbc8 Make ufs_reclaim free the underlying inode. 1997-10-10 18:18:13 +00:00
Poul-Henning Kamp 56b5da1c5e Use generic ufs_reclaim(). 1997-10-10 18:17:42 +00:00
Poul-Henning Kamp 0be6b890f9 Add type arg to ffs_mountfs and avoid examining v_tag to find out
if MFS is getting a free ride.

Use generic ufs_reclaim().
1997-10-10 18:17:00 +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
Joerg Wunsch 6cce995019 Make MFS a supported option, finally. 1997-09-22 21:24:03 +00:00
Justin T. Gibbs 14d9217731 Convert tqdisksort to bufqdisksort. Honor the B_ORDERED buffer flag
so that meta-data writes go out to the device in the right order.
1997-09-21 22:10:49 +00:00
Justin T. Gibbs b686da5d68 Update for new buffer queue data structure. 1997-09-21 22:10:02 +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
Poul-Henning Kamp ec1d10e413 [Regarding the previous patch] This is completely wrong.
1. ffs_alloc() actually allowed writing one block less one frag (normally
   7 frags or 7/8 blocks) beyond the limit.
2. freebufspace() gives the free space in frags, but `size' is in bytes,
   so the change results in approximately `size' fragments too many being
   reserved.
3. ffs_realloccg() has the same bug but wasn't changed.

PR:		3398
Submitted by:	bde
Eyeballed by:	phk
1997-09-19 11:13:16 +00:00
Poul-Henning Kamp 6772045776 Ffs_alloc allow users to write one block beyond the limit.
PR:		3398
Reviewed by:	phk
Submitted by:	Wolfram Schneider <wosch@apfel.de>
1997-09-18 18:07:45 +00:00