Commit Graph

521 Commits

Author SHA1 Message Date
xtraeme
729d0a0184 Apply patch from PR kern/34583 sent by Rhialto, quoting him:
"Add a 3rd entry in the cache, which keeps the end position
 from just before extending a file.
 This has the desired effect of keeping the write speed constant."

And yes, that helps a lot copying large files... always at full speed
now. This closes my PR kern/30868 "Poor performance copying large files
on msdosfs".

Also remove a 2 if-statements testing the same condition, combine them.

All that from Rhialto, thank you very much.
2006-09-22 17:45:21 +00:00
reinoud
ce2c68fd18 Make VOP_LOOKUP's O(1) instead of O(n log(n)) giving a speedup of 7500% on
a 1400 file directory.
2006-09-19 23:59:16 +00:00
reinoud
4911612931 Fix serious file-corruption issue on sparable partitions. 2006-09-19 22:00:38 +00:00
reinoud
49ec3b4779 Fix panic when the sparable table didn't read in correctly. 2006-09-19 15:34:23 +00:00
christos
e15ade632a Avoid empty if. 2006-09-13 00:54:00 +00:00
reinoud
0f0ed58759 Fix copying too much space from a small buffer. The chances of it actually
happening are small but corrupt media could trigger it.
2006-09-05 22:30:52 +00:00
reinoud
6014bf8aa0 Fix locking scheme in udf_mount() to follow more the other filingsystems.
For yet unknown reasons passing the LOCKLEAF flag to namei() did return a
locked vnode as was meant but would panic when a raw device was passed.
2006-09-05 17:03:04 +00:00
christos
61f2f34223 add missing initializers 2006-09-03 21:29:37 +00:00
christos
2e139ee910 add missing initializers 2006-09-03 07:08:59 +00:00
christos
644f53e4e9 add missing initializers 2006-09-03 06:51:04 +00:00
christos
ce2bae8870 comment out empty code 2006-09-03 06:49:30 +00:00
christos
94de7229ef use c99 initializers 2006-09-03 06:48:26 +00:00
christos
9c03e39ea2 add missing initializer 2006-09-03 05:27:28 +00:00
christos
309d51fb22 add missing initializers 2006-09-03 04:56:33 +00:00
christos
88112b2ad5 add missing initializers 2006-09-02 07:30:30 +00:00
christos
66f851cf96 add missing initializers 2006-09-02 07:12:11 +00:00
reinoud
037fe176f0 Add shortcut for struct long_ad 's Unique ID hint that covers the lower 32
bits of the targeted files 64 bits Unique ID for recovery purposes.
2006-08-31 21:38:14 +00:00
christos
eef4aaba6b Fix getdirentries() issue from FreeBSD PR - 78953 Quoting from that:
If you perform this request on a directory with exactly 50 files
(plus '.' and '..' which brings the total to 52 objects), the first
reply for the SMB server completely satisfies the query (server
side is Windows 2000 Professional).

The smbfs client then performs a TRANS2_FIND_NEXT2 using the last
file name as the resume key.  The response returns a SearchCount
of zero (ctx->f_ecnt == 0) and an EndOfSearch code of zero.

Any attempt to get more entries with calls to TRANS2_FIND_NEXT2
result in Badfid (bad file descriptor).  I suspect the return of
SearchCount of zero means that end-of-search has been reached and
the Sid is now closed.

The solution is to set "SMB_RDD_EOF | SMB_RDD_NOCLOSE" after getting
back a zero SearchCount,  I've tested this in the field on a quite
a few systems, aggressively accessing Windows shares over smbfs
and it appears flawless.

I was initially concerned about the possibility of resource exhaustion
on the Windows server. I was afraid by not officially closing the
search, it would leave a resource hung-up and over time, exhaust
some sort of "open search table" limit.  I've since convinced myself
this is NOT the case.

