Commit Graph

186 Commits

Author SHA1 Message Date
itojun ce112dfc4f add -t option for gmt time offset (normally MS-DOS filesystem has timestamp
in localtime, not GMT).  PR kern/22717
2003-09-07 22:09:11 +00:00
jdolecek 4b005d1443 sprinkle __attribute__((__packed__)) to structures representing on-disk data
this hopefully fixes problem with reading filecore FS under i386, reported
on current-users@ (thread 'acorn32 disk on i386')
2003-09-06 13:56:42 +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
jdolecek 28d75bbaf3 remove all traces of non-working quota support
add quota support to TODO - makes sense only once writing support
would be implemented, and only once NTFS would support notion of file 'owner'

adresses kern/21967 by Martin Husemann
2003-08-02 12:11:56 +00:00
jdolecek 62e0ed44c8 Allow separate masks for files and directories. Useful e.g. to turn
the execute bit off for files, but keep search permission for directories.
Change contributed in PR kern/21538 by Pavel Arnost, based on some FreeBSD
patches.
Further manpage changes, and backward-compatibility adjustments done by me.

Also fixes PR kern/16778 by Johan Danielsson, and PR kern/3400 by Rick Byers
2003-08-02 11:41:19 +00:00
rearnsha 03d5740677 Fix a build failure when NFSSERVER. Unconditionally define
filecore_lease_check to genfs_lease_check (was previously lease_check
which isn't defined anywhere).  No need to include opt_nfsserver.h
any more.
2003-07-06 17:52:08 +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 d189d63466 Fix problems with the ktrace/lwp changes. 2003-06-29 18:53:52 +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
thorpej 7da140a1a2 Fix problems with Darren's ktrace/lwp changes. 2003-06-29 15:11:48 +00:00
martin b13abb2046 Fix a few small glitches (struct proc -> struct lwp) 2003-06-29 12:17:21 +00:00
darrenr 28c230cff5 More changes for providing lwpid for ktrace (sparc GENERIC built) 2003-06-29 09:56:29 +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
itojun 3b8a1d1f0c strlcpy 2003-06-26 05:26:45 +00:00
martin 864f19482a #ifdef _KERNEL_OPT police 2003-06-23 14:59:21 +00:00
martin 79b00c490a Disable QUOTA for ntfs - it's broken. 2003-06-23 11:53:47 +00:00
martin d505b18964 Make sure to include opt_foo.h if a defflag option FOO is used. 2003-06-23 11:00:59 +00:00
reinoud 0e1ab03bd7 Fix a botch in a boolean expression. Thanks to Martim Husemann for the fix
:)

PR kern/21816: Big DVD's with cd9660 fs (can) crash Alpha can be closed
allready :)
2003-06-07 12:00:07 +00:00
itojun 25b677f86d use strlcpy. check size if we are to use namei buffer. 2003-05-16 05:09:11 +00:00
christos 94f1b04361 fix a few missing malloc attach/detach. Now this works. 2003-04-24 07:50:19 +00:00
christos 77500fa37f forgot one malloc attach/detach 2003-04-22 17:23:47 +00:00
christos baf70d805d explicitly attach and detach malloc types like smbfs does; thanks jaromir. 2003-04-22 16:48:19 +00:00
christos 80ecd573c0 PR/1796: John Kohl: statfs misbehaves under chrooted environments.
- Under chroot it displays only the visible filesystems with appropriate paths.
- The statfs f_mntonname gets adjusted to contain the real path from root.
- While was there, fixed a bug in ext2fs, locking problems with vfs_getfsstat(),
  and factored out some of the vfsop statfs() code to copy_statfs_info(). This
  fixes the problem where some filesystems forgot to set fsid.
