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
* make sure islastcn and lockparent is set before used when the entry is cached
* add VWRITE check for nameiop == RENAME, add necessary unlock/relock for
ISDOTDOT case
adjust smbfs_print() to have slightly nicer output
enable vnode locking
* use LK_RETRY for the vget()
* turn the check for dead parent vnode to #ifdef DIAGNOSTIC panic
* reformat the hash walk code a little, and only assign vp if entries match
* add some comments
* g/c unused members 'mount_point', 'root_path', which only take space
* rename 'dev' to 'dev_fd' to more closely match what it is
* add 'export' member to avoid changing this again if ever smbfs would
be made exportable
bump SMBFS_VERMIN - ABI/API change; mount_smbfs needs to be recompiled
to work again
make smbfs_name_{alloc|free} inline
turn some checks for smbfs code errors to KASSERT()s
KNF some
also initialize n_size in smbfs_node_alloc()
g/c write-only variable in smbfs_nget()