Windows needs to be able to handle clients that come and go over
time.  If the search is not closed, Windows will close it if it
finds it needs more resources.  I've testing this on directory
searches descending into 10's of thousands of folders, with 100's
of thousands of files.
2006-08-28 15:56:56 +00:00
christos
e28a71d80a add missing initializers 2006-08-28 00:35:22 +00:00
christos
428665231e correct bogus loop test; used to be always true. 2006-08-28 00:28:51 +00:00
tsutsui
b5825ccf25 Change types from int8_t to char for arrays which store char names. 2006-08-26 14:04:55 +00:00
reinoud
5b2c16b797 Fix small though important errors in the Ecma-167 structure definitions. 2006-08-25 17:43:51 +00:00
reinoud
7915eb6468 Fix pool allocation/freeing problem for once and for all correctly. Since
it was initialised quite late due to its reliance on disc data the mount
process could have stopped before initialising and thus could panic again
only now for uninitialising an not initialised pool! *sigh*
2006-08-22 16:52:41 +00:00
reinoud
5223c4995c Make a better guess on VAT locations so discs that are semi-standard
formatted can be recognised. This also fixes the bug that prevented UDF to
mount an empty CD-R/DVD*R disc.
2006-08-21 23:52:19 +00:00
reinoud
445a215f26 Fix spurious panic when twice remounting a bad filingsystem. It then gets
the same memory block allocated as before and it bombs out on its
descriptor pool allready being initialised. It turns out that the pool was
not allways destroyed. This fix ought to clean it up whatever the cause of
the mishap that results in a reject.
2006-08-21 22:23:09 +00:00
gdt
7db024f8e7 When mounting an MSDOS fileysystem, do not require that bytes 252 and
253 of the superblock be zero.  Searching the net failed to find any
justification for checking these bytes; all available references say
that they are part of the boot code and not BOOTSIG2 and BOOTSIG3.

Modify the MSDOS 7.1 bootsector definition to have 420 bytes of boot
code and no BOOTSIG[23], rather than 418 bytes of boot code, to follow
available references and apparent Windows practice.  A test build
showed that these defines are not used other than in the check removed
by this commit.

Patch tested on netbsd-3, and enabled mounting of a 4 GB CF formatted
under Windows XP and then in a digital camera.  The CF was previously
unmountable.

Concept approved on tech-kern by christos@ and martin@.
2006-08-14 14:06:26 +00:00
reinoud
177a68d51b Fix comment; it stated a mimimum of 128 translations duh! a maximum it is! 2006-08-11 23:15:30 +00:00
reinoud
9e6b675112 Fix panic on badly or curruptly formatted discs due to an oddity in the
error handling chain.

If NetBSD 4.0 is allready branched at this time this ought to be pulled up.
2006-08-10 12:39:56 +00:00
reinoud
81e6c818c1 The local variable `index' seems shadowing an inbuild gcc variable (???)
when compiling from userland (kernel ok) so rename the variable to Index to
avoid the confusing warning.
2006-08-10 12:26:44 +00:00
ad
f474dceb13 Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
martin
a3b5baed42 Fix alignement problems for fhandle_t, exposed by gcc4.1.
While touching all vptofh/fhtovp functions, get rid of VFS_MAXFIDSIZ,
version the getfh(2) syscall and explicitly pass the size available in
the filehandle from userland.

Discussed on tech-kern, with lots of help from yamt (thanks!).
2006-07-13 12:00:24 +00:00
reinoud
b1b70c855b Fixing a bad case of walking/writing out of allocated space.... the
allocated space was 2048 bytes, but when adding 1024 to the variable
`unix_name' to split the allocated space in half it effectively starts just
OUTSIDE the allocated space. This ought to fix memory corruption bugs when
using UDF.

This is a routine to revisit one day.
2006-07-09 13:58:47 +00:00
martin
6bfe6be406 Make it compile on 64 bit machines 2006-07-06 21:55:06 +00:00
martin
931985243c Redo previous differently - just use time_second.
Pointed out by Frank Kardel.
2006-07-01 10:12:36 +00:00
martin
c627e877cf Make it compile post time-counter merge 2006-07-01 08:42:39 +00:00
tron
a0d2802c69 Make this compile again. 2006-06-20 09:17:14 +00:00
christos
18b73e414c Don't allocate too much stuff on the stack. 2006-06-20 03:22:12 +00:00
christos
0c1391f078 remove ; from }; 2006-06-12 00:20:21 +00:00
christos
06595cb85e stack polics: Don't allocate 4K on the stack.
remove ; from };
2006-06-12 00:18:06 +00:00
kardel
de4337ab21 merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
  time.tv_sec -> time_second
- struct timeval mono_time is gone
  mono_time.tv_sec -> time_uptime
- access to time via
	{get,}{micro,nano,bin}time()
	get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
  Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
  NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html
