* vinvalbuf needs to be called without simplelocks held
* need to release the lock in opencount > 0 case
* need to release the lock before smbfs_findclose(), since that
can send a request to SMB server and attempt to pool_get() a request buffer
problem path found & testing by Martin Husemann, fix adresses PR kern/21067
replace the VOP__UNLOCK() macros with VOP_UNLOCK() directly - it just
obfuscates the code
similarily for VN_LOCK()->vn_lock()
unlock dvp before ntvattrget call in ntfs_lookup() in '..' case, not after
fix problem in ntfs_lookup() where PDIRUNLOCK was not set in one code path
after unlocking parent directory vnode
is used to setup a 'PID' for the lock; if a SMB write request is sent
to server, it returns EDEADLK if it doesn't have same PID. since we
use '1' as request PID (see smb_rq_new()), we must use '1' here too,
for now
add a comment what is the ID used for, to avoid similar mistake in future
this partially back off rev 1.5, and makes advisory locking work
on SMB shares mounted from Windows again (sigh)
the condition was changed to be true when the file _should_ be removed,
but ended up wrong way
this fixes a problem where it wasn't possible to remove regular files
from mounted smbfs share
smbfs_smb_close() - that routine allocates memory and could sleep
problem found with LOCKDEBUG, change adresses PR kern/21067 by Martin Husemann
g/c unneeded VOP_GETATTR() call from smbfs_closel()
convert all code to use smb_{rq|t2}_alloc() instead of allocating
structures on stack, make smb_rq_init()/smb_t2_init() static and not
exported outside smb_rq.c
server supports it
for this, need NT CREATE AND X a directory in smbfs_open(), so that
we get the FID handle used for DIRECTORY CHANGE NOTIFY SMB
this could eventually be used to 'watch' even regular files, by
watching its parent directory and lookup/VN_KNOTE() when we get
REMOVED/RENAMED/MODIFIED action
also reorganize the kqueue code somewhat to use simplify locking
and knote detach
having some #ifdef UNION code in vfs_vnops.c, introduce variable
'vn_union_readdir_hook' which is set to address of appropriate
vn_readdir() hook by union filesystem when it's loaded & mounted
this is basically copy of what nfs_kq.c does - a thread periodically
polls server checking if any of the wateched files changed
eventually this should be changed to take advantage of SMB Directory
Change Notify
number
bump the timeout to 5s; eventually we'd want to do some heuristics similar
to NFS, i.e. make the attribute cache timeout longer for files nor recently
changed
This is potentially fragile, since the vnode may have been reclaimed
in vflush(), and used by different filesystem. This wouldn't actually
happen due to n_parent link to parent directory, but better safe
than sorry.
Since sm_root is only and strictly cache to speed up VFS_ROOT(),
it can be acquired/dropped any time. Rearrange code to not
require sm_root set, and change smbfs_root() back to set
sm_root if it's not set yet. smbfs_unmount() now only vrele()s
the root vnode if sm_root is set, and doesn't try reacquire it
if vflush() fails.
problem with vref() after vflush() pointed out by Bill Studenmund
smbfs_setroot()
remove pointless if() and MNT_LOCAL flag handling in smbfs_unmount()
turn the check for non-null sm_root to KASSERT() in smbfs_statfs()
adjust some comments
* lock/unlock mntvnode_slock and vnode interlock appropriately
* use LK_NOWAIT for vget()
* adjust the check for vnode being dirty to check fs-private 'modified' flag,
and drop waitfor/VOP_ISLOCKED() check
former smbfs_hash() may have accessed memory past buffer (ouch!), and accessed
memory in alignment-unsafe way
as an added bonus, hash32_strn() appears to have better distribution