Commit Graph

234 Commits

Author SHA1 Message Date
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
jdolecek d1e0d393ca initialize gmtoff in mount structure if mount version is < 3 2004-04-27 17:25:50 +00:00
christos 9ec61a4e56 fix compile error (thanks Juan RP) 2004-04-26 20:38:22 +00:00
christos c30382f197 fix fragment size. 2004-04-26 17:08:45 +00:00
christos 85a8e7acfa fill namemax 2004-04-26 17:08:34 +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
christos 6bd1d6d4db Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
2004-04-21 01:05:31 +00:00
jdolecek 9705c5db44 properly version the msdosfs mount structure after addition
of gmt time offset support (Hi Itojun!); adresses most important
part of PR kern/25226 by Todd Whitesel
2004-04-19 07:53:58 +00:00
atatat 284a91c3ab Manually attach malloc types when being built as an lkm. 2004-03-27 04:43:43 +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
jdolecek 2c39ad3ea5 remove apparently meaningless part of one debug printf insmbfs_lookup() 2004-03-22 16:40:48 +00:00
jdolecek d8d0d9d81f g/c redundant debug printf 2004-03-22 16:39:30 +00:00
jdolecek e36d8bbf0f in smbfs_smb_lookup(), check the returned (found) file name matches
exactly the filename we wanted to lookup, so that file names differing
in case are refused right away

resolves the chdir part of PR kern/22835 by Rob Quinn (cd succeeded when
it was supposed to fail)
2004-03-21 16:04:07 +00:00
jdolecek 93afaf4fc0 use SMBVDEBUG() instead of #ifdef SMB_VNODE_DEBUG 2004-03-21 13:43:46 +00:00
jdolecek 76763df930 no need of #ifdef SMB_VNODE_DEBUG around SMBVDEBUG() 2004-03-21 13:43:09 +00:00
jdolecek 8c5dfdc365 Allow the [, ], and = characters in non-8.3 filenames since they
are allowed by Windows (ref: MS KB article 120138).

Change follows FreeBSD rev. 1.40
2004-03-21 10:24:01 +00:00
jdolecek 64022a06e1 Add missing permission checks to the smbfs VOP_SETATTR vnode op for the
case where the caller requests to change access or modification times.
Change obtained from FreeBSD rev. 1.30
2004-03-20 21:03:42 +00:00
jdolecek bfa09b45ff ditch busted access check in smbfs_access(), and use vaccess() instead;
also normalize function contents to resemble other filesystems,
and add a SMBVDEBUG() to ease eventual future debugging

partially based on FreeBSD rev. 1.29

fixes PR kern/23373 by Piotr Stolc
2004-03-20 20:26:28 +00:00
jdolecek f3503f30a7 escape the backslash in badchars so that smbfs_pathcheck() correctly
rejects pathnames with backslashes in them (and to avoid a syntax error)

change from FreeBSD
2004-03-20 19:48:30 +00:00
jdolecek edb0fb0a4c pullup FreeBSD change rev. 1.44 - restore closing of SMB find handle
in smbfs_close(); it's necessary to overcome limitation of the current
directory lookup code

this fixes problem where ls wouldn't show newly created files, such as:
> touch a b c
> ls
>

problem and fix pointed out by YAMAMOTO Takashi
2004-03-20 18:41:02 +00:00
jdolecek 1c8e4dd167 add comment to smbfs_remove() regarding the limitation to only remove
unreferenced files
2004-02-29 12:19:15 +00:00
jdolecek b4b58e65b1 print info about active vnodes in reclaim/inactive if prtactive is set 2004-02-29 12:17:39 +00:00
jdolecek 1a3236aefa close the SMB handle when vnode is inactivated, rather than on file close,
so that mmap()ped regions remain accessible even when the file descriptor
is closed
g/c smbnode's n_opencount, and have single NOPEN flag instead

fixes PR kern/24516 by Lloyd Parkes