2006-06-07 22:33:33 +00:00
yamt
725fa55be5 hide more by ifdef _KERNEL. 2006-05-27 09:12:31 +00:00
yamt
fa971123c3 revive copyright notice for the code derived from libc/locale/utf2.c.
i've asked jdolecek@ about this, but got no reply.
2006-05-20 08:28:27 +00:00
yamt
ad696ab2dc don't try to dereference kauth_cred_t. 2006-05-15 12:51:21 +00:00
yamt
240883e159 include kauth.h for NOCRED. 2006-05-15 11:16:16 +00:00
christos
641b7ad824 More kauth fallout. 2006-05-15 01:29:02 +00:00
christos
fc6d984beb kauth fallout 2006-05-15 00:05:16 +00:00
elad
fc9422c9d9 integrate kauth. 2006-05-14 21:31:52 +00:00
he
355013fbd7 Don't use MALLOC_DECLARE() unless _KERNEL is defined.
Fixes build problem of usr.bin/fstat/ for vax.
2006-05-14 12:25:11 +00:00
mrg
e012cb30a7 quell GCC 4.1 uninitialised variable warnings.
XXX: we should audit the tree for which old ones are no longer needed
after getting the older compilers out of the tree..
2006-05-11 01:12:21 +00:00
mrg
79652075f7 ntfs_runtovrun takes u_int8_t * not caddr_t 2006-05-11 01:11:11 +00:00
christos
93f1cb3704 Do the count check after we process getargs. 2006-04-28 19:17:45 +00:00
snj
d97db3840b s/allready/already/ 2006-04-25 02:19:31 +00:00
christos
5da80a50f2 Coverity CID 1138: Add KASSERT before deref. 2006-04-15 04:06:03 +00:00
christos
4a420185b2 Coverity CID 1197: Add KASSERT before deref. 2006-04-15 04:02:40 +00:00
christos
daeb76efcb Coverity CID 1135: Add KASSERT before deref. 2006-04-15 04:01:41 +00:00
christos
2ce6f7c5c6 Coverity CID 1093: Fix NULL deref. 2006-04-15 03:59:23 +00:00
christos
03372c0db6 Coverity CID 1001: Avoid NULL deref. 2006-04-15 03:56:25 +00:00
christos
9e36ae3b49 Coverity CID 839: Add KASSERT before deref. 2006-04-15 02:58:12 +00:00
christos
f16f3462cc Coverity CID 838: Add KASSERT before deref. 2006-04-15 02:56:51 +00:00
christos
be213d0c34 Coverity CID 2503: Remove bogus uninitialized deref. 2006-04-15 02:55:06 +00:00
christos
ceeda7c0ed Coverity CID 721: Add KASSERT since error != 0 conditions all returned, and
ifdef out dead code.
2006-04-15 02:53:49 +00:00
christos
9071fc0f28 Coverity CID 2508: Initialize variable 2006-04-15 02:44:16 +00:00
christos
56ef669e31 Coverity CID 2863: Check for NULL before freeing. 2006-04-15 02:42:08 +00:00
christos
41d5f0d550 Coveriry CID 733: Remove dead code. 2006-04-14 22:05:07 +00:00
christos
1c2c11fc00 Remove dead code. 2006-04-14 22:03:18 +00:00
christos
986cf947f1 Coverity CID 715: Remove dead code. 2006-04-14 22:00:14 +00:00
christos
5cf38f035b Strip the chrooted portion of the path from the reported pty path. Reported
and tested by Lasse Kliemann. Thanks!
2006-04-13 17:44:24 +00:00
xtraeme
0998485b9d make this build again (initiliaze ntmp). 2006-04-11 16:57:47 +00:00
christos
139332cff1 Coverity CID 2860: Free malloced resources on mount error. 2006-04-11 14:12:53 +00:00
riz
9f6ad5fff1 Swap the order of the tf_gen and tf_id members of struct tmpfs_fid,
since tf_id needs 8-byte alignment on some architectures (like amd64).
struct tmpfs_fid now fits in 16 bytes on amd64 again.
OK matt@
2006-03-31 20:27:49 +00:00
martin
625f1bbe61 Restrict generation numbers to 32bit values - we would have had to bump
_VFS_MAXFIDSZ to 24 otherwise for 64bit archs.
2006-03-26 20:18:58 +00:00
christos
f8912e4424 PR/32986: Kouichirou Hiratsuka: Don't proceed with unmounting the filesystem
if vflush failed. Thank to Jeff Ito for adopting a similar fix from FreeBSD.
2006-03-20 19:54:15 +00:00
christos
5a57baa413 don't use MALLOC with a non-constant size; use malloc instead. 2006-03-17 23:29:07 +00:00
christos
bd047b110f remove trailing newlines 2006-03-05 16:55:44 +00:00
yamt
ec5a93183a merge yamt-uio_vmspace branch.
- use vmspace rather than proc or lwp where appropriate.
  the latter is more natural to specify an address space.
  (and less likely to be abused for random purposes.)
