Commit Graph

112 Commits

Author SHA1 Message Date
yamt 7d3142aa6a - introduce vfs_composefh() and use it where appropriate.
- fix lock/unlock mismatch in sys_getfh.
2006-06-17 07:06:50 +00:00
christos d13a9159e3 stack police: don't allocate statvfs on the stack. 2006-06-09 21:41:14 +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
elad fc9422c9d9 integrate kauth. 2006-05-14 21:31:52 +00:00
mrg 084c052803 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-10 21:53:14 +00:00
christos f540054634 Coverity CID 735: Remove duplicate code. 2006-04-15 01:58:44 +00:00
christos 4ea21306a7 Coverity CID 736: Comment out dead code. 2006-04-15 01:54:46 +00:00
christos d008757117 Coverity CID 1143: Prevent NULL deref. 2006-04-15 01:39:15 +00:00
christos 09436af99e Coverity CID 1144: Protect against NULL deref. 2006-04-15 01:37:46 +00:00
christos ff33272e7b Coverity CID 2510-2514: Always initialize cache. 2006-04-15 00:44:18 +00:00
martin d6d75eaf5d KASSERT that the returned file id length from VPTOFH is <= the
maximum allowed value (_VFS_MAXFIDSZ).
2006-03-27 20:20:45 +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
yamt a5da6cae5b remove a few unnecessary caddr_t casts. 2006-01-03 11:41:50 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
yamt 793a63d824 - remove a ufs dependency.
- bump readdir block size to 1024.  (the same value as userland DIRBLKSIZ)
2005-10-06 10:23:01 +00:00
jmmv 86e1067af8 Set va_type to VLNK before calling VOP_SYMLINK to match the change in the
vfs_syscalls.c file.  Pointed out by yamt@.
2005-09-06 09:36:28 +00:00
yamt b247716cf3 as we now have 64bit ino_t, no need to truncate nfsv3 fileids. 2005-08-19 12:47:23 +00:00
yamt 9cb572b112 nfsrv_mknod: reject device numbers which we can't handle. 2005-05-18 12:57:34 +00:00
perry bcfcddbac1 nuke trailing whitespace 2005-02-26 22:31:44 +00:00
yamt 8cd5f554ba nfsrv_commit: make cnt unsigned so that very large commit requests can be
handled properly.
2004-12-09 02:18:45 +00:00
yamt 2bc7120ab8 when calling create-type VOP, make sure that va_mode is set
even when a client doesn't specify it.
(most filesystems get confused if va_mode is VNOVAL.)
2004-12-09 01:48:22 +00:00
yamt f11ea18093 nfsrv_read: fall back to copying when fail to loan pages.
(i forgot to commit this with uvm_loan.c rev.1.51.)
2004-12-04 08:07:52 +00:00
skrll f7155e40f6 There's no need to pass a proc value when using UIO_SYSSPACE with
vn_rdwr(9) and uiomove(9).

OK'd by Jason Thorpe
2004-09-17 14:11:20 +00:00
yamt 7407c491c3 nfsrv_create: fix an LP64 problem for exclusive create. 2004-05-31 08:47:08 +00:00
christos 6bd1d6d4db Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
2004-04-21 01:05:31 +00:00
yamt 59afac32fe - get pages to loan out in uvm_loanuobjpages() rather than
having caller (nfsd, in this case) do so.
- tweak locking so that nfs loaned READ works on layered filesystems.
2004-01-07 12:17:10 +00:00
hannken 2ef662a69e Clean up the usage of vn_start_write(). At least one occurence clobbered
previous error conditions.
If "(flags & (V_WAIT|V_PCATCH)) == V_WAIT" the return value is always zero.
Ignore the return value in these cases.

From Darrin B. Jewell.
2003-11-05 10:18:38 +00:00
mycroft 3fbc866a6e Back out the bogus initializer -- the compiler bug is fixed. 2003-10-29 21:26:43 +00:00
cl b8d68ee313 note 'm68k {u,}int64_t used uninitialized' bug.
add reference to gcc bug report.
mark all (known) occurrences.
2003-10-28 02:01:46 +00:00
yamt f3f1661306 set READres EOF flag correctly. 2003-10-20 13:53:47 +00:00
hannken a3a898ff0f Add the gating of system calls that cause modifications to the underlying
file system.
The function vfs_write_suspend stops all new write operations to a file
system, allows any file system modifying system calls already in progress
to complete, then sync's the file system to disk and returns. The
function vfs_write_resume allows the suspended write operations to
complete.

