Commit Graph

962 Commits

Author SHA1 Message Date
yamt
7e98ba85a6 nfsrv_setattr: revive nfsm_srvsattr which was (mistakenly?)
removed with caddr_t.
2007-03-05 23:18:50 +00:00
christos
53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
yamt
5057834077 nfs_getpages: fix an inverted condition in rev.1.147. 2007-02-27 10:03:56 +00:00
thorpej
b3667ada6d TRUE -> true, FALSE -> false 2007-02-22 06:05:00 +00:00
thorpej
712239e366 Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
2007-02-21 22:59:35 +00:00
pooka
033e539d53 after freeing cookies, set the pointer to NULL to prevent dangling reuse 2007-02-20 16:27:21 +00:00
ad
adbb9ec2fa Call genfs_node_destroy() where appropriate. 2007-02-20 16:21:03 +00:00
yamt
6d6b5c51d6 use mutex and rwlock rather than lockmgr. 2007-02-15 16:01:51 +00:00
ad
b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
chs
f0cdf39d80 add back a mistakenly removed vput(). 2007-02-05 16:03:53 +00:00
yamt
cb2e7baf50 have a mowner dedicated to nfs reply cache. 2007-02-05 11:55:45 +00:00
yamt
7224686465 nfsrv_updatecache: actually use reply caches for connection oriented protocols. 2007-02-05 11:55:03 +00:00
chs
0507747213 more fixes for the new vnode locking scheme:
- don't use SAVESTART in calls to relookup() from unionfs,
   just vref() the desired vnode when we need to.
 - fix locking and refcounting in the unionfs EEXIST error cases.
 - release any vnode locks before calling VFS_ROOT(), vfs_busy() is enough.
   this allows us to simplify union_root() and fix PR 3006.
 - union_lock() doesn't handle shared lock requests correctly,
   so convert them to exclusive instead.  fixes PR 34775.
 - in relookup(), avoid reusing "dp" for different purposes,
   the error handling wasn't right.  (actually just get rid of dp.)
   also, change relookup() to ignore LOCKLEAF and always return the
   vnode locked since the callers already expect this.
2007-02-04 15:03:20 +00:00
chs
6721fd793e in nfsrv_rename(), change vput(fdirp) back to vrele() since the dirp
returned from nfs_namei() is not locked in this case.  fixes PR 35542.
also, apply the same fix here as was made in rename_files() to handle
the case when dvp and vp are the same.
2007-02-04 14:48:51 +00:00
hubertf
142c2a33ba Remove duplicate #includes, patch contributed in private mail
by Slava Semushin <slava.semushin@gmail.com>.

To verify that no nasty side effects of duplicate includes (or their
removal) have an effect here, I've compiled an i386/ALL kernel with
and without the patch, and the only difference in the resulting .o
files was in shifted line numbers in some assert() calls.
The comparison of the .o files was based on the output of "objdump -D".

Thanks to martin@ for the input on testing.
2007-01-24 13:08:11 +00:00
hannken
1b9c6382e3 New file system suspension API to replace vn_start_write and vn_finished_write.
The suspension helpers are now put into file system specific operations.
This means every file system not supporting these helpers cannot be suspended
and therefore snapshots are no longer possible.

Implemented for file systems of type ffs.

The new API is enabled on a kernel option NEWVNGATE.  This option is
not enabled by default in any kernel config.

Presented and discussed on tech-kern with much input from
Bill Studenmund <wrstuden@netbsd.org> and YAMAMOTO Takashi <yamt@netbsd.org>.