- fix a swdmover race.
2006-03-01 12:38:10 +00:00
wiz
5d1e8b2745 Fix some typos. 2006-02-25 02:28:55 +00:00
thorpej
58853410ae Use device_class() instead of accessing dv_class directly. 2006-02-21 04:32:38 +00:00
christos
61315901b1 PR/31850: Geoff Wing: tmpfs does not honor sticky directories. 2006-02-21 03:19:45 +00:00
perry
fbae48b901 Change "inline" back to "__inline" in .h files -- C99 is still too
new, and some apps compile things in C89 mode. C89 keywords stay.

As per core@.
2006-02-16 20:17:12 +00:00
jmmv
064fbe7e18 Do not use unnamed structures/unions without instances; they break the
build under vax because of gcc 2.95.  Found by he@.
2006-02-16 14:57:50 +00:00
christos
6547cf74f3 make the include files usable from userland. 2006-02-10 16:00:02 +00:00
reinoud
979954f179 VND and harddiscs have their own defect free space management. 2006-02-04 23:21:43 +00:00
reinoud
8c7d758cbc Change a comment into a TODO and fix up case where we could return an
illegal allready-freed memory space.
2006-02-04 21:29:11 +00:00
christos
d3ef798d46 protect the whole file, not parts of it. 2006-02-02 21:58:40 +00:00
reinoud
6ee0cb5d5d Replace reinclude protection names with less generic versions. 2006-02-02 16:14:26 +00:00
reinoud
73bc73c9ad De __P() prototypes. 2006-02-02 15:57:35 +00:00
reinoud
14ab2cc9e6 Fix header re-inclusion protection defines to a less generic naming
scheme.
2006-02-02 15:52:23 +00:00
reinoud
aba87fd86c Fix $NetBSD$ tags. (sorry) 2006-02-02 15:38:35 +00:00
reinoud
09457a8a6e Initial import of a UDF file system implementation for NetBSD.
Finally the logic glue and the set distribution lists modifications.
2006-02-02 15:26:32 +00:00
reinoud
cff5e7ad2c Initial import of a UDF file system implementation for NetBSD.
The code supports read access to all media types that CD/DVD type drives
can recognize including DVD-RAM and BD- drives as well as harddisc partions
and vnd devices. UDF versions upto the latest 2.60 are to be supported
though due to lack of test media version 2.50 and 2.60 are not implemented
yet though easy to add. Both open and closed media are supported.

Write access is planned and in preparation. To facilitate this some hooks
are present in the code that are not strictly needed in a read-only
implementation but which allow writing to be added more easily.

Implemented and tested media types are CD-ROM, CD-R, CD-RW, CD-MRW,
DVD-ROM, DVD*R, DVD*RW, DVD+MRW but the same code can also read DVD-RAM,
HD-DVD and BluRay discs. Also vnd devices have been tested with several
sector sizes.

Discs created and written by UDFclient, Nero's InCD and Roxio's
DirectCD/Drag2Disc read fine.
2006-02-02 15:19:15 +00:00
jmmv
1aa1083c54 Cut a too long line introduced during the conversion to lwps. 2006-01-26 20:07:34 +00:00
tsutsui
7a10e95ea9 free() -> dealloc() for _STANDALONE. 2006-01-26 16:27:43 +00:00
christos
9c6e6ff8b2 Protect against uio_lwp being NULL from Pavel Cahyna 2006-01-14 23:49:59 +00:00
yamt
403fb83166 smbfs: use curlwp rather than uio->uio_lwp.
the latter is a garbage in the case of UIO_SYSSPACE.
PR/32499 from Juan RP.
2006-01-12 13:36:17 +00:00
wrstuden
160f564c51 Change union_unmount() to not play with the fs root vnode explicitly.
Let it get recycled along with all of the others. This is important
as if the root vnode has already been reclaimed, then we get a panic
when we try to vget it.