- Made coda look more like a normal fs.
2003-04-16 21:44:18 +00:00
jdolecek 39a063b681 back to genfs_eopnotsupp() for vop_remove, vop_link, vop_rename,
vop_mkdir, vop_rmdir - it does the right unlocking now
2003-04-10 21:57:26 +00:00
jdolecek b41f818f25 change some printf()s on easily-triggerable codepaths to dprintf() 2003-04-10 21:37:32 +00:00
jdolecek d135e24e2d fix couple more simple lock issues on smbfs_close() code path:
* 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
2003-04-09 18:57:29 +00:00
jdolecek 1f29707d43 move ntfs_remove() to be together with the other dummies - easier to c&p
eventually
2003-04-09 18:46:47 +00:00
jdolecek 6810b56243 add dummy link, rename, mkdir, rmdir vnode ops, which release the
appropriate vnodes before failing with EOPNOTSUPP - this is necessary
to not deadlock later
2003-04-09 18:41:05 +00:00
jdolecek 011c1952fd #if 0 some no longer used macros; keep around for refence 2003-04-09 16:18:56 +00:00
jdolecek af5ced0d31 replace VOP__UNLOCK(), VN_LOCK(), VGET() macros with the real thing, to
imporove readability
g/c some non-NetBSD code for same reason
2003-04-09 16:18:17 +00:00
jdolecek 81d7a920df print some potentially useful stuff in ntfs_print()
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
2003-04-09 16:12:18 +00:00
jdolecek a0e0f99677 add real ntfs remove vnode op, which releases vnode locks on parent directory
and the file vnode before returning EOPNOTSUPP
fixes PR kern/19595 by Erik Berls
2003-04-09 16:02:18 +00:00
jdolecek 1ae0467918 back to passing magic '1' as lock id in smbfs_advlock() - the number
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)
2003-04-08 21:06:33 +00:00
jdolecek a66d80ca2a smbfs_remove(): undo broken condition change from rev. 1.3 - apparently
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
2003-04-08 19:01:00 +00:00
jdolecek 3068339e18 fix locking issues uncovered by LOCKDEBUG, reorganize code a bit so that
even the initial directory notify request is sent by smbkq thread
problems found during LOCKDEBUG hunt, adresses PR kern/21067 by Martin Husemann
2003-04-08 18:16:01 +00:00
jdolecek 9e423ce633 release the vnode interlock sooner in smbfs_close[l](), before calling
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()
2003-04-08 17:09:22 +00:00
jdolecek 293074e648 attach/detach also malloc type M_SMBFSHASH ('oops') 2003-04-08 16:26:31 +00:00
jdolecek 1cd92a1660 use pools instead of malloc(9) for allocation of smb request structures
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
2003-04-07 19:35:39 +00:00
jdolecek e9a8600833 smbfs_closel(): fix inverted test in directory case 2003-04-07 19:31:01 +00:00
jdolecek e9680c83fc add TNF copyright licence for recent changes 2003-04-07 13:56:13 +00:00
jdolecek 7dbdaa2a4e smbfs_open(): reenable code mistakely #if 0'd in previous revision, make
sure it's only skipped in 'directory' case
2003-04-07 12:21:40 +00:00
jdolecek db1373faf6 g/c smbfs_kqinit() prototype, it is no more 2003-04-07 12:04:40 +00:00
jdolecek c0fd3735dc use NT DIRECTORY CHANGE NOTIFY to watch for directory kevents if the
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
2003-04-07 12:04:15 +00:00
christos 510b8e4284 Avoid stupid printfs during mountroot attempt. 2003-04-03 15:37:55 +00:00
jdolecek a9bdad15e9 when loaded via LKM, need to malloc_type_{attach|detach} used malloc
types on load/unload appropriately
XXX this should really be automated somehow
2003-04-02 16:26:53 +00:00
jdolecek 0e263cfbbf g/c M_SMBFSMNT, it is not used anymore 2003-04-02 11:18:08 +00:00
jdolecek 6056ed86d2 smbfs_writevnode(): print offset as %lld in debug message, and
also print error returned from smb_write()
minor whitespace change in #ifdef notyet code
2003-03-24 13:52:59 +00:00
jdolecek 8ed4fb0379 smbfs_getattr(): make 'oldsize' 64bit, it's used to hold file size
this is necessary for I/O to offset > 4G to actually be written
at proper place, rather than trimming offset to 32bit value
2003-03-24 13:50:10 +00:00
jdolecek 702d1ac1b2 adjust some debug messages 2003-03-24 13:30:44 +00:00
jdolecek 1864eaa69a directories don't have any size in smbfs/CIFS, so don't compare
size in smbfs_kqpoll() neither in filt_smbfsread()
this fixes kqueue on smbfs directory to not flag directory as 'changed'
all the time
2003-03-24 06:39:51 +00:00
jdolecek 7d43984704 g/c some unneeded forward struct declarations 2003-03-23 17:54:26 +00:00
jdolecek b05cd2b635 translate ERRDOS/ERRnofiles to ENOENT in smb_maperror(), and simplify
handling in smbfs_smb_search() appropriately - avoids using
sr_errclass&sr_serror too
2003-03-23 16:55:54 +00:00
dsl bd99e3429d Use 'void *' instead of 'caddr_t' in prototypes of VOP_IOCTL, VOP_FCNTL
and VOP_ADVLOCK, delete casts from callers (and some to copyin/out).
2003-03-21 23:11:19 +00:00
jdolecek 104bc312b7 add kqueue support 2003-03-17 11:39:16 +00:00
jdolecek b26a2a3bdd no need to export union_vfsops here 2003-03-17 10:31:14 +00:00
jdolecek b712ffbfbd add comment for one NULL union_vfsops member 2003-03-17 10:28:41 +00:00
jdolecek 46eb0d5bf0 make it possible for UNION fs to be loaded via LKM - instead of
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
2003-03-17 09:11:29 +00:00
jdolecek a0deb3e9c4 move union filesystem code from sys/miscfs/union to sys/fs/union 2003-03-16 08:26:46 +00:00
kristerw 708df50a74 'lint' is a very bad name for a variable. 2003-03-15 02:22:13 +00:00
jdolecek fedc587dac #if 0/notnow stuff which isn't currently used
pointed out by Krister Walfridsson
2003-03-03 21:17:05 +00:00
jdolecek b7335072c2 add kqueue (EVFILT_READ, EVFILT_WRITE, EVFILT_VNODE) support
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
2003-03-02 22:06:50 +00:00
jdolecek fe1daad52a add SMBFS_ATTRTIMO for the attribute cache timeout, instead of magic
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
2003-02-27 09:14:25 +00:00
jdolecek 0161f51190 g/c prototype for smbfs_ioctl() 2003-02-27 08:54:26 +00:00
jdolecek 88db5b512b Don't try to reacquire root vnode if vflush() in smbfs_unmount() fails.
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
2003-02-26 20:21:40 +00:00
jdolecek e651d04ed9 split the part of smbfs_root() which sets sm_root to separate function
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
2003-02-26 18:16:37 +00:00
jdolecek 90bb788eb7 smbfs_sync(): need to explicitly ignore VNON vnodes (e.g. syncer vnode) 2003-02-25 23:57:27 +00:00
jdolecek c0e6d2aa07 make smbfs_sync() look more like sync routines for other fs, particularily:
* 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
2003-02-25 22:17:20 +00:00
jdolecek 68f0f8227e sprinkle VN_KNOTE()s 2003-02-25 10:33:19 +00:00
jdolecek d423ea284d make 'dosdirtemplate' static const 2003-02-25 10:29:12 +00:00
jdolecek 049525126a remove the XXX comment about holes again - it appears to work fine 2003-02-25 10:14:29 +00:00
jdolecek f9d42ade36 add __KERNEL_RCSID() 2003-02-25 09:09:31 +00:00
jdolecek 4f6180461f switch to hash32_strn() from <sys/hash.h> as the hash function -
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
2003-02-24 21:52:53 +00:00
jdolecek b0c6be8be5 add XXX comment regarding holes - they are not handled properly
in write, this needs to be fixed eventually (unless it would work
by luck)
2003-02-24 21:29:48 +00:00
jdolecek 968351dd0d g/c smbfs_hashprint() 2003-02-24 21:27:55 +00:00
jdolecek 0c3d39c642 enable mmap and seek vnode ops - this makes mmap(2), lseek(2),
p{read,write}{,v}(2) work
2003-02-24 19:09:02 +00:00
jdolecek 26d1332b7c since smbfs_fctx.f_fname is always used as 'char', may as well define it
that way rather than u_char
2003-02-24 18:45:35 +00:00
jdolecek b5a66cd65b use pool to allocate memory for smbfs nodes
rename smbfs_uninit() to smbfs_done()
some whitespace fixes + use FREE() (not free()) for MALLOC()ed memory
2003-02-24 18:41:04 +00:00
jdolecek 6d0edf1d1b smbfs_lookup():
* 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
2003-02-24 16:19:05 +00:00
jdolecek ba728ab921 smbfs_node_alloc():
* 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
2003-02-24 15:55:08 +00:00
jdolecek a7a5a493b5 SMBERROR() purge - turn into #ifdef DIAGNOSTIC panics 2003-02-24 10:01:02 +00:00
jdolecek 38b6d81ba3 update for changed locking requirements for smb_share_put() 2003-02-24 09:57:31 +00:00
jdolecek da9a088d46 SMBERROR() purge - replace with KASSERT()s, panic or remove altogether
as appropriate
2003-02-24 09:30:42 +00:00
jdolecek d8ab9af5e5 need <sys/mount.h> now 2003-02-24 09:18:56 +00:00
jdolecek f31ba31b00 change smbfs_args:
* 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
2003-02-23 22:31:17 +00:00
jdolecek 999273657a put the printf about version mismatch inside #ifdef SMB_VNODE_DEBUG
do not touch sm_args.mount_point[]
2003-02-23 22:20:05 +00:00
christos 8bf6b72335 style; no space after cast, and add cast to the assignment case too. 2003-02-23 22:03:11 +00:00
jdolecek e211d06862 add genfsops necessary for genfs_*{get|put}pages() to actually work
use 'compat' getpages and gop_write - smbfs doesn't have bmap vnode op (yet)
2003-02-23 21:55:20 +00:00
jdolecek ee219745fe remove bogus (u_long) cast for uvm_vnp_setsize() arg in smbfs_setattr() 2003-02-23 21:54:05 +00:00
jdolecek a7bf0f25db g/c some dead code
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()
2003-02-23 21:33:06 +00:00
jdolecek ccf56de797 KASSERT() smp->sm_root is nonnull in unmount
g/c unneeded variable in smbfs_root()
2003-02-23 21:27:33 +00:00
jdolecek 9a7b95383e fix KASSERT() in smbfs_findnextLM1() to actually compile 2003-02-23 21:26:26 +00:00
jdolecek 5c7688a6f3 g/c compatibility defines PROC_LOCK()/PROC_UNLOCK() 2003-02-23 19:35:14 +00:00
jdolecek 24a773c6ef g/c smbfs_pbuf_freecnt, it's not used (it was not even declared on NetBSD) 2003-02-23 19:30:13 +00:00
jdolecek 21a1fae4a8 g/c smbfs_debuglevel, it's not used anywhere
pointed out by Krister Walfridsson
2003-02-23 18:47:10 +00:00
jdolecek eb5d35152e remove non-NetBSD smbfs_vnodeop_entries[], smbfs_vnodeop_opv_desc 2003-02-23 17:28:48 +00:00
jdolecek c3fb3ac103 g/c smbfs_getpages()/smbfs_putpages() we don't use on NetBSD 2003-02-23 17:28:01 +00:00
jdolecek 164de9f034 make DIFF1970TO1601 static
problem reported in FreeBSD patch request #43613 by Matt Emmerton
2003-02-21 21:46:45 +00:00
jdolecek 5a426e7c8f g/c smbfs_fastlookup
make smbfs_readvdir() slightly more readable, and don't adjust uio_offset
by hand
g/c the lock code around smbfs_readvdir() - a) it's not needed here b) it
didn't do anything anyway
add some KASSERTs
simplify smbfs_vinvalbuf() a bit, use plain interruptible sleep instead
of smb_proc_intr()
2003-02-21 20:19:00 +00:00
jdolecek dfc181b14f some KNF, add a KASSERT() for smbfs_findnextLM1() case
replace some 'never should happen' printfs with KASSERTs
2003-02-21 20:15:01 +00:00
jdolecek 50fa881e7b g/c unneeded local variables in smbfs_read()/smbfs_readdir() 2003-02-21 20:13:21 +00:00