change obtained from FreeBSD, with only minor adjustments
2004-02-29 11:47:08 +00:00
jdolecek 4ba68533b9 use global prtactive setting instead of ntfs-specific variable;
this also changes default, to not print the active vnodes
2004-02-29 11:08:55 +00:00
jdolecek 8af8547957 smbfs_rename(): #ifdef notyet some code related to disabled smbfs_smb_move(),
and also fix a return in the code section - we need to do vnode cleanup
before returning error
2004-02-28 09:19:53 +00:00
jdolecek 0a48f48a91 smbfs_rename(): only touch attribute cache properties if the operation
is carried out; particularily, don't touch it if the rename files
due to EXDEV - the 'from' or 'to' vnode may not be on smbfs filesystem
at all in that case
this is the final fix for PR kern/24455 by Milos Urbanek
2004-02-28 09:04:00 +00:00
wiz e4612a6a03 achieved, not acheived. From Peter Postma. 2004-02-24 15:23:16 +00:00
wiz dc4cc98b15 becuase -> because. From Peter Postma. 2004-02-24 15:05:53 +00:00
jdolecek 756045a44e fix PNBUF_PUT() calls:
* it should not be called for rmdir or remove vop
* for create and mkdir, it should only be called on error, or when
  SAVESTART flag is not set

fixes PR kern/24455 by Milos Urbanek
2004-02-22 11:14:08 +00:00
jdolecek 209952cca8 make VOP_UPDATE() trivially succeed (without doing anything), instead
of returning error

this makes it possible to mount other filesystems on directory on NTFS
filesystem
2004-02-22 10:26:14 +00:00
jdolecek ff7bf7ee82 use 64bit local variable for free space computation 2004-02-22 08:18:11 +00:00
hannken d6170777cf Fix xxx_strategy() to use the vnode arg instead of bp->b_vp. 2004-01-26 10:39:29 +00:00
hannken 3db4e2acd8 Make VOP_STRATEGY(bp) a real VOP as discussed on tech-kern.
VOP_STRATEGY(bp) is replaced by one of two new functions:

- VOP_STRATEGY(vp, bp)  Call the strategy routine of vp for bp.
- DEV_STRATEGY(bp)      Call the d_strategy routine of bp->b_dev for bp.

DEV_STRATEGY(bp) is used only for block-to-block device situations.
2004-01-25 18:06:48 +00:00
bjh21 a42f9e3038 Include <sys/sysctl.h> for sysctl stuff.
Also, create the vfs.filecore subtree, rather than vfs.union.
2003-12-05 00:51:08 +00:00
atatat 13f8d2ce5f Dynamic sysctl.
Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al.  Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded.  Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment.  I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.
2003-12-04 19:38:21 +00:00
christos 6dc8df292b KASSERT was not the right thing here. Instead only set the type if f_type
has been inititialized. Reported by pooka
2003-11-11 00:44:16 +00:00
simonb b6abb6ab1d Remove some assigned-to but otherwise unused variables. 2003-10-30 01:58:17 +00:00
christos 79b169b7aa Fix typo. 2003-10-25 19:10:34 +00:00
christos bbda852cff FIx uninitialized variable warnings 2003-10-25 18:33:37 +00:00
christos 2017bf9a94 Fix uninitialized variable warning 2003-10-25 18:31:59 +00:00
christos d4ca1c7d1e fix uninitialized variable 2003-10-25 08:39:05 +00:00
briggs 33a79483d0 Fix a panic that occurred when trying to traverse a corrupt msdosfs
filesystem.  With this particular corruption, the code in pcbmap()
would compute an offset into an array that was way out of bounds,
so check the bounds before trying to access and return an error if
the offset would be out of bounds.
2003-10-22 03:51:12 +00:00
hannken a3a898ff0f Add the gating of system calls that cause modifications to the underlying
file system.
The function vfs_write_suspend stops all new write operations to a file
system, allows any file system modifying system calls already in progress
to complete, then sync's the file system to disk and returns. The
function vfs_write_resume allows the suspended write operations to
complete.

From FreeBSD with slight modifications.

Approved by: Frank van der Linden <fvdl@netbsd.org>
2003-10-15 11:28:59 +00:00
dbj fe7c786886 add mnt_iflag field to struct mount for internal flags
mv MNT_GONE, MNT_UNMOUNT and MNT_WANTRDWR to this field
additonally add mnt_writeopcountupper and mnt_writeopcountlower fields
in preparation for pending write suspension support work
bump kernel version to 1.6ZD
2003-10-14 14:02:56 +00:00
lukem 2d6acee111 add bpbReserved fields 2003-10-08 04:11:43 +00:00
jdolecek 87f9bd7267 change accidentaly left debug printf to dprintf() 2003-10-06 16:47:10 +00:00
lukem 1ab040b9ee Consistently use "bsBPB" as the struct member for the BIOS parameter block. 2003-10-06 02:21:47 +00:00
yamt 589e82f2ba terminate snprintb 'new' format strings correctly.
(fixes overrun in mount_*)
2003-10-03 16:34:31 +00:00
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