This addresses PR: kern/31382
2006-01-05 20:31:33 +00:00
tsutsui
1f5055228d Add preliminary support for System V Boot File System.
Written by UCHIYAMA Yasushi <uch@netbsd>.
2005-12-29 14:53:45 +00:00
chs
0545b6e0cb changes for making DIAGNOSTIC not change the kernel ABI:
- for structure fields that are conditionally present,
   make those fields always present.
 - for functions which are conditionally inline, make them never inline.
 - remove some other functions which are conditionally defined but
   don't actually do anything anymore.
 - make a lock-debugging function conditional on only LOCKDEBUG.

as discussed on tech-kern some time back.
2005-12-27 04:06:45 +00:00
perry
0f0296d88a Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 20:45:08 +00:00
jmmv
f37f56be99 Remove a conditional by always using inlined functions in favour of macros.
This way, the code is clearer and there shouldn't be any performance
difference (if the compiler DTRT).  Suggested by chs@.
2005-12-24 12:31:57 +00:00
christos
95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
yamt
1fa8bcda47 VFS_TO_TMPFS: remove a wrong assertion.
it's wrong because TMPFS_PAGES_MAX can be decreased.
2005-12-06 21:46:34 +00:00
christos
aa1c65555d protect against multiple inclusion instead of forbidding their access from
userland, and #ifdef _KERNEL all their kernel functions.
2005-12-03 22:16:16 +00:00
christos
4bffed72de - protect userland exported files against multiple inclusion.
- make sure that kernel only files don't compile in userland using #error
- XXX: some kernel only files still get installed.
- XXX: some files used in userland, don't get installed.
2005-12-03 17:34:43 +00:00
yamt
221616873d merge yamt-readahead branch. 2005-11-29 22:52:02 +00:00
dan
3a01b7a8ba take into account memory used for file cache pages, and wired pages,
when calculating potential free space
2005-11-28 22:28:36 +00:00
dan
cbba09ed4d simplify calculation of free swap space using uvm-exported statistics,
with thanks to yamt@ for useful hints.
2005-11-28 22:06:20 +00:00
yamt
6a17dd42f4 - ignore truncation for VCHR/VBLK/VFIFO as it used to be
before yamt-vop merge.  PR/32049 from Atsushi Onoe.
- reject setattr which attempts to change size of VLNK/VSOCK.
2005-11-11 15:50:57 +00:00
yamt
807ce4c6fc tmpfs_reg_resize: drop swap slots on truncation.
fix a problem pointed by jmmv@.
2005-11-08 23:04:03 +00:00
christos
fe1de4d6e3 PR/32003: Brian Buhrow: msdosfs doesn't properly zero out high cluster data
on non-FAT32 msdos filesystems.
2005-11-04 21:04:20 +00:00
yamt
a748ea88dd merge yamt-vop branch. remove following VOPs.
VOP_BLKATOFF
	VOP_VALLOC
	VOP_BALLOC
	VOP_REALLOCBLKS
	VOP_VFREE
	VOP_TRUNCATE
	VOP_UPDATE
2005-11-02 12:38:58 +00:00
dyoung
ba91bb71cf Bug fix: correct the sense of an if-condition in tmpfs_spec_close:
because VOP_UPDATE() usually succeeded, spec_close() was not usually
called.  Only skip the spec_close() step if VOP_UPDATE() returns
an error result.  Now /dev/watchdog works as expected when /dev/
is a tmpfs; previously, it was impossible to disarm a user-tickled
watchdog.
2005-11-02 05:41:50 +00:00
dyoung
b441f8100f Bug fix: change tmpfs_spec_bwrite from tmpfs_bwrite to vn_bwrite,
per yamt's suggestion.  Previously, if /dev/ was mounted on a tmpfs,
block device buffers were never flushed to disk.  Trying to unmount
a dirty filesystem (umount /dev/wd0e, say) caused an endless stream
of vflushbuf warnings, because tmpfs_bwrite was not flushing buffers.
The fix told to me by yamt solves the problem.
2005-11-02 05:39:16 +00:00
christos
f229ea7f53 make debugging code compile after 64 bit inode changes. 2005-10-23 04:28:53 +00:00
simonb
30ab8089df Update the mod and access times directly from ptyfs_read() and
ptyfs_write() rather than setting a flag and updating these times
through ptyfs_itimes() at some indeterminate time in the future.
However, just use the "time" variable to set the times instead of
using a potentially expensive call to nanotime().  A HZ resolution
on these timestamps is more than enough.