From FreeBSD with slight modifications.

Approved by: Frank van der Linden <fvdl@netbsd.org>
2003-10-15 11:28:59 +00:00
agc aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
bouyer a678ebca13 nfsrv_commit(): return success and don't do anything for requests which starts
past the end of the file. This can happen when two clients are writting to
the same file.
Close PR 21696 by myself, discussed on tech-net in 2003/05 and 2003/06.
Issue raised by Chuck Silvers (commit and truncate ops needs to be serialised)
still unadressed.
2003-07-09 21:16:12 +00:00
fvdl d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
thorpej a06b275edc Undo part of the ktrace/lwp changes. In particular:
* Remove the "lwp *" argument that was added to vget().  Turns out
  that nothing actually used it!
* Remove the "lwp *" arguments that were added to VFS_ROOT(), VFS_VGET(),
  and VFS_FHTOVP(); all they did was pass it to vget() (which, as noted
  above, didn't use it).
* Remove all of the "lwp *" arguments to internal functions that were added
  just to appease the above.
2003-06-29 18:43:21 +00:00
darrenr 960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
yamt 9c329a66d1 rework zero padding of rpc reply.
- for READ procedure, don't send back more bytes than requested.
- don't have doubtful assumptions on mbuf chain structure.
- rename a function (nfsm_adj -> nfs_zeropad) to avoid confusion as
  the semantics of the function was changed.
2003-06-09 13:10:31 +00:00
yamt 85d0052723 workaround for UBC limit.
while our nfsd announces MAXBSIZE as wtmax for tcp,
VOP_GETPAGES of filesystems that uses genfs_getpages can't
handle >= MAX_READ_AHEAD(16) pages at once.
therefore, depending on PAGE_SIZE of the machine and file offset of
a read request, we can't VOP_GETPAGES the range at once.
2003-05-29 15:18:14 +00:00
yamt c573c77372 - indent.
- fix a comment typo (mus -> must)
- remove an unneeded caddr_t cast.
2003-05-07 13:10:44 +00:00
yamt 777190167d fix handling of the case that readsize == 0. 2003-05-04 11:40:22 +00:00
yamt ca9e55bd66 use uvm page loanout mechanism for nfsd READ procedure processing.
reviewed by Frank van der Linden and Chuck Silvers.
tested by Wojciech Puchar.
2003-05-03 18:36:26 +00:00
yamt d16c4c058f return rtmax bytes if we get READ requests larger than rtmax. 2003-04-03 15:19:12 +00:00
yamt a14f444335 use queue manipulation macros. 2003-04-02 15:14:19 +00:00
yamt 9fe1125599 reply FSINFO rtmax and wtmax for DGRAM properly. 2003-03-28 15:24:58 +00:00
yamt 2d45e41adb reply ENAMETOOLONG properly instead of discarding request as BADRPC.
my own PR20791.
2003-03-28 13:05:47 +00:00
matt 65e5548a17 Add MBUFTRACE kernel option.
Do a little mbuf rework while here.  Change all uses of MGET*(*, M_WAIT, *)
to m_get*(M_WAIT, *).  These are not performance critical and making them
call m_get saves considerable space.  Add m_clget analogue of MCLGET and
make corresponding change for M_WAIT uses.
Modify netinet, gem, fxp, tulip, nfs to support MBUFTRACE.
Begin to change netstat to use sysctl.
2003-02-26 06:31:08 +00:00
matt 9bd0cc2bb9 Make sure these all agree on the same definitons of various variables. 2002-12-01 23:02:10 +00:00
bouyer c7b51b5566 In nfs_commit(), sanity-check what we get from network: if we try to fluch
past end of file, or if off + cnt overflows a quad_t, flush to end of file.
2002-09-27 19:30:46 +00:00
bouyer 992abe6e5b In nfsrv_create(), kill an extra PNBUF_PUT() in the NFSv2 mknod case. The
pnbuf has already been freed by VOP_MKNOD. This should have been removed in
rev 1.60.
Should fix PR 18013, OK'd by fvdl.
2002-09-26 20:41:25 +00:00
bouyer 7005ca7253 nfsrv_commit(): Properly handle the case cnt == 0, which means "flush to
end of file". Calling VOP_FSYNC with start == end triggers a DIAGNOSTIC
check. Noticed with NFSv3 Linux clients. OK'd by fvdl.
2002-09-26 20:38:04 +00:00