Commit Graph

242 Commits

Author SHA1 Message Date
jdolecek 5f5971e8b7 Use 'X' constants in the conversion arrays instead of hexadecimal numbers,
to improve readability. No functionality change (values tested to be equal).
2002-01-08 20:44:13 +00:00
jdolecek 163a8c2246 make compilable with MSDOSFS_DEBUG (again), supply missing \n in
msdosfs_inactive() printf
2002-01-08 20:11:00 +00:00
augustss 7b38035ee9 Add some minimal validation of the fsinfo. 2001-12-22 19:45:54 +00:00
chs 9958c29316 VOP_PUTPAGES() requires page-aligned offsets, so be sure to provide such.
fixes PR 14759.

(while I'm here, call VOP_PUTPAGES() directly instead of indirecting through
the UVM pager op vector.)
2001-11-30 07:05:53 +00:00
lukem cd13721ca0 add RCSIDs 2001-11-10 13:22:20 +00:00
simonb 9b90ed2100 Remove some variables that are set but never used. 2001-11-06 07:18:14 +00:00
augustss 069ab256ae Don't generate an error if setting the gid/uid doesn't actually change
the gid/uid.  Among other things, this eliminates tons of warnings when
unpacking a tar file in an msdos fs.
2001-11-03 23:49:58 +00:00
jdolecek 787ee522f9 Ignore windows-style FAT directory entries if we don't expect any more
file name data and the entry starts with \0\0. Apparently this happens
occasionally, don't know if it's mtools (probably), MS Windows or
NetBSD msdosfs fault. When this happens, NetBSD msdosfs was not
able to open the file, where neither mtools nor MS Windows had any
problem with it. So, it's appropriate to add this fix in any case.
2001-11-03 14:53:37 +00:00
chs da3f862846 typo in previous. 2001-09-22 22:20:00 +00:00
chs 5148b779c3 check early for reads past EOF. 2001-09-22 22:14:29 +00:00
chs 64c6d1d2dc a whole bunch of changes to improve performance and robustness under load:
- remove special treatment of pager_map mappings in pmaps.  this is
   required now, since I've removed the globals that expose the address range.
   pager_map now uses pmap_kenter_pa() instead of pmap_enter(), so there's
   no longer any need to special-case it.
 - eliminate struct uvm_vnode by moving its fields into struct vnode.
 - rewrite the pageout path.  the pager is now responsible for handling the
   high-level requests instead of only getting control after a bunch of work
   has already been done on its behalf.  this will allow us to UBCify LFS,
   which needs tighter control over its pages than other filesystems do.
   writing a page to disk no longer requires making it read-only, which
   allows us to write wired pages without causing all kinds of havoc.
 - use a new PG_PAGEOUT flag to indicate that a page should be freed
   on behalf of the pagedaemon when it's unlocked.  this flag is very similar
   to PG_RELEASED, but unlike PG_RELEASED, PG_PAGEOUT can be cleared if the
   pageout fails due to eg. an indirect-block buffer being locked.
   this allows us to remove the "version" field from struct vm_page,
   and together with shrinking "loan_count" from 32 bits to 16,
   struct vm_page is now 4 bytes smaller.
 - no longer use PG_RELEASED for swap-backed pages.  if the page is busy
   because it's being paged out, we can't release the swap slot to be
   reallocated until that write is complete, but unlike with vnodes we
   don't keep a count of in-progress writes so there's no good way to
   know when the write is done.  instead, when we need to free a busy
   swap-backed page, just sleep until we can get it busy ourselves.
 - implement a fast-path for extending writes which allows us to avoid
   zeroing new pages.  this substantially reduces cpu usage.
 - encapsulate the data used by the genfs code in a struct genfs_node,
   which must be the first element of the filesystem-specific vnode data
   for filesystems which use genfs_{get,put}pages().
 - eliminate many of the UVM pagerops, since they aren't needed anymore
   now that the pager "put" operation is a higher-level operation.
 - enhance the genfs code to allow NFS to use the genfs_{get,put}pages
   instead of a modified copy.
 - clean up struct vnode by removing all the fields that used to be used by
   the vfs_cluster.c code (which we don't use anymore with UBC).
 - remove kmem_object and mb_object since they were useless.
   instead of allocating pages to these objects, we now just allocate
   pages with no object.  such pages are mapped in the kernel until they
   are freed, so we can use the mapping to find the page to free it.
   this allows us to remove splvm() protection in several places.

The sum of all these changes improves write throughput on my
decstation 5000/200 to within 1% of the rate of NetBSD 1.5
and reduces the elapsed time for "make release" of a NetBSD 1.5
source tree on my 128MB pc to 10% less than a 1.5 kernel took.
2001-09-15 20:36:31 +00:00
chs adf5d360a7 add a new VFS op, vfs_reinit, which is called when desiredvnodes is
adjusted via sysctl.  file systems that have hash tables which are
sized based on the value of this variable now resize those hash tables
using the new value.  the max number of FFS softdeps is also recalculated.

convert various file systems to use the <sys/queue.h> macros for
their hash tables.
2001-09-15 16:12:54 +00:00
wiz 251b3464be heirarchy -> hierarchy 2001-08-24 10:24:45 +00:00
wiz a9356936b4 seperate -> separate 2001-07-22 13:33:58 +00:00
assar cb2d5b58af remove support for creating files and directories from msdosfs_mknod 2001-07-19 19:12:33 +00:00
wiz 2a8c778f1b retrieve, not retreive 2001-06-12 14:59:27 +00:00
mrg c13e3a6693 use _KERNEL_OPT 2001-05-30 11:40:35 +00:00
chs 45701591c6 add a genfs_mmap() and change all of the disk-based filesystems
to implement VOP_MMAP() with the genfs version, in preparation for
actually using this VOP.
2001-05-28 02:50:51 +00:00
chs 060e70db41 min() -> MIN(), max() -> MAX().
fixes more problems with file offsets > 4GB.
2001-02-27 04:37:44 +00:00
chs 5e3caa8b52 skip truncating a file to 0 before freeing it if it's already zero-length. 2001-02-18 20:17:04 +00:00
tsutsui ec8b1c000e Fix nested extern declaration of prtactive. 2001-02-07 12:40:43 +00:00
jdolecek d9466585b7 make filesystem vnodeop, specop, fifoop and vnodeopv_* arrays const 2001-01-22 12:17:35 +00:00
jdolecek 34c8ae80da constify 2001-01-18 20:28:15 +00:00
chs 5c68a1518a zero the pages for newly allocated clusters in deextend() after we
notify UVM of the file's new size rather than in extendfile().
fixes PR 11852.
2001-01-01 00:25:41 +00:00
chs 3a5e4f901b in *_sync(), don't skip vnodes which have (potentially dirty) pages. 2000-12-10 19:36:31 +00:00
fvdl ff72f95eaa Initialize 'frcn' to 0 in extendfile to be safe. 2000-12-04 11:54:39 +00:00
chs aeda8d3b77 Initial integration of the Unified Buffer Cache project. 2000-11-27 08:39:39 +00:00
ad 642267bcc7 Update for hashinit() change. 2000-11-08 14:28:12 +00:00
fvdl db4108490a Adapt for VOP_FSYNC parameter change. 2000-09-19 22:01:59 +00:00
jdolecek bd462d0988 fix one of debug printfs to print dosfilename correctly, and include
a newline
2000-08-11 19:41:58 +00:00
jdolecek 898d0d5e1c simplify 2000-08-06 20:11:31 +00:00
thorpej 7cc27a88c0 Convert namei pathname buffer allocation to use the pool allocator. 2000-08-03 20:41:05 +00:00
thorpej a07f6460c8 MALLOC()/FREE() are not to be used for variable sized allocations. 2000-08-03 00:54:23 +00:00
jdolecek 057458abac msdosfs_getattr(): do not report archived files (those with ATTR_ARCHIVE unset)
as having flag SF_ARCHIVED on; this is wrong for directories, which don't
have any mode flags on msdosfs, so it's always treated as archived,
which leads to problems described in pr #8439. The semantics of the
archive flag differs between Unix and msdos/windoze, so it's better
to not set the flag at all even for regular files, to avoid surprises.

This fixes bin/8439 by Thomas Klausner.
2000-07-30 20:16:48 +00:00
jdolecek ee0bf49189 msdosfs_setattr(): silently ignore uid/gid changes, instead
of returning EINVAL
This fixes bin/9990 by Thomas Klausner.
2000-07-25 22:15:00 +00:00
jdolecek 61253f1dc8 msdosfs_rename(): fix too many vrele()'s of fdvp in some error cases;
bug and fix found on OpenBSD, though the fix is implemented very
differently here - we avoid changing correct code and only touch
what needs touching

This solves kern/10312 by Martin J. Laubach.
2000-07-25 20:56:10 +00:00
jdolecek b0fb24279c change the lf_advlock() arguments from
int     lf_advlock __P((struct lockf **,
           off_t, caddr_t, int, struct flock *, int));
to

int     lf_advlock __P((struct vop_advlock_args *, struct lockf **, off_t));

This matches common usage and is also compatible with similar change
in FreeBSD (though they use u_quad_t as last arg).
2000-07-22 15:26:11 +00:00
mrg bcc4078e32 remove include of <vm/vm.h> 2000-06-28 02:49:15 +00:00
mycroft 4656dfd24f Add a new function to remove extra buffers when truncating a file. This is
more generic than the vinvalbuf(V_SAVEMETA) case, avoiding synchronous
operations when truncating to a non-zero length.
2000-05-28 04:13:56 +00:00
perseant f0728fdce1 Change the sementics of the last parameter from a boolean ("waitfor") to
a set of flags ("flags").  Two flags are defined, UPDATE_WAIT and
UPDATE_DIROP.

Under the old semantics, VOP_UPDATE would block if waitfor were set,
under the assumption that directory operations should be done
synchronously.  At least LFS and FFS+softdep do not make this
assumption; FFS+softdep got around the problem by enclosing all relevant
calls to VOP_UPDATE in a "if(!DOINGSOFTDEP(vp))", while LFS simply
ignored waitfor, one of the reasons why NFS-serving an LFS filesystem
did not work properly.

Under the new semantics, the UPDATE_DIROP flag is a hint to the
fs-specific update routine that the call comes from a dirop routine, and
should be wait for, or not, accordingly.

Closes PR#8996.
2000-05-13 23:43:06 +00:00
cgd db4b935691 passs FAT block mask as argument to MSDOSFSEOF(), so that fat.h is
more useful.
2000-05-13 06:04:41 +00:00
jdolecek 40d9f8a709 msdosfs_read(): avoid integer overflow for files > 2GB, when
difference between current read position and file size
	is bigger than 2GB

This fixes problem first noted in FreeBSD PR#15639 and sent
by Martin J. Laubach in kern/9046, though the implementation
differs a bit.
2000-04-22 22:45:37 +00:00
jdolecek 2deec9c018 add a comment regarding FATMIRROR bit usage and restructure the code
slighly to make the check more explicit
2000-04-03 18:12:12 +00:00
augustss f0f9fcbe61 Remove register declarations. 2000-03-30 12:23:20 +00:00
simonb f09bb94537 Delete redunctant decls of msdosfs_{mount,start,unmount,root,quotactl,
statfs,sync,fhtovp,checkexp,vptofh}() - they're local to msdosfs_vfsops.c.

XXX: These should be static in msdosfs_vfsops.c - another day...
2000-03-30 02:29:46 +00:00
simonb f80823211a Delete redundant decl of rootvp - it's in <sys/systm.h>. 2000-03-30 02:27:35 +00:00
jdolecek 07fd899a7f Add new CLUST_END and use it as parameter to pcbmap() when searching
for end cluster, instead of explicitly passing 0xffff. This fixes potential
problem for FAT32, where cluster number may be legally bigger than 0xffff.

Also change clusteralloc() so that fillwith is not explicitly passed by caller
anymore (there is no need to use anything other than CLUST_EOFE).

Reviewed by: Wolfgang Solfrank
2000-03-27 17:40:26 +00:00
jdolecek b68ecd89bc one more 2000-03-27 10:15:13 +00:00
jdolecek 6b551ba751 one less - async mode support implemented 2000-03-27 09:45:38 +00:00
jdolecek 1d246008e0 Support async option by using delayed writes for metadata when mounted
with async. This increases the speed of my extract-archive test by about
20% on floppy, 10% on ZIP. "You've got the rope."
2000-03-27 09:44:45 +00:00