(Possibly incomplete) fix for PR kern/31430.
OK'd be christos@.
2005-10-12 15:23:33 +00:00
jmmv
ab7e099bbc Follow symlinks during lookup (i.e., don't stop too early) so that symlinks
to directories work as expected.  Diagnosed by Greg Oster.
2005-10-03 19:36:42 +00:00
christos
39e9173002 use a counter to prevent from mounting ptyfs twice. Using save_ptm is not
good enough, because if we don't have COMPAT_BSDPTY, then it will stay NULL.
2005-10-01 05:30:12 +00:00
jmmv
38c8dceb4b Explicitly initialize the tn_lockf field. I expect problems in some
situations otherwise...
2005-09-30 14:29:19 +00:00
dyoung
3d52cdeb53 In cd9660_mount, initialize imp to VFSTOISOFS(mp) instead of NULL.
Remove redundant assignments to imp.  This fixes the page fault
panic when the kernel mounts an ISO9660 filesystem, introduced at
revision 1.27.
2005-09-30 08:15:46 +00:00
jmmv
b6d141c71c Implement the tmpfs_advlock operation. Makes "user-level" file locking
work (aka lockf(3)).
2005-09-29 19:48:21 +00:00
christos
3888bec411 Move the duplicate mount check sooner, and fix a leak. 2005-09-29 14:45:56 +00:00
yamt
5ce7d98710 tmpfs_getattr: return up-to-date timestamps. 2005-09-28 23:42:14 +00:00
jmmv
24d12cb7e6 Some style fixes in comments. 2005-09-27 20:35:33 +00:00
jmmv
90260ab291 Handle too big numbers given in the max size argument. 2005-09-26 09:50:08 +00:00
yamt
58e607b974 tmpfs_rename: fix lock/unlock mismatch. 2005-09-26 00:46:59 +00:00
jmmv
9ba32cead7 Follow compat naming tradition: rename compat_export_args to export_args30. 2005-09-25 21:17:05 +00:00
jmmv
c690718c37 Only consider valid flags in the root mode's parameter given by the user.
I doubt the unchecked value could bring us problems, but better to be safe
than sorry.
2005-09-25 16:34:42 +00:00
jmmv
b35a89f13c Sanity check negative values in the maximum size and number of nodes
arguments to avoid a crash while mounting a tmpfs file system.  Add a
regression test for this too.  Noticed by chs@.
2005-09-25 16:28:43 +00:00
jmmv
e230b755b3 Synchronize NFS status with reality. After yamt@ changes (I think with the
implementation of getpages and putpages and the use of UBC in the read and
write operations), the worst problem has gone away which was a panic when
a file's contents were modified in the original file system and then read
through the NFS mount point.

Also remove the entry about optimization.  While tmpfs still has room for
improvement, it has become a lot better lately, thanks to the string pools
and the changes yamt@ did in the anonymous objects handling.
2005-09-23 21:39:29 +00:00
wiz
c31c860ef5 Fix typo, add missing parenthesis. 2005-09-23 20:46:18 +00:00
jmmv
b0085cab71 Kill the tmpfs(9) manual page; it was just documenting internal details of
tmpfs' "API" and was already rotting.

Instead, merge all the relevant comments into the code.  This includes
acknowledgements to Google's Summer of Code 2005 program (they were in the
AUTHORS section of tmpfs(9) before), so all the files need to be changed
to include this sentence alongside the title.  (Note that this was not a
requirement of the program.)
2005-09-23 15:36:15 +00:00
jmmv
f63b58d19d Lock the source directory during the rename operation so that we are safe
to modify it (I hope this is the correct way to go).  Avoids triggering an
assertion in the tmpfs_dir_detach function, shown by the t_rename
regression test.
2005-09-23 14:27:55 +00:00
jmmv
8d09f0278b Start inode numbers on 2 to mimic UFS tradition (and to avoid problems if
some utility relies on this).
2005-09-23 13:59:16 +00:00
jmmv
2a3e5eeb7c Apply the NFS exports list rototill patch:
- Remove all NFS related stuff from file system specific code.
- Drop the vfs_checkexp hook and generalize it in the new nfs_check_export
  function, thus removing redundancy from all file systems.
