Commit Graph

758 Commits

Author SHA1 Message Date
pk a7c40722d8 Call inittodr() from main(). Let file system code set the recorded `last
update' time (if any) through the new function setrootfstime().
2004-07-05 07:28:45 +00:00
yamt 21ae434eb2 nfs_lookup: use cache_lookup_raw() so that:
- "intrusive" dirops now have more chances to get benefits from dnlc.
- fixes a deadlock due to vnode locking order inversion.

nfs_create and others: purge stale dnlc entries
as nfs_lookup() no longer does it automatically.
2004-06-27 08:53:03 +00:00
jonathan 5249b5a2a5 Rename MBUFTRACE helper function m_claim() to m_claimm(),
for consistency with M_FREE() and m_freem().  Affected files:

sys/mbuf.h
kern/uipc_socket2.c
kern/uipc_mbuf.c
net/if_ethersubr.c
netatalk/ddp_input.c
nfs/nfs_socket.c
2004-06-24 04:15:50 +00:00
yamt 3e209dd94a nfs_lookup: maintain PDIRUNLOCK even in the case of success to make
layered filesystems happy.
2004-06-16 23:55:30 +00:00
yamt ad338b9eff nfs_searchdircache: fix a null dereference in the case that
offset!=0 and dircache hasn't been initialized yet.
2004-06-14 12:28:35 +00:00
yamt e3b58482fb nfs_doio_read: use np->n_rcred instead of curproc->p_ucred for VDIR.
XXX maybe it's better to use a cred passed by VOP_READDIR.
2004-06-11 12:26:31 +00:00
yamt 03db65e256 make sure that nfssvc sockets are zapped before being freed. 2004-06-10 12:59:57 +00:00
yamt b0ac3e4201 nfsrv_zapsock: fix an inverted condition in nfs_syscall.c rev.1.74. 2004-06-10 12:57:43 +00:00
yamt 7407c491c3 nfsrv_create: fix an LP64 problem for exclusive create. 2004-05-31 08:47:08 +00:00
yamt ee306471a7 remove an unused instance of VOP_UPDATE. 2004-05-27 12:55:07 +00:00
hannken 8c21bc6224 Add ffs internal snapshots. Written by Marshall Kirk McKusick for FreeBSD.
- Not enabled by default. Needs kernel option FFS_SNAPSHOT.
- Change parameters of ffs_blkfree.
- Let the copy-on-write functions return an error so spec_strategy
    may fail if the copy-on-write fails.
- Change genfs_*lock*() to use vp->v_vnlock instead of &vp->v_lock.
- Add flag B_METAONLY to VOP_BALLOC to return indirect block buffer.
- Add a function ffs_checkfreefile needed for snapshot creation.
- Add special handling of snapshot files:
    Snapshots may not be opened for writing and the attributes are read-only.
    Use the mtime as the time this snapshot was taken.
    Deny mtime updates for snapshot files.
- Add function transferlockers to transfer any waiting processes from
  one lock to another.
- Add vfsop VFS_SNAPSHOT to take a snapshot and make it accessible through
  a vnode.
- Add snapshot support to ls, fsck_ffs and dump.

Welcome to 2.0F.

Approved by: Jason R. Thorpe <thorpej@netbsd.org>
2004-05-25 14:54:55 +00:00
atatat 53c625655c Sysctl descriptions under vfs subtree 2004-05-25 04:44:43 +00:00
jonathan 20f923718e Change DIAGNOSTIC warning in nfs_send() about NULL rep->r_procp: the
warning is triggered pervasively, so print it only once per boot.
(The callers who pass NULL r_procps should soon be fixed to pass a
valid struct proc* ).
2004-05-24 19:08:07 +00:00
yamt 345a3c375d - for tcp, use SO_RCVTIMEO to recover from server crash.
otherwise we can be stuck in soreceive forever.
  the problem is pointed by Minoura Makoto.  PR/25662
- clear r_rexmit on reconnect and clear r_rtt and R_TIMING on retransmit
  so that the above (and soft mounts) happy.
2004-05-23 08:08:48 +00:00
christos 45fb41a2bd cut down another 7K by more NFS_V2_ONLY ifdefs. 2004-05-23 05:53:01 +00:00
jonathan 230fb9b8ab Eliminate several uses of `curproc' from the socket-layer code and from NFS.
Add a new explicit `struct proc *p' argument to socreate(), sosend().
Use that argument instead of curproc. Follow-on changes to pass that
argument to socreate(), sosend(), and (*so->so_send)() calls.
These changes reviewed and independently recoded  by Matt Thomas.

Changes to soreceive() and (*dom->dom_exernalize() from Matt Thomas:
pass soreceive()'s struct uio* uio->uio_procp to unp_externalize().
Eliminate curproc from unp_externalize.   Also, now soreceive() uses
its uio->uio_procp value, pass that same value downward to
((pr->pru_usrreq)() calls for consistency, instead of (struct proc * )0.

Similar changes in sys/nfs to eliminate (most) uses of curproc,
either via the req-> r_procp field of a struct nfsreq *req argument,
or by passing down new explicit struct proc * arguments.

Reviewed by: Matt Thomas, posted to tech-kern.
NB: The (*pr->pru_usrreq)() change should be tested on more (all!) protocols.
2004-05-22 22:52:13 +00:00
yamt 7a6774551d enable reply cache for connection oriented protocols as well.
linux retransmits rpcs even when using tcp.
2004-05-21 13:53:40 +00:00
yamt 92e4dbdd94 #if 0 out CREATE optimization for now because it has a problem in the case
of O_CREAT|O_TRUNC, which is hard to be fixed without changing upper layer.
2004-05-17 12:17:18 +00:00
yamt 8d2f96d0fc g/c unused NFS_*ALLOC defines. 2004-05-12 20:11:27 +00:00
yamt 75f99c3465 nfs_lookup: handle "." by ourselves as RFC1813 3.2 says. 2004-05-10 12:43:51 +00:00
yamt 2dd754b680 don't do kludge for a reply to a retransmitted request
unless we actually retransmitted the request.
2004-05-10 10:40:42 +00:00
yamt 1c1b12397d nfs_lookup: avoid CREATE optimization for DOTDOT.
creating a DOTDOT entry has no sense and will fail anyway.
2004-05-08 21:35:13 +00:00
yamt 48e8239c5a nfs_mkdir: handle the "." case. 2004-05-08 21:33:41 +00:00
yamt 2890b70316 nfs_lookitup: handle "." correctly rather than returning garbage on the stack. 2004-05-08 21:32:34 +00:00
yamt 52fedf49f0 check read only mount appropriately.
(fix a bug of nfs_vnops.c rev.1.192.)
pointed by Rob Quinn on current-users@.
2004-05-07 16:09:46 +00:00
yamt 2a85a8c4fd because nfsv3 has the same CREATE semantics as ours,
we don't have to issue LOOKUP RPCs beforehand.
2004-05-06 21:58:17 +00:00
drochner 264eb6a8ba remove duplicated snprintf(vci, ...) 2004-05-06 12:32:59 +00:00
matt adc905e2c4 Commons are not allowed in header files. extern it. 2004-05-01 06:16:42 +00:00
jrf fc97fd571a First pass for some caddr_t removal and changes to get rid of it where we
no longer use and/or need it

	- removed casts from unionfs, deadfs and fdesc
	  (there are more to hunt down still)
	- changed vfs_quotactl args argumet from caddr_t to void *
	- changed vfs_quotactl structures/callers to reflect the api change

Compiled fine and ran for about a day. Approved/reviewed by
christos@netbsd.org and gimpy@netbsd.org.
2004-04-27 17:37:30 +00:00
simonb b5d0e6bf06 Initialise (most) pools from a link set instead of explicit calls
to pool_init.  Untouched pools are ones that either in arch-specific
code, or aren't initialiased during initial system startup.

 Convert struct session, ucred and lockf to pools.
2004-04-25 16:42:40 +00:00
itojun d2f1c029b9 kill sprintf, use snprintf 2004-04-21 18:40:37 +00:00
christos baf95c5d08 use VFS_MAXFIDSZ 2004-04-21 02:22:49 +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 392d6f9af1 nfs_inactive: inactive the vp before doing sillyrename works.
vp can be reclaimed soon after it's unlocked.
2004-04-20 11:51:28 +00:00
yamt d1a0f61a77 nfs_readdirplusrpc: fix a deadlock problem.
don't wait for vnode lock to load attributes.
otherwise, because READDIRPLUS returns DOTDOT entry as well,
we violate locking order.
2004-04-05 10:44:09 +00:00
yamt a3a3d45be7 nfsm_mtofh: handle the case that filehandle is exist but fattr is not. 2004-04-05 10:41:45 +00:00
yamt 9ec3dce770 don't issue VOP_GETATTR blindly in nfs_nget().
in many cases, GETATTR RPCs here is redundant because the caller has
postop_attr.  instead, make sure the resulted vnode have a valid
attribute in nfs_lookup().
2004-04-05 10:40:56 +00:00
yamt 04e9fcc377 nfs_readdirplusrpc: purge existing namecache entry before entering a new one.
otherwise we'll get duplicated entries.
2004-04-05 10:36:32 +00:00
yamt 757220a432 when entering a namecache entry for nfs, ensure to update the appropriate
timestamp in the nfsnode so that we don't get namecache-miss when
looking up the node we just created.
2004-04-05 10:35:12 +00:00
yamt 0f33822b0b nfsm_wcc_data: update n_ctime and n_nctime if no one other than us
changed the file in the meantime so that we won't invalidate caches
unnecessarily due to our own activities.
2004-04-05 10:28:23 +00:00
yamt f2fb72c33f avoid unnecessary namecache purges in some places. 2004-04-05 10:27:11 +00:00
atatat 19af35fd0d Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.
2004-03-24 15:34:46 +00:00
yamt aefad8a7e8 nfs_getattrcache: deal with timer wraparound. 2004-03-19 13:53:28 +00:00
yamt 0f554e4324 comments on some nfsm_ macros. 2004-03-19 13:52:07 +00:00
yamt a2d33a3097 nfsrv_zapsock: zap an nfsd socket only if it's valid. 2004-03-17 10:43:35 +00:00
yamt 995e6c528b nfsrv_zapsock: remove slp from nfssvc_sockpending before zapping. 2004-03-17 10:42:37 +00:00
yamt ec3b565db1 nfs_sndlock: fix nfsd null dereference. 2004-03-17 10:40:34 +00:00
yamt fd4b77d30f SHUT_RDWR rather than bare 2. 2004-03-17 10:37:02 +00:00
yamt c12b63c2e0 some comments on cryptic nfsm_ macros. 2004-03-15 11:47:52 +00:00
yamt c819fadc97 shrink sizeof struct nfsnode by putting exclusive members into union. 2004-03-12 16:52:37 +00:00