Welcome to 4.99.9 (new vfs op vfs_suspendctl).
2007-01-19 14:49:08 +00:00
yamt
2224a4350f plug a mbuf leak. 2007-01-17 12:40:36 +00:00
yamt
3be095f658 plug mbuf leaks. 2007-01-17 12:40:08 +00:00
elad
8426ae751a Consistent usage of KAUTH_GENERIC_ISSUSER. 2007-01-04 20:24:08 +00:00
yamt
a23a6ee6c6 remove several nqnfs definitions. 2006-12-28 00:39:03 +00:00
yamt
431da137b1 - remove the rest of nqnfs.
- reject NFSMNT_MNTD and NFSMNT_KERB.  (no users in tree.)
2006-12-27 12:51:22 +00:00
yamt
ccfd2c0df0 remove nqnfs. 2006-12-27 12:10:09 +00:00
chs
c398ae9734 a smorgasbord of improvements to vnode locking and path lookup:
- LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
   these now always return the parent vnode locked.  namei() works as before.
   lookup() and various other paths no longer acquire vnode locks in the
   wrong order via vrele().  fixes PR 32535.
   as a nice side effect, path lookup is also up to 25% faster.
 - the above allows us to get rid of PDIRUNLOCK.
 - also get rid of WANTPARENT (just use LOCKPARENT and unlock it).
 - remove an assumption in layer_node_find() that all file systems implement
   a recursive VOP_LOCK() (unionfs doesn't).
 - require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
   fill in eopnotsupp() for file systems that don't support being exported
   and remove the checks for NULL.  (layerfs calls these without checking.)
 - in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
   adjust which vnode is locked.  fixes PR 33374.
 - apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().
2006-12-09 16:11:50 +00:00
yamt
9c62b6fe1d nfs_disconnect: 2 -> SHUT_RDWR. no functional change. 2006-12-06 09:13:46 +00:00
yamt
6c575a38c3 nfsrv_rcv: claim ownership of received mbufs. 2006-12-06 08:55:52 +00:00
yamt
89682b24fe remove some __unused in function parameters. 2006-11-09 09:53:57 +00:00
mjf
a2be0ed655 Revert the changes I introduced trying to solve tmpfs' NFS export problem.
Requested by yamt@
2006-10-31 08:12:46 +00:00
jmmv
bccb33bf70 Fix a typo in a comment. 2006-10-30 16:06:05 +00:00
reinoud
dc5b5420b9 Revisit mnt_vnodelist TAILQ patch. Remove all suspicious TAILQ_FOREACH()
loops where vnodes can get removed or added during the loops. This could
lead to panic's on unmount since nodes are skipped or otherwise
TAILQ_NEXT(0xdeadbeef, ...) was dereferenced.
2006-10-25 22:01:54 +00:00
mjf
84bd46b9f9 Add support to allow a file system to not permit being exported over NFS.
Approved by elad@ and wrstuden@
2006-10-24 21:53:10 +00:00
pooka
96d8335980 kauth_cred_uucvt() -> kauth_uucred_to_cred(), introduce kauth_cred_to_uucred()
per tech-kern proposal
2006-10-22 13:07:15 +00:00
reinoud
0ce809091d Replace the LIST structure mp->mnt_vnodelist to a TAILQ structure since all
vnodes were synced and processed backwards. This meant that the last
accessed node was processed first and the earlierst last.

An extra benefit is the removal of the ugly hack from the Berkly days on
LFS.

In the proces, i've also replaced the various variations hand written loops
by the TAILQ_FOREACH() macro's.
2006-10-20 18:58:12 +00:00
dogcow
372e6ef309 now that we have -Wno-unused-parameter, back out all the tremendously ugly
code to gratuitously access said parameters.
2006-10-17 18:21:29 +00:00
christos
3b347a3429 another variable should have been _KERNEL only. 2006-10-17 14:55:13 +00:00
christos
0a3d351aae don't expose kernel variables to userland. 2006-10-17 14:53:54 +00:00
yamt
583781abd3 grab glock when calling uvm_unp_setsize, so that it doesn't interfere
mmap'ed accesses.  this fixes an assertion failure in in nfs_doio_read.
("vp->v_size >= uiop->uio_offset + uiop->uio_resid")
2006-10-14 09:18:57 +00:00
christos
6c265266c5 more __unused 2006-10-13 20:53:59 +00:00
dogcow
44603cac1f more unused variable fallout. 2006-10-13 18:28:06 +00:00
christos
4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
dogcow
55ddfc9aae change the MOWNER_INIT define to take two args; fix extant struct mowner
decls to use it. Makes options MBUFTRACE compile again and not whinge about
missing structure declarations. (Also makes initialization consistent.)
2006-10-10 21:49:14 +00:00
drochner
429dff1c3d Flush regular files before setattr also if the mode bits are going to
be set. Linux NFS servers (at least) reset suid/sgid bits if a write
happens afterwards. Add a comment why this is done.
This fixes system builds on diskless systems for me where suid bits
were missing after install(1).
Approved by yamt.
2006-09-29 16:19:50 +00:00
yamt
ff1a471a3b nfs_ispublicfh: fix another instance of cast-qual. 2006-09-04 08:38:16 +00:00
yamt
80fe9dcf8f remove (void *) cast from NFSRVFH_DATA as it sometimes
discards const qualifier.  pointed out by Havard Eidnes.
(it wasn't detected by in-tree gcc4.  seems like a compiler bug.)
2006-09-04 08:27:49 +00:00
yamt
8b789e8490 nfs_fhtovp: try to detect stale or invalid handles by issuing VOP_GETATTR. 2006-09-02 13:37:52 +00:00
yamt
b45e7d3197 nfsdreq_free: remove an assertion which is not true. 2006-09-02 13:30:08 +00:00
yamt
3311de9ddc implement vptofh and fhtovp for nfs. 2006-09-02 12:40:58 +00:00
yamt
d7d8adb6ea nfsd: deal with variable-sized filehandles. 2006-09-02 12:40:36 +00:00
yamt
d70ea60617 #ifdef out nqsrv_getlease and friends unless defined(NFSSERVER). 2006-09-02 12:39:59 +00:00
christos
57eb3ffe77 fix default type decls
fix incomplete initializer
2006-09-02 07:26:47 +00:00
christos
da9052a357 Don't free what we did not allocate. 2006-08-24 12:40:39 +00:00