- Move all NFS export-related stuff from kern/vfs_subr.c to the new
  file sys/nfs/nfs_export.c.  The former was becoming large and its code
  is always compiled, regardless of the build options.  Using the latter,
  the code is only compiled in when NFSSERVER is enabled.  While doing this,
  also make some functions in nfs_subs.c conditional to NFSSERVER.
- Add a new command in nfssvc(2), called NFSSVC_SETEXPORTSLIST, that takes a
  path and a set of export entries.  At the moment it can only clear the
  exports list or append entries, one by one, but it is done in a way that
  allows setting the whole set of entries atomically in the future (see the
  comment in mountd_set_exports_list or in doc/TODO).
- Change mountd(8) to use the nfssvc(2) system call instead of mount(2) so
  that it becomes file system agnostic.  In fact, all this whole thing was
  done to remove a 'XXX' block from this utility!
- Change the mount*, newfs and fsck* userland utilities to not deal with NFS
  exports initialization; done internally by the kernel when initializing
  the NFS support for each file system.
- Implement an interface for VFS (called VFS hooks) so that several kernel
  subsystems can run arbitrary code upon receipt of specific VFS events.
  At the moment, this only provides support for unmount and is used to
  destroy NFS exports lists from the file systems being unmounted, though it
  has room for extension.

Thanks go to yamt@, chs@, thorpej@, wrstuden@ and others for their comments
and advice in the development of this patch.
2005-09-23 12:10:31 +00:00
yamt
bea9347034 fix buffer overrun for symbolic links. PR/31325. 2005-09-17 10:28:26 +00:00
yamt
db59142cb3 tmpfs_dir_getdotdotdent: correct fileid. 2005-09-16 00:18:48 +00:00
yamt
8e6209cffb change the way to handle directory "offsets" so that
they won't be changed when removing entries in the directory.
some applications like cvs rely on this.
2005-09-15 12:34:35 +00:00
yamt
20bb9654a2 tmpfs_getpages: don't create pages past eof. 2005-09-14 20:27:26 +00:00
soda
a74b7aeaeb mention what is the failure case, from FreeBSD revision 1.46 cvs log 2005-09-14 15:13:19 +00:00
christos
fe968d1756 PR/31312: Juan RP: Don't use negative cacheing on msdosfs, because of the
evil case preserving and case sensitive semantics. From FreeBSD.
2005-09-14 15:07:22 +00:00
yamt
7720dda14a tmpfs_read: handle requests past EOF. 2005-09-14 10:40:49 +00:00
jmmv
2ddaf8b92b Nodes cannot use the '0' identifier or they will be skipped by readdir.
E.g., the root node's '.' and '..' directory entries did not appear in
a directory list, because the root node always holds the first id.
2005-09-13 21:30:52 +00:00
jmmv
5f4b660e4e Adapt recent changes to the style of the rest of the file. 2005-09-13 20:02:05 +00:00
yamt
647aa77538 - don't waste/leak kva.
- implement getpages/putpages.  support mmap.
- eliminate meaningless memcpy.
- ubcify.
2005-09-13 14:29:18 +00:00
yamt
a7ca1cc6ef tmpfs_read: return EISDIR rather than EINVAL for non-VREG files.
XXX should we follow nfs, which uses EPERM?
2005-09-13 14:27:29 +00:00
yamt
1873c5428a tmpfs_link: always free pnbuf. 2005-09-13 12:11:27 +00:00
yamt
db9ffe1576 - don't keep a reference to a variable on stack.
- remove a meaningless assumption about the order of structure members.
2005-09-12 19:56:58 +00:00
yamt
ffb84f0f1b fix lock/unlock mismatch. XXX this is not a real fix. 2005-09-12 19:55:22 +00:00
christos
b9c29c4def convert to use it nanotime, but don't call it unless it is necessary. 2005-09-12 16:55:01 +00:00
christos
54705baa2e wrong variable name. 2005-09-12 16:54:35 +00:00
christos
c7d2653a66 use nanotime(). 2005-09-12 16:44:29 +00:00